-
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
Conversation
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.
Approach makes sense to me. The only thing I'm wondering is if there are liability reasons for needing the lca text available on the page
@connorlbark - let's bring this up with Jonathan/Pamela. From my poor memory, we do want to be able to add a library card for an unregistered user - that was an original design goal. There was some logic somewhere that would look for unregistered user LCs and link them up if a new user signed in with the email associated to the LC. |
Talked to Pamela - so you're right that the ability to type in a freetext email is desirable, but the ability to see users without insitutions is not. I will add back the |
Add New Researcher
modal
@@ -198,6 +198,10 @@ const generateLcaText = (text) => { | |||
</ReactMarkdown>; | |||
}; | |||
|
|||
const onlyResearchersWithoutCardFilter = (researcher) => { | |||
return isNil(researcher.libraryCards); |
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.
I can imagine an edge case where a researcher belongs to this institution, doesn't have a library card from this institution, but does have another library card (since admins can technically give researchers library cards from any institution). In that case, they'll appear in the table but not the dropdown in the modal. Not sure how big of an issue this is though
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.
Great catch @shaemarks ... and you're right. There will be cases where a user will have library cards from other institutions.
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.
changed the filter here and also the filter in the table itself to check that the SO's institution id the same as the card's institution id
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.
Looking good, see comments inline.
@@ -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() |
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.
- SigningOfficialConsole
- SigningOfficialDataSubmitters
- SigningOfficialResearchers
User.getUnassignedUsers() | ||
]); | ||
const researcherList = soPromises[0]; | ||
const unregisteredResearchers = soPromises[1]; |
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.
Just a note that the naming here was incorrect, these were not unregistered users, they were registered users with no institution selection.
Naming is hard. The API call was actually returning unregistered users with a LC for the calling user's institution, so User.getUnassignedUsers()
is what is mis-named here.
@rushtong I messaged Pamela about this. Here is what she said about the popup: I am confused though on the |
I may have been confused about the goal of the ticket/PR - I was under the impression that the intention was to STOP creating Library Cards for users who are not already registered with the signing official's institution. I would be happy to be wrong here, but it does add some complications to the new designs of Signing Official pages. If so, ignore my feedback about the modal and free text usage.
|
Sounds good to me! We can also open a dialogue with Pamela/Jonathan if you think the behavior should be different. |
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 good to me! Styling on modal looks much better!
Co-authored-by: shaemarks <81024249+shaemarks@users.noreply.github.com>
Addresses
https://broadworkbench.atlassian.net/browse/DUOS-1967
Have you read Terra's Contributing Guide lately? If not, do that first.