Skip to content

Commit

Permalink
fix(User Registration): Form now properly shows up in Safari browser (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreykwan authored Jan 12, 2023
1 parent 92ecda3 commit bc2da78
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,8 @@ export class RegisterStudentFormComponent extends RegisterUserFormComponent impl
{ validator: this.passwordMatchValidator }
);
createStudentAccountFormGroup: FormGroup = this.fb.group({
firstName: new FormControl('', [
Validators.required,
Validators.pattern('^(?![ -])[a-zA-Z -]+(?<![ -])$')
]),
lastName: new FormControl('', [
Validators.required,
Validators.pattern('^(?![ -])[a-zA-Z -]+(?<![ -])$')
]),
firstName: new FormControl('', [Validators.required, Validators.pattern(this.NAME_REGEX)]),
lastName: new FormControl('', [Validators.required, Validators.pattern(this.NAME_REGEX)]),
gender: new FormControl('', [Validators.required]),
birthMonth: new FormControl('', [Validators.required]),
birthDay: new FormControl({ value: '', disabled: true }, [Validators.required])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,8 @@ export class RegisterTeacherFormComponent extends RegisterUserFormComponent impl
);
createTeacherAccountFormGroup: FormGroup = this.fb.group(
{
firstName: new FormControl('', [
Validators.required,
Validators.pattern('^(?![ -])[a-zA-Z -]+(?<![ -])$')
]),
lastName: new FormControl('', [
Validators.required,
Validators.pattern('^(?![ -])[a-zA-Z -]+(?<![ -])$')
]),
firstName: new FormControl('', [Validators.required, Validators.pattern(this.NAME_REGEX)]),
lastName: new FormControl('', [Validators.required, Validators.pattern(this.NAME_REGEX)]),
email: new FormControl('', [Validators.required, Validators.email]),
city: new FormControl('', [Validators.required]),
state: new FormControl('', [Validators.required]),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export class RegisterUserFormComponent {
NAME_REGEX = '^[a-zA-Z]+([ -]?[a-zA-Z]+)*$';

translateCreateAccountErrorMessageCode(messageCode: string) {
switch (messageCode) {
case 'invalidFirstAndLastName':
Expand Down

0 comments on commit bc2da78

Please sign in to comment.