-
Notifications
You must be signed in to change notification settings - Fork 71
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
Bulk organization user creation/addition feature #3651
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3651 +/- ##
===========================================
+ Coverage 69.08% 69.33% +0.25%
===========================================
Files 54 54
Lines 7397 7500 +103
===========================================
+ Hits 5110 5200 +90
- Misses 2287 2300 +13 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Reviewing this with @bensteinberg (running locally), we noticed a few minor details with the CSV handling form.
|
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.
As discussed, @christiansmith and I just looked at this together. I see this is added to the test for permissions, but otherwise has no tests.
Also, we were just discussing this with @rebeccacremona, who pointed out that we might prefer to assemble all the work and run it in a single database query, rather than going line-by-line. It might also make sense to fail if there are any validation errors, rather than create some users and not others.
@christiansmith @bensteinberg Pushed a couple of commits for the desired behavior and also added a test. I am checking with Clare about below to see what her preference would be. My initial approach was that it is good to process the good data and ignore the rest, as in something is better than nothing if it makes sense. Will check with Becky on the point of running a single db query.
|
@christiansmith @bensteinberg I made some changes to the PR since you last looked, I'd appreciate it if you could look again. Clare preferred to process the valid users and notify the requestor for those that were invalid, and I updated the PR description and UI messaging to reflect that. |
This feature adds a new button to the organization user management view (/manage/organization-users):
Upon clicking, the bulk upload form comes up:
User makes the organization, affiliation expiration, and CSV file selections. Form cannot be submitted without an organization selection or with a non .csv file extension. It is also invalid if it doesn't include all of the headers rows and data in the email field.
The affiliation field can be toggled just like in the single user flow.
Once submitted, users that don't exist will be created; those that do will have their organization affiliation updated. New users will receive new user email with account activation email. Existing users will receive the user added to organization email.
A generic success message will be displayed at the end if there are no validation errors:
If some of the users get processed, but some can't due to those being an admin or registrar, below will be displayed:
If all users in the CSV are admins or registrars, the below error message will be displayed:
This PR also fixes a bug where the existing user email wasn't displaying the organization name.
Disclaimer: Any behavior and the wording here are open to feedback. This was my initial take on it :)
EDIT:
As of Nov 20th, I put this feature behind a feature flag so we can do some more testing on it in stage before a possible production deployment.