Skip to content

Commit

Permalink
8975-qa-no-error-menssage-on-addional-email
Browse files Browse the repository at this point in the history
  • Loading branch information
leomendoza123 committed Dec 8, 2023
1 parent 39be027 commit d85c439
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<ng-container *ngIf="recognizedError[errorCode] === 0">
<ng-container *ngIf="!registrationTogglz">
<ng-container i18n="@@register.emailAlreadyExists"
>This email already exists in our system. Would you like to</ng-container
>

<a (click)="navigateToSignin(value)" i18n="@@register.signinLowerCase"
>sign in</a
><ng-container i18n="@@shared.questionMark">?</ng-container>
</ng-container>

<ng-container *ngIf="registrationTogglz && nextButtonWasClicked">
<ng-container *ngIf="(showEmailAlreadyExistUntilNextButtonWasClicked && nextButtonWasClicked) || !showEmailAlreadyExistUntilNextButtonWasClicked">
<ng-container i18n="@@register.emailIsAlreadyAssociated"
>This email is already associated with an existing ORCID record. Please
use a different email address.</ng-container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class BackendErrorComponent implements OnInit {
recognizedError = RegisterBackendErrors
_errorCode: string
@Input() nextButtonWasClicked = false
@Input() showEmailAlreadyExistUntilNextButtonWasClicked = false
registrationTogglz = false

@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
index as i
"
>
<mat-label class="orc-font-small-print" id="additional-email-label">
{{additionalEmails.valid}}
<mat-label class="orc-font-small-print" id="additional-email-label" [ngClass]="{
'error': additionalEmailsTouched && additionalEmails.valid === false
}"
>
<ng-container i18n="@@register.additionalEmails"
>Additional email</ng-container
>
Expand Down Expand Up @@ -36,6 +40,8 @@
>
Please enter a valid email address, for example [email protected]
</mat-error>
<ng-container *ngIf="additionalEmailsTouched"
>
<mat-error
*ngFor="
let error of getControlErrorAtFormLevel(
Expand All @@ -49,6 +55,7 @@
[value]="additionalEmailControl.value.value"
></app-backend-error>
</mat-error>
</ng-container>

<!-- <button
*ngIf="i == 0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ErrorStateMatcherForFormLevelErrors } from '../../ErrorStateMatcherForF
styleUrls: [
'./form-personal-additional-emails.component.scss',
'../register2.style.scss',
'../register2.scss-theme.scss'
],
})
export class FormPersonalAdditionalEmailsComponent implements AfterViewInit {
Expand Down Expand Up @@ -55,6 +56,12 @@ export class FormPersonalAdditionalEmailsComponent implements AfterViewInit {
)
}



get emailError(): boolean {
console.log(this.additionalEmails.controls[0].touched && this.additionalEmails.controls[0].errors)
return !!(this.additionalEmails.controls[0].touched && this.additionalEmails.controls[0].errors);
}
// deleteEmailInput(id: string): void {
// this.additionalEmails.removeControl(id)
// this._changeDetectorRef.detectChanges()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ <h3 i18n="@@register.yourEmailAddresses" class="orc-font-body margin-top-12">
*ngFor="let error of this.emails.getError('backendError', 'email')"
>
<app-backend-error
[showEmailAlreadyExistUntilNextButtonWasClicked]="true"
[nextButtonWasClicked]="nextButtonWasClicked"
[errorCode]="error"
[value]="emails.get('email').value"
Expand Down

0 comments on commit d85c439

Please sign in to comment.