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 d85c439 commit 7ed39bf
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 27 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.51.11...v2.51.12)

- [#2116](https://github.com/ORCID/orcid-angular/pull/2116):
- [#2116](https://github.com/ORCID/orcid-angular/pull/2116):

### Fix

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<ng-container *ngIf="recognizedError[errorCode] === 0">
<ng-container *ngIf="(showEmailAlreadyExistUntilNextButtonWasClicked && nextButtonWasClicked) || !showEmailAlreadyExistUntilNextButtonWasClicked">
<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 @@ -6,10 +6,13 @@
index as i
"
>
{{additionalEmails.valid}}
<mat-label class="orc-font-small-print" id="additional-email-label" [ngClass]="{
'error': additionalEmailsTouched && additionalEmails.valid === false
}"
{{ 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 @@ -40,22 +43,21 @@
>
Please enter a valid email address, for example [email protected]
</mat-error>
<ng-container *ngIf="additionalEmailsTouched"
>
<mat-error
*ngFor="
let error of getControlErrorAtFormLevel(
additionalEmailControl.value,
'backendErrors'
)
"
>
<app-backend-error
[errorCode]="error"
[value]="additionalEmailControl.value.value"
></app-backend-error>
</mat-error>
</ng-container>
<ng-container *ngIf="additionalEmailsTouched">
<mat-error
*ngFor="
let error of getControlErrorAtFormLevel(
additionalEmailControl.value,
'backendErrors'
)
"
>
<app-backend-error
[errorCode]="error"
[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,7 +22,7 @@ import { ErrorStateMatcherForFormLevelErrors } from '../../ErrorStateMatcherForF
styleUrls: [
'./form-personal-additional-emails.component.scss',
'../register2.style.scss',
'../register2.scss-theme.scss'
'../register2.scss-theme.scss',
],
})
export class FormPersonalAdditionalEmailsComponent implements AfterViewInit {
Expand Down Expand Up @@ -56,11 +56,15 @@ 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);
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)
Expand Down

0 comments on commit 7ed39bf

Please sign in to comment.