Skip to content

Commit

Permalink
batch-fixes-4-dec
Browse files Browse the repository at this point in the history
  • Loading branch information
leomendoza123 committed Dec 5, 2023
1 parent 08c3b93 commit 0fba58d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ng-container *ngIf="recognizedError[errorCode] === 0">
<ng-container *ngIf="recognizedError[errorCode] === 0 && !disableInlineAlreadyExistError">
<ng-container i18n="@@register.emailAlreadyExists"
>This email already exists in our system. Would you like to</ng-container
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ enum RegisterBackendErrors {
export class BackendErrorComponent implements OnInit {
recognizedError = RegisterBackendErrors
_errorCode: string
@Input() disableInlineAlreadyExistError = false

@Input()
set errorCode(errorCode: string) {
// This will change the string send by the backend into a code, to handle the error trough a code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h2 i18n="@@register.yourEmailAddresses" class="orc-font-body margin-top-12">
class="orc-font-small-print"
id="email-input-input-label"
[ngClass]="{
error: emailFormTouched && form.hasError('required', 'emails.email')
error: emailFormTouched && emails.controls.email.errors
}"
id="email-input-label"
i18n="@@register.primaryEmail"
Expand Down Expand Up @@ -124,8 +124,10 @@ <h2 i18n="@@register.yourEmailAddresses" class="orc-font-body margin-top-12">
</mat-error>
<mat-error
*ngIf="
emailFormTouched &&
(
this.emails.hasError('email', 'email') ||
this.emails.hasError('pattern', 'email')
this.emails.hasError('pattern', 'email'))
"
i18n="@@register.invalidEmail2"
>
Expand All @@ -141,6 +143,7 @@ <h2 i18n="@@register.yourEmailAddresses" class="orc-font-body margin-top-12">
*ngFor="let error of this.emails.getError('backendError', 'email')"
>
<app-backend-error
[disableInlineAlreadyExistError]="true"
[errorCode]="error"
[value]="emails.get('email').value"
></app-backend-error>
Expand Down

0 comments on commit 0fba58d

Please sign in to comment.