Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-smf-web
Commits
9aeafe93
Unverified
Commit
9aeafe93
authored
2 years ago
by
devendra-tarento
Committed by
GitHub
2 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #2 from UPHRH-platform/cards-value-changes
card names healpers function
parents
7599d7c1
bcac76f2
master
accept_file_type
delete-form
delete-user
form-issue
inspector-model
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/constants/LangConstants.ts
+9
-1
src/constants/LangConstants.ts
src/helpers/util.ts
+23
-3
src/helpers/util.ts
src/pages/Inspector/InspectorHome.tsx
+2
-1
src/pages/Inspector/InspectorHome.tsx
src/pages/Reviewer/ReviewerHome.tsx
+1
-20
src/pages/Reviewer/ReviewerHome.tsx
with
35 additions
and
25 deletions
+35
-25
src/constants/LangConstants.ts
+
9
−
1
View file @
9aeafe93
...
...
@@ -57,6 +57,14 @@ export const LANG = {
FORM_STATUS_TEXT
:
{
SENT_FOR_INSPECTION
:
"
Sent for assessment
"
,
INSPECTION_COMPLETED
:
"
Assessment completed
"
,
INSPECTOR_TOTAL_PENDING
:
"
Assessment total pending
"
,
UNDER_REVIEW
:
"
Under review
"
},
SEND_FOR_INSPECTION
:
"
Send for assessment
"
SEND_FOR_INSPECTION
:
"
Send for assessment
"
,
METRIC_LABEL_KEY
:
{
UNDER_REVIEW
:
"
Underreview
"
,
SENT_FOR_INS
:
"
Sentforins
"
,
INS_COMPLETED
:
"
Inscompleted
"
,
INSPECTOR_TOTAL_PENDING
:
"
Inspector total pending
"
}
};
This diff is collapsed.
Click to expand it.
src/helpers/util.ts
+
23
−
3
View file @
9aeafe93
import
{
APP
}
from
"
../constants
"
;
import
{
APP
,
LANG
}
from
"
../constants
"
;
const
getRoleLabel
=
(
roleName
:
string
)
=>
{
...
...
@@ -13,5 +13,25 @@ const getRoleLabel = (roleName: string) => {
return
APP
.
ROLE_LABEL
.
SUPER_ADMIN
;
}
}
export
default
{
getRoleLabel
};
\ No newline at end of file
// Function to format the status label
export
const
formatLabel
=
(
labelStatus
:
string
)
=>
{
let
lowerLabel
=
labelStatus
.
toLowerCase
();
lowerLabel
=
lowerLabel
.
charAt
(
0
).
toUpperCase
()
+
lowerLabel
.
slice
(
1
);
switch
(
lowerLabel
)
{
case
`
${
LANG
.
METRIC_LABEL_KEY
.
UNDER_REVIEW
}
`
:
lowerLabel
=
`
${
LANG
.
FORM_STATUS_TEXT
.
UNDER_REVIEW
}
`
;
return
lowerLabel
;
case
`
${
LANG
.
METRIC_LABEL_KEY
.
SENT_FOR_INS
}
`
:
lowerLabel
=
`
${
LANG
.
FORM_STATUS_TEXT
.
SENT_FOR_INSPECTION
}
`
;
return
lowerLabel
;
case
`
${
LANG
.
METRIC_LABEL_KEY
.
INS_COMPLETED
}
`
:
lowerLabel
=
`
${
LANG
.
FORM_STATUS_TEXT
.
INSPECTION_COMPLETED
}
`
;
return
lowerLabel
;
case
`
${
LANG
.
METRIC_LABEL_KEY
.
INSPECTOR_TOTAL_PENDING
}
`
:
lowerLabel
=
`
${
LANG
.
FORM_STATUS_TEXT
.
INSPECTOR_TOTAL_PENDING
}
`
;
return
lowerLabel
;
default
:
return
lowerLabel
;
}
}
export
default
{
getRoleLabel
,
formatLabel
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/pages/Inspector/InspectorHome.tsx
+
2
−
1
View file @
9aeafe93
...
...
@@ -7,6 +7,7 @@ import { FormService } from "./../../services/form.service";
import
{
APP
,
LANG
}
from
"
./../../constants
"
;
import
Notify
from
"
./../../helpers/notify
"
;
import
moment
from
"
moment
"
;
import
{
formatLabel
}
from
"
../../helpers/util
"
;
/**
* Inspector component renders
...
...
@@ -174,7 +175,7 @@ export const InspectorHome = ({ data }: InspectorProps) => {
className
=
"col-sm-12 col-md-4 col-lg-2 col-xl-2 col-xxl-2 mt-2 mt-sm-2 mt-md-2 mt-lg-0 mt-xl-0 mt-xxl-0"
key
=
{
j
}
>
<
CardOne
count
=
{
i
.
value
}
title
=
{
i
.
key
}
/>
<
CardOne
count
=
{
i
.
value
}
title
=
{
formatLabel
(
i
.
key
)
}
/>
</
div
>
);
})
}
...
...
This diff is collapsed.
Click to expand it.
src/pages/Reviewer/ReviewerHome.tsx
+
1
−
20
View file @
9aeafe93
...
...
@@ -6,6 +6,7 @@ import { FormService } from "../../services/form.service";
import
{
APP
,
LANG
}
from
"
../../constants
"
;
import
{
BtnOne
}
from
"
../../components/buttons
"
;
import
{
useHistory
}
from
"
react-router-dom
"
;
import
{
formatLabel
}
from
"
../../helpers/util
"
;
/**
* Reviewer component renders
...
...
@@ -115,26 +116,6 @@ export const ReviewerHome = ({ data }: ReviewerProps) => {
);
};
// Function to format the status label
const
formatLabel
=
(
labelStatus
:
string
)
=>
{
let
lowerLabel
=
labelStatus
.
toLowerCase
();
lowerLabel
=
lowerLabel
.
charAt
(
0
).
toUpperCase
()
+
lowerLabel
.
slice
(
1
);
switch
(
lowerLabel
)
{
case
"
Underreview
"
:
lowerLabel
=
"
Under review
"
;
return
lowerLabel
;
case
"
Sentforins
"
:
lowerLabel
=
`
${
LANG
.
FORM_STATUS_TEXT
.
SENT_FOR_INSPECTION
}
`
;
return
lowerLabel
;
case
"
Inscompleted
"
:
lowerLabel
=
`
${
LANG
.
FORM_STATUS_TEXT
.
INSPECTION_COMPLETED
}
`
;
return
lowerLabel
;
default
:
return
lowerLabel
;
}
};
return
(
<
Fragment
>
<
div
className
=
"container-fluid"
>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets