Skip to content

Commit

Permalink
add lowercase rule for username in researcher's participan account cr…
Browse files Browse the repository at this point in the history
…eation dialog.
  • Loading branch information
yghokim committed Aug 23, 2020
1 parent 064c57b commit 40f611f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<div class="error-message" *ngIf="username.errors.required">
This field is required.
</div>
<div class="error-message" *ngIf="username.errors.pattern">
Username must contain only lower case letters and numbers.
</div>
<div class="error-message" *ngIf="username.errors.minlength || username.errors.maxlength">
Username must be between 3 and 50 letters.
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class CreateUserAccountDialogComponent implements OnInit, OnDestroy {

password = new FormControl("", [Validators.required, Validators.minLength(4)])

username = new FormControl("", [Validators.required, Validators.minLength(3), Validators.maxLength(50), noDuplicateValidator(this.data.participants.map(p => p.username))])
username = new FormControl("", [Validators.required, Validators.minLength(3), Validators.pattern('^[a-z0-9]+$'), Validators.maxLength(50), noDuplicateValidator(this.data.participants.map(p => p.username))])

email = new FormControl("[email protected]", [Validators.required, Validators.email])

Expand Down

0 comments on commit 40f611f

Please sign in to comment.