From db8039f052b7c13dad0fee01631cc164270c4881 Mon Sep 17 00:00:00 2001 From: Daniel Palafox Date: Fri, 8 Dec 2023 01:25:19 -0500 Subject: [PATCH 1/2] fix: Only display `email already associated` inline error if the user clicks on `next` button --- .../backend-error.component.html | 22 +++++++++++++------ .../backend-error/backend-error.component.ts | 11 ++++++++-- .../form-personal.component.html | 10 +++++---- .../form-personal/form-personal.component.ts | 9 ++++++++ .../components/register2.scss-theme.scss | 10 +++++++++ .../register/register.en.properties | 1 + .../register/register.lr.properties | 1 + .../register/register.rl.properties | 1 + .../register/register.xx.properties | 1 + 9 files changed, 53 insertions(+), 13 deletions(-) diff --git a/src/app/register2/components/backend-error/backend-error.component.html b/src/app/register2/components/backend-error/backend-error.component.html index df4401c026..e4bf00b294 100644 --- a/src/app/register2/components/backend-error/backend-error.component.html +++ b/src/app/register2/components/backend-error/backend-error.component.html @@ -1,13 +1,21 @@ - This email already exists in our system. Would you like to + + This email already exists in our system. Would you like to + + sign in? + - sign in? + + This email is already associated with an existing ORCID record. Please use a different email address. + (this.registrationTogglz = value)) if (!(this.errorCode in RegisterBackendErrors)) { this.unrecognizedError = true } diff --git a/src/app/register2/components/form-personal/form-personal.component.html b/src/app/register2/components/form-personal/form-personal.component.html index 237ff52302..8baaa83ff0 100644 --- a/src/app/register2/components/form-personal/form-personal.component.html +++ b/src/app/register2/components/form-personal/form-personal.component.html @@ -88,11 +88,10 @@

done @@ -143,7 +145,7 @@

*ngFor="let error of this.emails.getError('backendError', 'email')" > diff --git a/src/app/register2/components/form-personal/form-personal.component.ts b/src/app/register2/components/form-personal/form-personal.component.ts index 4a88364b3e..284bdc1f63 100644 --- a/src/app/register2/components/form-personal/form-personal.component.ts +++ b/src/app/register2/components/form-personal/form-personal.component.ts @@ -282,6 +282,15 @@ export class FormPersonalComponent extends BaseForm implements OnInit { return validStatus } + get emailError(): boolean { + if (this.emailFormTouched && this.emails.controls.email.errors) { + const backendError = this.emails.controls.email.errors?.backendError + return !(backendError && backendError[0] === 'orcid.frontend.verify.duplicate_email' && !this.nextButtonWasClicked); + } + return false + } + + private announce(announcement: string) { if (environment.debugger) { console.debug('📢' + announcement) diff --git a/src/app/register2/components/register2.scss-theme.scss b/src/app/register2/components/register2.scss-theme.scss index 39d24119c4..2da67ee278 100644 --- a/src/app/register2/components/register2.scss-theme.scss +++ b/src/app/register2/components/register2.scss-theme.scss @@ -87,6 +87,16 @@ ); } } + + .disable-error { + .mat-form-field-outline { + color: rgba(0, 0, 0, 0.12) !important; + } + .mat-input-element { + color: black !important; + } + } + } } diff --git a/src/locale/properties/register/register.en.properties b/src/locale/properties/register/register.en.properties index baa1642882..81c4e170b0 100644 --- a/src/locale/properties/register/register.en.properties +++ b/src/locale/properties/register/register.en.properties @@ -190,3 +190,4 @@ register.emailAreNotValid=Your emails do not match register.Email=Email register.VisibilityParties=Trusted parties register.emailPlaceholder=The email address you use most +register.emailIsAlreadyAssociated=This email is already associated with an existing ORCID record. Please use a different email address. diff --git a/src/locale/properties/register/register.lr.properties b/src/locale/properties/register/register.lr.properties index bffb3a75d1..9b60c4c162 100644 --- a/src/locale/properties/register/register.lr.properties +++ b/src/locale/properties/register/register.lr.properties @@ -194,3 +194,4 @@ register.emailAreNotValid=LR register.confirmYourPassword=LR register.VisibilityParties=LR register.emailPlaceholder=LR +register.emailIsAlreadyAssociated=LR diff --git a/src/locale/properties/register/register.rl.properties b/src/locale/properties/register/register.rl.properties index e838f99428..0c77eac32b 100644 --- a/src/locale/properties/register/register.rl.properties +++ b/src/locale/properties/register/register.rl.properties @@ -194,3 +194,4 @@ register.emailAreNotValid=RL register.confirmYourPassword=RL register.VisibilityParties=RL register.emailPlaceholder=RL +register.emailIsAlreadyAssociated=RL diff --git a/src/locale/properties/register/register.xx.properties b/src/locale/properties/register/register.xx.properties index 55c3d51931..a6808f9e56 100644 --- a/src/locale/properties/register/register.xx.properties +++ b/src/locale/properties/register/register.xx.properties @@ -194,3 +194,4 @@ register.emailAreNotValid=X register.confirmYourPassword=X register.VisibilityParties=X register.emailPlaceholder=X +register.emailIsAlreadyAssociated=X From cb5d27711e6124b64aeb5656817f4e266697faf4 Mon Sep 17 00:00:00 2001 From: Daniel Palafox Date: Fri, 8 Dec 2023 01:34:47 -0500 Subject: [PATCH 2/2] fix: Use color from palette --- src/app/register2/components/register2.scss-theme.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/register2/components/register2.scss-theme.scss b/src/app/register2/components/register2.scss-theme.scss index 2da67ee278..5625fb133b 100644 --- a/src/app/register2/components/register2.scss-theme.scss +++ b/src/app/register2/components/register2.scss-theme.scss @@ -93,7 +93,7 @@ color: rgba(0, 0, 0, 0.12) !important; } .mat-input-element { - color: black !important; + color: $orcid-dark-primary-text !important; } }