Skip to content
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

Allow user to populate Study PI Name and ORCID iD with user's own info #130

Conversation

eecavanna
Copy link
Collaborator

@eecavanna eecavanna commented Jul 15, 2024

In this branch, I added buttons on the right sides of two text inputs on the "Create Study" screen:

  • Principal Investigator > Name
  • Principal Investigator > ORCID iD

The buttons are only rendered when the user is logged in (so, if we end up allowing logged-out users to snoop around the UI, these buttons will not appear to them).

When the user clicks a button, the app will update the field so it contains the associated value from the user's own ORCID account. For example, if the user clicks the button on the "Name" field, the app will update the "Name" field so it contains the user's name.

When the field already contains the value that clicking the button would cause the field to have, the button is disabled.

Here's a brief screencast of the buttons in action (with personal information blurred here):

nmdc-field-notes-autofill-name-orcid.mp4

Here are some things I think reviewers may request changes about:

  1. Which icon I used (currently a wand icon)
  2. Which color I used (currently the primary color from the theme)
  3. The tooltip text that appears when the user hovers over the buttons (currently "Use my name" and "Use my ORCID iD")

@eecavanna eecavanna self-assigned this Jul 15, 2024
Copy link
Collaborator

@pkalita-lbl pkalita-lbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the functionality and the UI. Just a couple suggestions about the implementation.

@eecavanna
Copy link
Collaborator Author

I'm going to commit the suggested changes, but I want to test it locally before it gets merged in. I'll report back after I've tested it locally.

eecavanna and others added 2 commits July 15, 2024 11:39
Co-authored-by: Patrick Kalita <pkalita@lbl.gov>
Co-authored-by: Patrick Kalita <pkalita@lbl.gov>
@eecavanna
Copy link
Collaborator Author

I confirmed it worked locally with the suggested changes in place.

I'm wondering whether the current behavior will be too "surprising" to some users and whether they'd prefer that the button display a modal that explains what the autofill would do, and the user can then confirm or cancel.

I'll go ahead and merge this in as is, given the review feedback. We can go back and add the modal later if necessary.

@eecavanna eecavanna merged commit d6f0452 into main Jul 15, 2024
1 check passed
@eecavanna eecavanna deleted the 108-add-ability-to-fill-in-study-pi-name-and-orcid-from-logged-in-user-details branch July 15, 2024 18:43
@pkalita-lbl
Copy link
Collaborator

I'm wondering whether the current behavior will be too "surprising" to some users and whether they'd prefer that the button display a modal that explains what the autofill would do, and the user can then confirm or cancel.

I think that, even if you didn't know ahead of time what the button is going to do, the result is quite understandable. And if you don't like it, the recourse to undo it is so clear (just edit the field manually) that we don't need to go out of our way to warn people about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to fill in Study PI name and ORCID from logged-in user details
3 participants