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

Create new user account page refactor #1285

Merged
merged 57 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
fa36308
starting modal that displays create new user form
ksierks May 19, 2022
4d942a3
refresh users table after creating a new user
ksierks May 19, 2022
12ca181
using mailConfigured form settingsApi
ksierks May 19, 2022
890fdcf
using scrollable modal
ksierks May 19, 2022
fa97333
displaying set password when activation email not set
ksierks May 24, 2022
f66a320
making modal taller
ksierks May 24, 2022
b6a009d
removing confirm password
ksierks May 24, 2022
9038dd2
adding min length client side validation
ksierks May 24, 2022
cac92d4
adding form default values
ksierks May 24, 2022
5040590
making phone number optional
ksierks May 24, 2022
8324a48
making locale and role required for both create and edit pages
ksierks May 25, 2022
15cc683
starting to remove unused logic
ksierks May 25, 2022
43fb863
using modal button to submit form
ksierks May 25, 2022
513a752
focusing on username on open modal
ksierks May 25, 2022
d669142
auto check email user activation if email configured
ksierks May 25, 2022
c2e0e74
adding loading to submit button
ksierks May 25, 2022
60881d5
fixing AdminUsersPage.jsx comments
ksierks May 25, 2022
73fe1ad
returning AjaxFormError in ajax controller
ksierks May 25, 2022
fdc379e
Merge branch 'development' into create-new-user-account-page-refactor
ksierks May 25, 2022
63fbb60
fixing merge mistake
ksierks May 25, 2022
cd58340
removing more unused code
ksierks May 26, 2022
b9228d6
handling mail failure
ksierks May 27, 2022
4e9830a
handling mail failure
ksierks May 27, 2022
4de4fbf
updating javadocs
ksierks May 30, 2022
42c1ab0
fixing uiservice testing
ksierks May 30, 2022
a557bcf
fixing mail failure
ksierks May 30, 2022
2b0969d
ensuring methods in UIUsersService all return an ajax response
ksierks May 30, 2022
55f0ddf
moving changeset to new release
ksierks May 30, 2022
d4b09ed
Merge branch 'development' into create-new-user-account-page-refactor
ksierks May 30, 2022
4b3558d
starting to update documentation
ksierks May 30, 2022
b1e2d99
moving user list table for managers
ksierks May 31, 2022
e6d27de
removing unused files
ksierks May 31, 2022
6ffd9db
moving UsersTable.jsx
ksierks May 31, 2022
8e80204
updating documentation
ksierks May 31, 2022
447c103
making reset password button primary button
ksierks May 31, 2022
9a91e49
ensuring managers can only create users with role user
ksierks May 31, 2022
f5498cc
removing permission for manager to update accounts
ksierks May 31, 2022
c5576fa
adding ajax controller testing
ksierks May 31, 2022
d2fe3ec
removing role from form for manager instead
ksierks May 31, 2022
904496b
adding ui service tests
ksierks May 31, 2022
61ce958
creating CreateNewUserComponent.java
ksierks Jun 1, 2022
930aa08
updating changelog
ksierks Jun 1, 2022
dee384e
Merge branch 'development' into create-new-user-account-page-refactor
ksierks Jun 1, 2022
7574ba4
updating changelog
ksierks Jun 1, 2022
c40a2b8
renaming change set folder 22.09 to unreleased
ksierks Jun 1, 2022
9109cf9
fixing assertions
ksierks Jun 1, 2022
51a57e9
consolidating password validation
ksierks Jun 2, 2022
c5cab1f
fixing test
ksierks Jun 2, 2022
22e24d0
starting to remove manager access from user details page
ksierks Jun 2, 2022
7ec2339
fix test
ksierks Jun 2, 2022
06c958c
creating PasswordPolicyAlert component
ksierks Jun 2, 2022
3fa8b73
fixing validation when submitting empty field
ksierks Jun 2, 2022
6313ff4
hiding mailfailure after user creation
ksierks Jun 2, 2022
d0c2b36
fixing tests again
ksierks Jun 3, 2022
07095c6
using modal buttons
ksierks Jun 3, 2022
3067d5f
clearing form fields on cancel
ksierks Jun 3, 2022
76b939a
consolidating user validation rules
ksierks Jun 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/_includes/tutorials/common/creating-a-user-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ When you click "Create User", an e-mail will be sent to the user (to the e-mail

![User welcome e-mail.]({{ site.baseurl }}/images/tutorials/common/users/user-welcome-email.png)

On successfully creating a new user account, you will see the user details that you entered:
On successfully creating a new user account, you will be redirected back to the admin users table and see a successful notification pop-up:

![User details page.]({{ site.baseurl }}/images/tutorials/common/users/user-details-page.png)
![User details page.]({{ site.baseurl }}/images/tutorials/common/users/create-user-success.png)

**Note**: Only announcements created within the last month will be shown to new users.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/tutorials/common/users/manual-user-password.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/tutorials/common/users/user-details-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public class User extends IridaRepresentationModel implements MutableIridaThing,
// longer than 1024 (who's going to remember a password that long anyway?)
// to prevent DOS attacks on our password hashing.
@Size(min = 8, max = 1024, message = "{user.password.size}")
@Pattern.List({ @Pattern(regexp = "^.*[A-Z].*$", message = "{user.password.uppercase}"),
@Pattern.List({
@Pattern(regexp = "^.*[A-Z].*$", message = "{user.password.uppercase}"),
@Pattern(regexp = "^.*[0-9].*$", message = "{user.password.number}"),
@Pattern(regexp = "^.*[a-z].*$", message = "{user.password.lowercase}"),
@Pattern(regexp = "^.*[!@#$%^&*()+?/<>=.\\\\{}].*$", message = "{user.password.special}") })
Expand All @@ -74,7 +75,6 @@ public class User extends IridaRepresentationModel implements MutableIridaThing,
@Size(min = 2, message = "{user.lastName.size}")
private String lastName;

@NotNull(message = "{user.phoneNumber.notnull}")
@Size(min = 4, message = "{user.phoneNumber.size}")
private String phoneNumber;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ca.corefacility.bioinformatics.irida.ria.web.exceptions;

import java.util.Map;

/**
* Exception to be thrown by the UI when a user cannot be created or updated.
*/
public class UIUserFormException extends Exception {
private final Map<String, String> errors;

public UIUserFormException(Map<String, String> errors) {
super("User Form Exception");
this.errors = errors;
}

public Map<String, String> getErrors() {
return this.errors;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package ca.corefacility.bioinformatics.irida.ria.web.exceptions;

/**
* Exception to throw if there is an error updating the user status
*/
public class UIUserStatusException extends Exception {
public UIUserStatusException(String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import ca.corefacility.bioinformatics.irida.config.services.IridaApiServicesConfig;
import ca.corefacility.bioinformatics.irida.model.user.Role;
import ca.corefacility.bioinformatics.irida.service.EmailController;

import com.google.common.collect.ImmutableList;

Expand All @@ -17,14 +18,17 @@
*/
@Component
public class UISettingsService {
private final MessageSource messageSource;
private final List<Locale> locales;
private final EmailController emailController;
private final MessageSource messageSource;
private final List<Role> SYSTEM_ROLES = ImmutableList.of(Role.ROLE_ADMIN, Role.ROLE_MANAGER, Role.ROLE_USER,
Role.ROLE_TECHNICIAN, Role.ROLE_SEQUENCER);

public UISettingsService(IridaApiServicesConfig.IridaLocaleList locales, MessageSource messageSource) {
this.messageSource = messageSource;
public UISettingsService(IridaApiServicesConfig.IridaLocaleList locales, EmailController emailController,
MessageSource messageSource) {
this.locales = locales.getLocales();
this.emailController = emailController;
this.messageSource = messageSource;
}

/**
Expand All @@ -51,4 +55,13 @@ public List<ca.corefacility.bioinformatics.irida.ria.web.settings.dto.Role> getS
messageSource.getMessage("systemRole." + role.getName(), new Object[] {}, locale)))
.collect(Collectors.toList());
}

/**
* Get if email is configured.
*
* @return if email is configured.
*/
public Boolean getEmailConfigured() {
return emailController.isMailConfigured();
}
}
Loading