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

[Feature] Admin view and edit work email #11813

Merged
merged 6 commits into from
Oct 23, 2024

Conversation

JamesHuf
Copy link
Contributor

🤖 Resolves #11740.

👋 Introduction

Adds the work email and government employee (after some discussion with @Jerryescandon) fields to the users table and admin edit user pages.

🧪 Testing

  1. Navigate to the users table /admin/users
  2. Confirm the work email and government employee fields are hidden by default
  3. Toggle the fields on and confirm they appear as expected
  4. Select to edit a user
  5. Confirm the fields appear as expected (the work email field should only appear if the user is a government employee)
  6. Confirm updating the fields works as expected

📸 Screenshot

image
image

@petertgiles petertgiles self-requested a review October 22, 2024 12:48
@petertgiles
Copy link
Contributor

Wow, this works really well.

I'm worried about adding "is gov employee" to this page though. There are some side-effects to this setup:

  • if somehow the work email is set without the gov flag it will be invisible to the admin
  • if somehow the work email is set without the gov flag it will be silently nulled out if the form is submitted

Given that this form is design to be used by an admin during troubleshooting, not the end user, I'd prefer a simple form without the extra validation.

@tristan-orourke @Jerryescandon ?

@tristan-orourke
Copy link
Member

I see what you're saying @petertgiles, Admins will have a more powerful, flexible tool if we allow for a disconnect between these two fields.

The other things I want to suggest is removing required from the work email field, even for gov employees. Admins might need to remove it for some reason, or they might be working on old users from before we added the work email field at all.

@JamesHuf
Copy link
Contributor Author

JamesHuf commented Oct 22, 2024

🤦 I'm not sure how I didn't consider that. Thoughts on these changes? The only requirement for updating work email as an admin now is email domain.

Copy link
Contributor

@petertgiles petertgiles left a comment

Choose a reason for hiding this comment

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

Nice, this looks great!

@JamesHuf JamesHuf added this pull request to the merge queue Oct 23, 2024
Merged via the queue into main with commit 8b05060 Oct 23, 2024
12 checks passed
@JamesHuf JamesHuf deleted the 11740-admin-view-and-edit-work-email branch October 23, 2024 15:16
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.

✨ Allow admins to search and update work email
3 participants