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
d287f95d
Commit
d287f95d
authored
2 years ago
by
devendra
Browse files
Options
Download
Patches
Plain Diff
Feat: Role lables are updated
parent
b3b791e6
master
accept_file_type
cards-value-changes
delete-form
delete-user
form-issue
inspector-model
label-change
No related merge requests found
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
src/components/common/Header.tsx
+6
-5
src/components/common/Header.tsx
src/components/dashboard/Dashboard.js
+7
-6
src/components/dashboard/Dashboard.js
src/components/form/FormViewer.js
+11
-11
src/components/form/FormViewer.js
src/components/modal/InspectionScheduleModal.tsx
+2
-2
src/components/modal/InspectionScheduleModal.tsx
src/components/status-bar/StatusBarLarge.tsx
+2
-2
src/components/status-bar/StatusBarLarge.tsx
src/constants/AppConstants.ts
+7
-0
src/constants/AppConstants.ts
src/helpers/util.ts
+17
-0
src/helpers/util.ts
src/layouts/Inspector/ConsentFormView.tsx
+4
-3
src/layouts/Inspector/ConsentFormView.tsx
src/layouts/Inspector/InspectionSummaryLayout.tsx
+2
-2
src/layouts/Inspector/InspectionSummaryLayout.tsx
src/layouts/Regulator/ReviewApplicationLayout.tsx
+4
-3
src/layouts/Regulator/ReviewApplicationLayout.tsx
src/layouts/reviewer/Users.tsx
+2
-1
src/layouts/reviewer/Users.tsx
src/pages/Regulator/RegulatorAllApplications.tsx
+2
-1
src/pages/Regulator/RegulatorAllApplications.tsx
src/pages/Reviewer/CreateUser.tsx
+4
-2
src/pages/Reviewer/CreateUser.tsx
src/pages/Reviewer/ReviewerApplications.tsx
+4
-2
src/pages/Reviewer/ReviewerApplications.tsx
with
74 additions
and
40 deletions
+74
-40
src/components/common/Header.tsx
+
6
−
5
View file @
d287f95d
...
...
@@ -19,6 +19,7 @@ interface LoginState {
userName
:
any
;
userInfo
:
any
;
}
const
userRole
=
Helper
.
getUserRole
();
class
Header
extends
Component
<
LoginProps
,
LoginState
>
{
constructor
(
props
:
any
)
{
super
(
props
);
...
...
@@ -140,7 +141,7 @@ class Header extends Component<LoginProps, LoginState> {
HOME
</
Link
>
</
li
>
{
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSTITUTION
&&
(
{
u
serRole
===
APP
.
ROLE
.
INSTITUTION
&&
(
<
li
className
=
"mr-3 mr-sm-2 mr-md-5 mr-lg-5"
>
<
Link
to
=
{
"
/applications
"
}
...
...
@@ -156,7 +157,7 @@ class Header extends Component<LoginProps, LoginState> {
</
Link
>
</
li
>
)
}
{
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSTITUTION
&&
(
{
u
serRole
===
APP
.
ROLE
.
INSTITUTION
&&
(
<
li
className
=
"mr-3 mr-sm-2 mr-md-5 mr-lg-5"
>
<
Link
to
=
{
"
/available-forms
"
}
...
...
@@ -172,7 +173,7 @@ class Header extends Component<LoginProps, LoginState> {
</
Link
>
</
li
>
)
}
{
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
REGULATOR
&&
(
{
(
u
serRole
===
APP
.
ROLE
.
REGULATOR
||
userRole
===
APP
.
ROLE
.
SUPER_ADMIN
)
&&
(
<>
<
li
className
=
"mr-3 mr-sm-2 mr-md-5 mr-lg-5"
>
<
Link
...
...
@@ -205,7 +206,7 @@ class Header extends Component<LoginProps, LoginState> {
</
li
>
</>
)
}
{
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSPECTOR
&&
(
{
u
serRole
===
APP
.
ROLE
.
INSPECTOR
&&
(
<
li
className
=
"mr-3 mr-sm-2 mr-md-5 mr-lg-5"
>
<
Link
to
=
{
"
/all-applications
"
}
...
...
@@ -221,7 +222,7 @@ class Header extends Component<LoginProps, LoginState> {
</
Link
>
</
li
>
)
}
{
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
REGULATOR
&&
(
{
(
u
serRole
===
APP
.
ROLE
.
REGULATOR
||
userRole
===
APP
.
ROLE
.
SUPER_ADMIN
)
&&
(
<
li
className
=
""
>
<
Link
to
=
{
"
/analytics
"
}
...
...
This diff is collapsed.
Click to expand it.
src/components/dashboard/Dashboard.js
+
7
−
6
View file @
d287f95d
...
...
@@ -12,7 +12,7 @@ import { CardTwo } from "../cards";
/**
* Dashboard component
*/
const
userRole
=
Helper
.
getUserRole
();
class
Dashboard
extends
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -43,7 +43,7 @@ class Dashboard extends Component {
}
getInstituteApplications
=
()
=>
{
if
(
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSTITUTION
)
{
if
(
u
serRole
===
APP
.
ROLE
.
INSTITUTION
)
{
FormService
.
get
().
then
(
(
response
)
=>
{
if
(
response
.
statusInfo
.
statusCode
===
APP
.
CODE
.
SUCCESS
)
{
...
...
@@ -92,10 +92,11 @@ class Dashboard extends Component {
};
render
()
{
return
(
<
Fragment
>
<
Header
history
=
{
this
.
props
.
history
}
/
>
{
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSTITUTION
&&
(
{
u
serRole
===
APP
.
ROLE
.
INSTITUTION
&&
(
<
Fragment
>
<
div
className
=
"
container-fluid main-container
"
>
<
div
className
=
"
container dashboard-inner-container pt-3 pb-3
"
>
...
...
@@ -198,7 +199,7 @@ class Dashboard extends Component {
<
/div
>
<
/Fragment
>
)}
{
/* {
Helper.getU
serRole
()
=== APP.ROLE.REGULATOR && (
{
/* {
(u
serRole === APP.ROLE.REGULATOR
|| userRole === APP.ROLE.SUPER_ADMIN)
&& (
<Fragment>
<div className="container-fluid">
<div className="container dashboard-inner-container">
...
...
@@ -294,9 +295,9 @@ class Dashboard extends Component {
)} */
}
{
/* Inspector portal */
}
{
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSPECTOR
&&
<
InspectorHome
/>
}
{
u
serRole
===
APP
.
ROLE
.
INSPECTOR
&&
<
InspectorHome
/>
}
{
/* Inspector portal */
}
{
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
REGULATOR
&&
<
ReviewerHome
/>
}
{
(
u
serRole
===
APP
.
ROLE
.
REGULATOR
||
userRole
===
APP
.
ROLE
.
SUPER_ADMIN
)
&&
<
ReviewerHome
/>
}
<
/Fragment
>
);
}
...
...
This diff is collapsed.
Click to expand it.
src/components/form/FormViewer.js
+
11
−
11
View file @
d287f95d
...
...
@@ -22,7 +22,7 @@ import { CardThree } from "../cards";
import
{
TextAreaField
}
from
"
../form-elements
"
;
// import { BtnTwo } from "../buttons";
// const $ = window.$;
const
userRole
=
Helper
.
getUserRole
();
class
FormViewer
extends
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -61,7 +61,7 @@ class FormViewer extends Component {
this
.
props
.
match
.
params
.
applicationId
!==
null
&&
this
.
props
.
match
.
params
.
applicationId
!==
undefined
)
{
if
(
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSTITUTION
)
{
if
(
u
serRole
===
APP
.
ROLE
.
INSTITUTION
)
{
this
.
setState
({
breadCrumbData
:
[
{
title
:
"
HOME
"
,
url
:
"
/dashboard
"
,
icon
:
""
},
...
...
@@ -69,7 +69,7 @@ class FormViewer extends Component {
],
});
}
if
(
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
REGULATOR
)
{
if
(
u
serRole
===
APP
.
ROLE
.
REGULATOR
||
userRole
===
APP
.
ROLE
.
SUPER_ADMIN
)
{
this
.
setState
({
breadCrumbData
:
[
{
title
:
"
HOME
"
,
url
:
"
/dashboard
"
,
icon
:
""
},
...
...
@@ -81,7 +81,7 @@ class FormViewer extends Component {
this
.
populateForm
(
this
.
props
.
match
.
params
.
applicationId
);
},
50
);
}
else
{
if
(
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSTITUTION
)
{
if
(
u
serRole
===
APP
.
ROLE
.
INSTITUTION
)
{
this
.
setState
({
breadCrumbData
:
[
{
title
:
"
HOME
"
,
url
:
"
/dashboard
"
,
icon
:
""
},
...
...
@@ -89,7 +89,7 @@ class FormViewer extends Component {
],
});
}
if
(
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
REGULATOR
)
{
if
(
u
serRole
===
APP
.
ROLE
.
REGULATOR
||
userRole
===
APP
.
ROLE
.
SUPER_ADMIN
)
{
this
.
setState
({
breadCrumbData
:
[
{
title
:
"
HOME
"
,
url
:
"
/dashboard
"
,
icon
:
""
},
...
...
@@ -327,7 +327,7 @@ class FormViewer extends Component {
this
.
props
.
match
.
params
.
applicationId
!==
undefined
)
{
// if regulator disable form
if
(
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
REGULATOR
)
{
if
(
u
serRole
===
APP
.
ROLE
.
REGULATOR
||
userRole
===
APP
.
ROLE
.
SUPER_ADMIN
)
{
setTimeout
(()
=>
{
this
.
disableFormElements
();
},
300
);
...
...
@@ -335,7 +335,7 @@ class FormViewer extends Component {
// if institute,
// if status: Draft - enable form edit & show 'save as draft'
if
(
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSTITUTION
&&
u
serRole
===
APP
.
ROLE
.
INSTITUTION
&&
(
this
.
state
.
applicationDetails
.
status
===
LANG
.
FORM_STATUS
.
DRAFT
||
this
.
state
.
applicationDetails
.
status
===
LANG
.
FORM_STATUS
.
RETURNED
)
)
{
...
...
@@ -350,7 +350,7 @@ class FormViewer extends Component {
// if institute,
// if status: not Draft - disable form edit & hide 'save as draft'
if
(
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSTITUTION
&&
u
serRole
===
APP
.
ROLE
.
INSTITUTION
&&
this
.
state
.
applicationDetails
.
status
!==
LANG
.
FORM_STATUS
.
DRAFT
&&
this
.
state
.
applicationDetails
.
status
!==
LANG
.
FORM_STATUS
.
RETURNED
)
{
...
...
@@ -392,7 +392,7 @@ class FormViewer extends Component {
(
this
.
props
.
match
.
params
.
applicationId
===
null
||
this
.
props
.
match
.
params
.
applicationId
===
undefined
||
this
.
state
.
applicationDetails
.
status
===
LANG
.
FORM_STATUS
.
RETURNED
)
&&
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSTITUTION
u
serRole
===
APP
.
ROLE
.
INSTITUTION
)
{
for
(
let
index
=
0
;
index
<=
this
.
state
.
headingIndex
;
index
++
)
{
if
(
!
flag
)
break
;
...
...
@@ -868,7 +868,7 @@ class FormViewer extends Component {
// this.props.match.params.applicationId !== null &&
// this.props.match.params.applicationId !== undefined
// ) &&
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSTITUTION
&&
u
serRole
===
APP
.
ROLE
.
INSTITUTION
&&
this
.
state
.
showSaveAsDraft
&&
(
<
button
className
=
"
btn btn-outline smf-btn-default mb-3
"
...
...
@@ -888,7 +888,7 @@ class FormViewer extends Component {
// this.props.match.params.applicationId !== null &&
// this.props.match.params.applicationId !== undefined
// ) &&
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
INSTITUTION
&&
u
serRole
===
APP
.
ROLE
.
INSTITUTION
&&
this
.
state
.
showSaveAsDraft
&&
this
.
state
.
headingIndex
===
this
.
state
.
formHeadings
.
length
-
1
&&
(
...
...
This diff is collapsed.
Click to expand it.
src/components/modal/InspectionScheduleModal.tsx
+
2
−
2
View file @
d287f95d
...
...
@@ -400,7 +400,7 @@ export const InspectionScheduleModal = ({
<
div
className
=
"col-sm-12 col-md-12 col-lg-6"
>
<
div
className
=
{
`
${
stylesTwo
.
text_area_one
}
p-3`
}
>
<
div
className
=
"mb-3"
>
<
HeadingFive
heading
=
"Add lead
inspect
or"
count
=
{
1
}
/>
<
HeadingFive
heading
=
"Add lead
assess
or"
count
=
{
1
}
/>
</
div
>
<
div
className
=
"row"
>
<
div
className
=
"col-9"
>
...
...
@@ -480,7 +480,7 @@ export const InspectionScheduleModal = ({
<
div
className
=
{
`
${
stylesTwo
.
text_area_one
}
p-3 mt-3`
}
>
<
div
className
=
"mb-3"
>
<
HeadingFive
heading
=
"Add assisting
inspect
or
s
"
count
=
{
2
}
/>
<
HeadingFive
heading
=
"Add assisting
assess
or"
count
=
{
2
}
/>
</
div
>
<
div
className
=
"row"
>
<
div
className
=
"col-sm-12 col-md-9 col-lg-9"
>
...
...
This diff is collapsed.
Click to expand it.
src/components/status-bar/StatusBarLarge.tsx
+
2
−
2
View file @
d287f95d
...
...
@@ -182,7 +182,7 @@ export const StatusBarLarge = ({
</
div
>
<
div
className
=
"pt-2"
>
<
label
className
=
{
`
${
styles
.
status_bar_custom_heading
}
`
}
>
Lead
inspect
or
Lead
assess
or
</
label
>
<
div
className
=
"pt-3"
>
{
inspectionData
&&
...
...
@@ -214,7 +214,7 @@ export const StatusBarLarge = ({
</
div
>
<
div
className
=
"pt-2"
>
<
label
className
=
{
`
${
styles
.
status_bar_custom_heading
}
`
}
>
Assisting
inspect
or
Assisting
assess
or
</
label
>
<
div
className
=
"pt-3"
>
{
inspectionData
&&
...
...
This diff is collapsed.
Click to expand it.
src/constants/AppConstants.ts
+
7
−
0
View file @
d287f95d
...
...
@@ -12,6 +12,13 @@ export const APP = {
INSTITUTION
:
"
Institution
"
,
REGULATOR
:
"
Regulator
"
,
// reviewer
INSPECTOR
:
"
Inspector
"
,
SUPER_ADMIN
:
"
Super Admin
"
,
},
ROLE_LABEL
:
{
//Update ROLE object with correct label once Inspector and assistant inspector is changes to Medical and Non-Medical assessor and assistant inspector role is removed
INSTITUTION
:
"
Institute
"
,
REGULATOR
:
"
Admin
"
,
// reviewer
INSPECTOR
:
"
Assessor
"
,
SUPER_ADMIN
:
"
Super Admin
"
,
},
ROUTES
:
{
DASHBOARD
:
"
/dashboard
"
,
...
...
This diff is collapsed.
Click to expand it.
src/helpers/util.ts
0 → 100644
+
17
−
0
View file @
d287f95d
import
{
APP
}
from
"
../constants
"
;
const
getRoleLabel
=
(
roleName
:
string
)
=>
{
switch
(
roleName
.
toLowerCase
())
{
case
APP
.
ROLE
.
REGULATOR
.
toLowerCase
():
return
APP
.
ROLE_LABEL
.
REGULATOR
;
case
APP
.
ROLE
.
INSTITUTION
.
toLowerCase
():
return
APP
.
ROLE_LABEL
.
INSTITUTION
;
case
APP
.
ROLE
.
INSPECTOR
.
toLowerCase
():
return
APP
.
ROLE_LABEL
.
INSPECTOR
;
case
APP
.
ROLE
.
SUPER_ADMIN
.
toLowerCase
():
return
APP
.
ROLE_LABEL
.
SUPER_ADMIN
;
}
}
export
default
{
getRoleLabel
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/layouts/Inspector/ConsentFormView.tsx
+
4
−
3
View file @
d287f95d
...
...
@@ -60,6 +60,7 @@ export const ConsentFormView = ({
useRecoilState
(
sideMenuLabelAtom
);
const
reviewerNote
=
useRecoilState
(
modalTwoTextAreaAtom
);
const
userRole
=
Helper
.
getUserRole
();
let
history
=
useHistory
();
...
...
@@ -596,7 +597,7 @@ export const ConsentFormView = ({
applicationId
=
{
applicationData
.
applicationId
}
/>
{
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
REGULATOR
&&
(
{
(
u
serRole
===
APP
.
ROLE
.
REGULATOR
||
userRole
===
APP
.
ROLE
.
SUPER_ADMIN
)
&&
(
<
InspectionScheduleModal
id
=
"sendToInspectionEdit"
showTextAreaLabel
=
{
false
}
...
...
@@ -707,7 +708,7 @@ export const ConsentFormView = ({
<
label
className
=
{
`
${
styles
.
status_bar_custom_heading
}
`
}
>
Lead
inspect
or
Lead
assess
or
</
label
>
<
div
className
=
"pt-3"
>
{
applicationData
&&
...
...
@@ -747,7 +748,7 @@ export const ConsentFormView = ({
<
label
className
=
{
`
${
styles
.
status_bar_custom_heading
}
`
}
>
Assisting
inspect
or
Assisting
assess
or
</
label
>
<
div
className
=
"pt-3"
>
{
applicationData
&&
...
...
This diff is collapsed.
Click to expand it.
src/layouts/Inspector/InspectionSummaryLayout.tsx
+
2
−
2
View file @
d287f95d
...
...
@@ -163,7 +163,7 @@ export const InspectionSummaryLayout = ({
{
/* Inspectors list */
}
<
div
className
=
"pt-2"
>
<
label
className
=
{
`
${
stylesThree
.
status_bar_custom_heading
}
`
}
>
Lead
inspect
or
Lead
assess
or
</
label
>
<
div
className
=
"pt-3"
>
{
data
&&
...
...
@@ -199,7 +199,7 @@ export const InspectionSummaryLayout = ({
</
div
>
<
div
className
=
"pt-2"
>
<
label
className
=
{
`
${
stylesThree
.
status_bar_custom_heading
}
`
}
>
Assisting
inspect
or
Assisting
assess
or
</
label
>
<
div
className
=
"pt-3"
>
{
data
&&
...
...
This diff is collapsed.
Click to expand it.
src/layouts/Regulator/ReviewApplicationLayout.tsx
+
4
−
3
View file @
d287f95d
...
...
@@ -54,6 +54,7 @@ export const ReviewApplicationLayout = ({
useRecoilState
(
sideMenuLabelAtom
);
const
reviewerNote
=
useRecoilState
(
modalTwoTextAreaAtom
);
const
userRole
=
Helper
.
getUserRole
();
let
history
=
useHistory
();
...
...
@@ -536,7 +537,7 @@ export const ReviewApplicationLayout = ({
applicationId
=
{
applicationData
.
applicationId
}
/>
{
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
REGULATOR
&&
(
{
(
u
serRole
===
APP
.
ROLE
.
REGULATOR
||
userRole
===
APP
.
ROLE
.
SUPER_ADMIN
)
&&
(
<
InspectionScheduleModal
id
=
"sendToInspectionEdit"
showTextAreaLabel
=
{
false
}
...
...
@@ -634,7 +635,7 @@ export const ReviewApplicationLayout = ({
<
label
className
=
{
`
${
styles
.
status_bar_custom_heading
}
`
}
>
Lead
inspect
or
Lead
assess
or
</
label
>
<
div
className
=
"pt-3"
>
{
applicationData
&&
...
...
@@ -674,7 +675,7 @@ export const ReviewApplicationLayout = ({
<
label
className
=
{
`
${
styles
.
status_bar_custom_heading
}
`
}
>
Assisting
inspect
or
Assisting
assess
or
</
label
>
<
div
className
=
"pt-3"
>
{
applicationData
&&
...
...
This diff is collapsed.
Click to expand it.
src/layouts/reviewer/Users.tsx
+
2
−
1
View file @
d287f95d
...
...
@@ -6,6 +6,7 @@ import { Link } from "react-router-dom";
import
{
BtnTwo
}
from
"
../../components/buttons
"
;
import
{
APP
}
from
"
../../constants
"
;
import
Notify
from
"
../../helpers/notify
"
;
import
Util
from
"
../../helpers/util
"
;
import
{
UserService
}
from
"
../../services/user.service
"
;
interface
userProps
{
...
...
@@ -155,7 +156,7 @@ export const Users = ({ data }: userProps) => {
{
user
.
roles
.
map
((
role
,
i
)
=>
{
return
(
<
span
key
=
{
i
}
>
<
span
>
{
role
.
name
}
</
span
>
<
span
>
{
Util
.
getRoleLabel
(
role
.
name
)
}
</
span
>
{
i
!==
user
.
roles
.
length
-
1
&&
<
span
>
,
</
span
>
}
</
span
>
);
...
...
This diff is collapsed.
Click to expand it.
src/pages/Regulator/RegulatorAllApplications.tsx
+
2
−
1
View file @
d287f95d
...
...
@@ -29,6 +29,7 @@ export const RegulatorAllApplications = ({
const
[
currentData
,
setCurrentData
]
=
useRecoilState
(
selectedTabDataAtom
);
const
[
tabData
,
setTabData
]
=
useState
<
any
[]
>
([]);
const
[
selectedTab
,
setSelectedTab
]
=
useRecoilState
(
selectedTabAtom
);
const
userRole
=
Helper
.
getUserRole
();
let
history
=
useHistory
();
...
...
@@ -96,7 +97,7 @@ export const RegulatorAllApplications = ({
},
[
currentData
]);
const
getSelectedTabData
=
()
=>
{
if
(
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
REGULATOR
)
{
if
(
u
serRole
===
APP
.
ROLE
.
REGULATOR
||
userRole
===
APP
.
ROLE
.
SUPER_ADMIN
)
{
let
data
=
{
searchObjects
:
[],
};
...
...
This diff is collapsed.
Click to expand it.
src/pages/Reviewer/CreateUser.tsx
+
4
−
2
View file @
d287f95d
...
...
@@ -7,6 +7,7 @@ import Header from "../../components/common/Header"
import
{
HeadingOne
}
from
"
../../components/headings
"
import
{
APP
}
from
"
../../constants
"
;
import
Notify
from
"
../../helpers/notify
"
;
import
Util
from
"
../../helpers/util
"
;
import
{
UserService
}
from
"
../../services/user.service
"
;
interface
userProps
{
...
...
@@ -117,8 +118,9 @@ export const CreateUser = ({ data }: userProps) => {
(
response2
)
=>
{
if
(
response2
.
statusInfo
&&
response2
.
statusInfo
.
statusCode
===
APP
.
CODE
.
SUCCESS
)
{
if
(
isEdit
)
{
let
rolesUpdated
:
any
=
[]
let
rolesUpdated
:
any
=
[]
;
userEdit
&&
userEdit
.
roles
.
map
((
role
:
any
,
index
:
number
)
=>
{
rolesUpdated
=
response2
.
responseData
.
map
((
r
:
IRole
,
i
:
number
)
=>
{
if
(
r
.
id
===
role
.
id
)
{
return
{
...
r
,
isChecked
:
true
}
...
...
@@ -293,7 +295,7 @@ export const CreateUser = ({ data }: userProps) => {
}
checked
=
{
role
.
isChecked
?
true
:
false
}
onChange
=
{
e
=>
onAddingRole
(
e
,
key
)
}
/>
{
"
"
+
role
.
name
}
{
"
"
+
Util
.
getRoleLabel
(
role
.
name
)
}
</
label
>
</
div
>
))
}
...
...
This diff is collapsed.
Click to expand it.
src/pages/Reviewer/ReviewerApplications.tsx
+
4
−
2
View file @
d287f95d
...
...
@@ -45,6 +45,8 @@ const FORM_STATUS = [
"
Approved
"
];
const
userRole
=
Helper
.
getUserRole
();
class
ReviewerApplications
extends
Component
<
ReviewerApplicationsProps
,
ReviewerApplicationsState
>
{
constructor
(
props
:
any
)
{
super
(
props
);
...
...
@@ -58,7 +60,7 @@ class ReviewerApplications extends Component<ReviewerApplicationsProps, Reviewer
}
componentDidMount
()
{
if
(
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
REGULATOR
)
{
if
(
u
serRole
===
APP
.
ROLE
.
REGULATOR
||
userRole
===
APP
.
ROLE
.
SUPER_ADMIN
)
{
let
data
=
{
"
searchObjects
"
:
[
]
...
...
@@ -123,7 +125,7 @@ class ReviewerApplications extends Component<ReviewerApplicationsProps, Reviewer
<
Fragment
>
<
Header
history
=
{
this
.
props
.
history
}
/>
{
Helper
.
getU
serRole
()
===
APP
.
ROLE
.
REGULATOR
&&
(
{
(
u
serRole
===
APP
.
ROLE
.
REGULATOR
||
userRole
===
APP
.
ROLE
.
SUPER_ADMIN
)
&&
(
<
Fragment
>
<
div
className
=
"container-fluid"
>
<
div
className
=
"container dashboard-inner-container"
>
...
...
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