-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DUOS-1967][risk=no] Only show registered users in Add New Researcher
modal
#1737
Changes from all commits
b33f57f
daee670
0abd0b2
92d5a8a
218b63f
6388aa1
6380d67
3b5069c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ import { USER_ROLES } from '../libs/utils'; | |
export default function SigningOfficialResearchers() { | ||
const [signingOfficial, setSiginingOfficial] = useState({}); | ||
const [researchers, setResearchers] = useState([]); | ||
const [unregisteredResearchers, setUnregisteredResearchers] = useState(); | ||
|
||
//states to be added and used for manage researcher component | ||
const [isLoading, setIsLoading] = useState(true); | ||
|
@@ -20,13 +19,7 @@ export default function SigningOfficialResearchers() { | |
try { | ||
setIsLoading(true); | ||
const soUser = await User.getMe(); | ||
const soPromises = await Promise.all([ | ||
User.list(USER_ROLES.signingOfficial), | ||
User.getUnassignedUsers() | ||
]); | ||
const researcherList = soPromises[0]; | ||
const unregisteredResearchers = soPromises[1]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Naming is hard. The API call was actually returning unregistered users with a LC for the calling user's institution, so |
||
setUnregisteredResearchers(unregisteredResearchers); | ||
const researcherList = await User.list(USER_ROLES.signingOfficial); | ||
setResearchers(researcherList); | ||
setSiginingOfficial(soUser); | ||
setIsLoading(false); | ||
|
@@ -41,7 +34,7 @@ export default function SigningOfficialResearchers() { | |
return ( | ||
div({style: Styles.PAGE}, [ | ||
div({style: {}, className: 'signing-official-tabs'}, [ | ||
h(SigningOfficialTable, {researchers, signingOfficial, unregisteredResearchers, isLoading}, []) | ||
h(SigningOfficialTable, {researchers, signingOfficial, isLoading}, []) | ||
]) | ||
]) | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the only usage of
User.getUnassignedUsers()
so we can remove it, along with deprecating the API method in consent:GET /api/user/institution/unassigned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's also used in
SigningOfficialDataSubmitters.js
; is that deprecated code? (also signing official console, but that is being deprecated)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I was incorrect ... it is used in three places in develop right now, not sure how I missed them.