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 f5bd8766f5..13239add4e 100644 --- a/src/app/register2/components/backend-error/backend-error.component.html +++ b/src/app/register2/components/backend-error/backend-error.component.html @@ -1,4 +1,8 @@ - + This email is already associated with an existing ORCID record. Please - use a different email address.This email is already associated with an existing ORCID record. Please use a different email address to continue registering a new ORCID iD. + @@ -27,24 +31,5 @@ Additional emails cannot be duplicated - - The ORCID record exists but has not been claimed. Would you like - to - - resend the claim email? - - - - - A deactivated ORCID record is associated with this email address. - - click here to reactivate - {{ errorCode }} diff --git a/src/app/register2/components/backend-error/backend-error.component.ts b/src/app/register2/components/backend-error/backend-error.component.ts index bdbc066fca..e349c00693 100644 --- a/src/app/register2/components/backend-error/backend-error.component.ts +++ b/src/app/register2/components/backend-error/backend-error.component.ts @@ -1,26 +1,10 @@ -import { Component, Input, OnInit, Inject } from '@angular/core' +import { Component, Input, OnInit } from '@angular/core' import { Router } from '@angular/router' import { take } from 'rxjs/operators' import { PlatformInfoService } from 'src/app/cdk/platform-info' -import { SnackbarService } from 'src/app/cdk/snackbar/snackbar.service' import { ApplicationRoutes } from 'src/app/constants' -import { ErrorHandlerService } from 'src/app/core/error-handler/error-handler.service' -import { SignInService } from 'src/app/core/sign-in/sign-in.service' -import { ERROR_REPORT } from 'src/app/errors' -import { WINDOW } from 'src/app/cdk/window' +import { RegisterBackendErrors } from 'src/app/types/register.local' import { TogglzService } from '../../../core/togglz/togglz.service' - -// When the error text is not listed on the RegisterBackendErrors enum -// the error message will be displayed as it comes from the backend -// This is because the backend might return code or a text ready for the UI -enum RegisterBackendErrors { - 'orcid.frontend.verify.duplicate_email', - 'additionalEmailCantBePrimaryEmail', - 'duplicatedAdditionalEmail', - 'orcid.frontend.verify.unclaimed_email', - 'orcid.frontend.verify.deactivated_email', -} - @Component({ selector: 'app-backend-error', templateUrl: './backend-error.component.html', @@ -50,11 +34,7 @@ export class BackendErrorComponent implements OnInit { constructor( private _platformInfo: PlatformInfoService, private _router: Router, - private _snackbar: SnackbarService, - private _signIn: SignInService, - private _errorHandler: ErrorHandlerService, private _togglz: TogglzService, - @Inject(WINDOW) private window: Window ) {} ngOnInit() { this._togglz @@ -66,11 +46,6 @@ export class BackendErrorComponent implements OnInit { } } - navigateToClaim(email) { - email = encodeURIComponent(email) - this.window.location.href = `/resend-claim?email=${email}` - } - navigateToSignin(email) { this._platformInfo .get() @@ -83,28 +58,4 @@ export class BackendErrorComponent implements OnInit { }) }) } - - reactivateEmail(email) { - const $deactivate = this._signIn.reactivation(email) - $deactivate.subscribe((data) => { - if (data.error) { - this._errorHandler - .handleError( - new Error(data.error), - ERROR_REPORT.REGISTER_REACTIVATED_EMAIL - ) - .subscribe() - } else { - this._snackbar.showSuccessMessage({ - title: $localize`:@@register.reactivating:Reactivating your account`, - // tslint:disable-next-line: max-line-length - message: $localize`:@@ngOrcid.signin.verify.reactivationSent:Thank you for reactivating your ORCID record; please complete the process by following the steps in the email we are now sending you. If you don’t receive an email from us, please`, - action: $localize`:@@shared.contactSupport:contact support.`, - actionURL: `https://support.orcid.org/`, - closable: true, - }) - this._router.navigate([ApplicationRoutes.signin]) - } - }) - } } 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 bc6ecc6600..da873f5fdc 100644 --- a/src/app/register2/components/form-personal/form-personal.component.html +++ b/src/app/register2/components/form-personal/form-personal.component.html @@ -177,19 +177,47 @@

The email address {{ emails.get('email').value }} - is associated with an existing ORCID record. + is already associated with + an existing + + an unclaimed + + a deactivated + + ORCID record + + You cannot use this email address when creating a new ORCID iD. +

Sign in to ORCID using this email address + + Resend a claim email to this email address + + Reactivate the ORCID record associated with this email address
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 5f48fb9856..73041a0921 100644 --- a/src/app/register2/components/form-personal/form-personal.component.ts +++ b/src/app/register2/components/form-personal/form-personal.component.ts @@ -3,6 +3,7 @@ import { Component, ElementRef, forwardRef, + Inject, Input, OnInit, ViewChild, @@ -39,6 +40,12 @@ import { Router } from '@angular/router' import { ApplicationRoutes } from 'src/app/constants' import { LiveAnnouncer } from '@angular/cdk/a11y' import { environment } from 'src/environments/environment' +import { RegisterBackendErrors } from 'src/app/types/register.local' +import { WINDOW } from 'src/app/cdk/window' +import { SnackbarService } from 'src/app/cdk/snackbar/snackbar.service' +import { SignInService } from 'src/app/core/sign-in/sign-in.service' +import { ErrorHandlerService } from 'src/app/core/error-handler/error-handler.service' +import { ERROR_REPORT } from 'src/app/errors' export class MyErrorStateMatcher implements ErrorStateMatcher { isErrorState( control: FormControl | null, @@ -93,12 +100,18 @@ export class FormPersonalComponent extends BaseForm implements OnInit { personalEmail: boolean undefinedEmail: boolean emailsAreValidAlreadyChecked: boolean + registerBackendErrors: RegisterBackendErrors + constructor( private _register: Register2Service, private _reactivationService: ReactivationService, private _platform: PlatformInfoService, private _router: Router, - private _liveAnnouncer: LiveAnnouncer + private _liveAnnouncer: LiveAnnouncer, + private _snackbar: SnackbarService, + private _signIn: SignInService, + private _errorHandler: ErrorHandlerService, + @Inject(WINDOW) private window: Window ) { super() } @@ -318,4 +331,33 @@ export class FormPersonalComponent extends BaseForm implements OnInit { }) }) } + + navigateToClaim(email) { + email = encodeURIComponent(email) + this.window.location.href = `/resend-claim?email=${email}` + } + + reactivateEmail(email) { + const $deactivate = this._signIn.reactivation(email) + $deactivate.subscribe((data) => { + if (data.error) { + this._errorHandler + .handleError( + new Error(data.error), + ERROR_REPORT.REGISTER_REACTIVATED_EMAIL + ) + .subscribe() + } else { + this._snackbar.showSuccessMessage({ + title: $localize`:@@register.reactivating:Reactivating your account`, + // tslint:disable-next-line: max-line-length + message: $localize`:@@ngOrcid.signin.verify.reactivationSent:Thank you for reactivating your ORCID record; please complete the process by following the steps in the email we are now sending you. If you don’t receive an email from us, please`, + action: $localize`:@@shared.contactSupport:contact support.`, + actionURL: `https://support.orcid.org/`, + closable: true, + }) + this._router.navigate([ApplicationRoutes.signin]) + } + }) + } } diff --git a/src/app/types/register.local.ts b/src/app/types/register.local.ts new file mode 100644 index 0000000000..e30d088068 --- /dev/null +++ b/src/app/types/register.local.ts @@ -0,0 +1,10 @@ +// When the error text is not listed on the RegisterBackendErrors enum +// the error message will be displayed as it comes from the backend +// This is because the backend might return code or a text ready for the UI +export enum RegisterBackendErrors { + 'orcid.frontend.verify.duplicate_email', + 'additionalEmailCantBePrimaryEmail', + 'duplicatedAdditionalEmail', + 'orcid.frontend.verify.unclaimed_email', + 'orcid.frontend.verify.deactivated_email' +} diff --git a/src/locale/properties/register/register.ar.properties b/src/locale/properties/register/register.ar.properties index 9377bef4c2..f43952529f 100644 --- a/src/locale/properties/register/register.ar.properties +++ b/src/locale/properties/register/register.ar.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=رسائل البريد الإلكتروني الخا register.Email=بريد الكتروني register.VisibilityParties=المنظمات والأفراد الموثوق بهم register.emailPlaceholder=عنوان البريد الإلكتروني الذي تستخدمه كثيرًا -register.emailIsAlreadyAssociated=هذا البريد الإلكتروني مرتبط بالفعل بسجل ORCID موجود. يُرجى استخدام عنوان بريد إلكتروني مختلف. diff --git a/src/locale/properties/register/register.cs.properties b/src/locale/properties/register/register.cs.properties index ef78d06710..0581fd7000 100644 --- a/src/locale/properties/register/register.cs.properties +++ b/src/locale/properties/register/register.cs.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=Vaše e-maily se neshodují register.Email=Email register.VisibilityParties=Důvěryhodné strany register.emailPlaceholder=E-mailová adresa, kterou používáte nejčastěji -register.emailIsAlreadyAssociated=Tato e-mailová adresa je již spojena se stávajícím záznamem ORCID. Použijte jinou e-mailovou adresu. diff --git a/src/locale/properties/register/register.de.properties b/src/locale/properties/register/register.de.properties index a8a9b8f481..8ac054c170 100644 --- a/src/locale/properties/register/register.de.properties +++ b/src/locale/properties/register/register.de.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=Ihre E-Mail-Adressen stimmen nicht überein. register.Email=E-Mail-Adresse register.VisibilityParties=Vertrauenswürdige Parteien register.emailPlaceholder=Ihre am häufigsten verwendete E-Mail-Adresse -register.emailIsAlreadyAssociated=Diese E-Mail-Adresse ist bereits mit einem existierenden ORCID-Eintrag verknüpft. Bitte verwenden Sie eine andere E-Mail-Adresse. diff --git a/src/locale/properties/register/register.en.properties b/src/locale/properties/register/register.en.properties index 517d77206f..f3fd84d7e9 100644 --- a/src/locale/properties/register/register.en.properties +++ b/src/locale/properties/register/register.en.properties @@ -193,7 +193,6 @@ 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. register.roleJobTitle=Role/Job title register.department=Department register.weCantIdentifyThisOrganization=We can’t identify this organization. Please try entering the organization name again. @@ -206,3 +205,12 @@ register.yearPlaceholder=Year register.monthPlaceholder=Month register.clearOrganization=Clear organization shared.skipThisStepWithoutAddingAnAffiliation=Skip this step without adding an affiliation +register.isAssociatedWith=is already associated with +register.anExisting=an existing +register.anUnclaimed=an unclaimed +register.aDeactivated=a deactivated +register.orcidRecord=ORCID record +register.youCannotUseThisEmail=You cannot use this email address when creating a new ORCID iD. +register.emailIsAlreadyAssociated=This email is already associated with an existing ORCID record. Please use a different email address to continue registering a new ORCID iD. +register.resendClaimAddress=Resend a claim email to this email address +register.reactivateOrcidAssociated=Reactivate the ORCID record associated with this email address diff --git a/src/locale/properties/register/register.es.properties b/src/locale/properties/register/register.es.properties index 1a0ba5cc3f..b91a58f852 100644 --- a/src/locale/properties/register/register.es.properties +++ b/src/locale/properties/register/register.es.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=Sus correos electrónicos no coinciden register.Email=Correo electrónico register.VisibilityParties=Partes de confianza register.emailPlaceholder=La dirección de correo electrónico que más usa -register.emailIsAlreadyAssociated=Este correo electrónico ya está asociado a un registro ORCID existente. Use otra dirección de correo electrónico. diff --git a/src/locale/properties/register/register.fr.properties b/src/locale/properties/register/register.fr.properties index c68c90f2d0..fea96ef47d 100644 --- a/src/locale/properties/register/register.fr.properties +++ b/src/locale/properties/register/register.fr.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=Vos adresses e-mail ne correspondent pas register.Email=Email register.VisibilityParties=Parties de confiance register.emailPlaceholder=L'adresse e-mail que vous utilisez le plus -register.emailIsAlreadyAssociated=Cette adresse e-mail est déjà associée à un dossier ORCID existant. Utilisez une autre adresse e-mail. diff --git a/src/locale/properties/register/register.it.properties b/src/locale/properties/register/register.it.properties index a76b1b228e..485cffbf2a 100644 --- a/src/locale/properties/register/register.it.properties +++ b/src/locale/properties/register/register.it.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=Le email non corrispondono register.Email=Indirizzo email register.VisibilityParties=Parti fidate register.emailPlaceholder=L’indirizzo email che usi di più -register.emailIsAlreadyAssociated=Questa email è già associata a un record ORCID esistente. Usa un indirizzo email diverso. diff --git a/src/locale/properties/register/register.ja.properties b/src/locale/properties/register/register.ja.properties index d53acba3cd..9da2f8d5c3 100644 --- a/src/locale/properties/register/register.ja.properties +++ b/src/locale/properties/register/register.ja.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=メールアドレスが一致しません register.Email=電子メール register.VisibilityParties=トラステッド・パーティー register.emailPlaceholder=最もよく使用するメールアドレス -register.emailIsAlreadyAssociated=このメールアドレスは既に既存のORCIDレコードに関連付けられています。別のメールアドレスを使用してください。 diff --git a/src/locale/properties/register/register.ko.properties b/src/locale/properties/register/register.ko.properties index f69e88ba35..0fea711248 100644 --- a/src/locale/properties/register/register.ko.properties +++ b/src/locale/properties/register/register.ko.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=이메일 불일치 register.Email=이메일 register.VisibilityParties=제한공개 register.emailPlaceholder=가장 자주 사용하는 이메일 주소 -register.emailIsAlreadyAssociated=이 이메일 주소가 기존 ORCID 레코드에 연결되어 있습니다. 다른 이메일 주소를 사용하십시오. diff --git a/src/locale/properties/register/register.lr.properties b/src/locale/properties/register/register.lr.properties index 1a5560bce4..7ce17c5c72 100644 --- a/src/locale/properties/register/register.lr.properties +++ b/src/locale/properties/register/register.lr.properties @@ -194,7 +194,6 @@ register.emailAreNotValid=LR register.confirmYourPassword=LR register.VisibilityParties=LR register.emailPlaceholder=LR -register.emailIsAlreadyAssociated=LR register.step1.3=LR register.step3.3=LR register.step4.3=LR @@ -211,3 +210,13 @@ register.yearPlaceholder=LR register.monthPlaceholder=LR register.clearOrganization=LR shared.skipThisStepWithoutAddingAnAffiliation=LR +register.emailIsAlreadyAssociated=LR +register.isAssociatedWith=LR +register.anExisting=LR +register.anUnclaimed=LR +register.aDeactivated=LR +register.orcidRecord=LR +register.youCannotUseThisEmail=LR +register.emailIsAlreadyAssociated=LR +register.resendClaimAddress=LR +register.reactivateOrcidAssociated=LR diff --git a/src/locale/properties/register/register.pl.properties b/src/locale/properties/register/register.pl.properties index 846128d651..65a647e517 100644 --- a/src/locale/properties/register/register.pl.properties +++ b/src/locale/properties/register/register.pl.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=Twoje adresy e-mail nie pasują register.Email=Adres e-mail register.VisibilityParties=Zaufane strony register.emailPlaceholder=Adresy e-mail, z których najczęściej korzystasz -register.emailIsAlreadyAssociated=Ten adres e-mail jest już połączony z istniejącym rekordem ORCID. Użyj innego adresu e-mail. diff --git a/src/locale/properties/register/register.pt.properties b/src/locale/properties/register/register.pt.properties index d45cb273c7..38db820ab4 100644 --- a/src/locale/properties/register/register.pt.properties +++ b/src/locale/properties/register/register.pt.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=Os e-mails não correspondem register.Email=E-mail register.VisibilityParties=Partes confiáveis register.emailPlaceholder=O endereço de e-mail que utiliza mais -register.emailIsAlreadyAssociated=Este e-mail já está associado a um registo ORCID existente. Utilize um endereço de e-mail diferente. diff --git a/src/locale/properties/register/register.rl.properties b/src/locale/properties/register/register.rl.properties index 50de707814..9a5e0d42a4 100644 --- a/src/locale/properties/register/register.rl.properties +++ b/src/locale/properties/register/register.rl.properties @@ -194,7 +194,6 @@ register.emailAreNotValid=RL register.confirmYourPassword=RL register.VisibilityParties=RL register.emailPlaceholder=RL -register.emailIsAlreadyAssociated=RL register.step1.3=RL register.step3.3=RL register.step4.3=RL @@ -211,3 +210,13 @@ register.yearPlaceholder=RL register.monthPlaceholder=RL register.clearOrganization=RL shared.skipThisStepWithoutAddingAnAffiliation=RL +register.emailIsAlreadyAssociated=RL +register.isAssociatedWith=RL +register.anExisting=RL +register.anUnclaimed=RL +register.aDeactivated=RL +register.orcidRecord=RL +register.youCannotUseThisEmail=RL +register.emailIsAlreadyAssociated=RL +register.resendClaimAddress=RL +register.reactivateOrcidAssociated=RL diff --git a/src/locale/properties/register/register.ru.properties b/src/locale/properties/register/register.ru.properties index 015294b756..dc5e5deef6 100644 --- a/src/locale/properties/register/register.ru.properties +++ b/src/locale/properties/register/register.ru.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=Адреса эл. почты не совпадают. register.Email=Адрес электронной почты register.VisibilityParties=Доверенные лица register.emailPlaceholder=Адрес эл. почты, которым вы пользуетесь чаще всего -register.emailIsAlreadyAssociated=Этот адрес эл. почты уже связан с существующим профилем ORCID. Укажите другой. diff --git a/src/locale/properties/register/register.tr.properties b/src/locale/properties/register/register.tr.properties index 39b2162ed7..bea3a042b3 100644 --- a/src/locale/properties/register/register.tr.properties +++ b/src/locale/properties/register/register.tr.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=E-postalarınız eşleşmiyor register.Email=E-posta register.VisibilityParties=Güvenilen taraflar register.emailPlaceholder=En çok kullandığınız e-posta adresleri -register.emailIsAlreadyAssociated=Bu e-posta adresi zaten mevcut bir ORCID kaydıyla ilişkili durumda. Lütfen farklı bir e-posta adresi kullanın. diff --git a/src/locale/properties/register/register.xx.properties b/src/locale/properties/register/register.xx.properties index 3963e17175..e1c8012ce7 100644 --- a/src/locale/properties/register/register.xx.properties +++ b/src/locale/properties/register/register.xx.properties @@ -194,7 +194,6 @@ register.emailAreNotValid=X register.confirmYourPassword=X register.VisibilityParties=X register.emailPlaceholder=X -register.emailIsAlreadyAssociated=X register.step1.3=X register.step3.3=X register.step4.3=X @@ -211,3 +210,13 @@ register.yearPlaceholder=X register.monthPlaceholder=X register.clearOrganization=X shared.skipThisStepWithoutAddingAnAffiliation=X +register.emailIsAlreadyAssociated=X +register.isAssociatedWith=X +register.anExisting=X +register.anUnclaimed=X +register.aDeactivated=X +register.orcidRecord=X +register.youCannotUseThisEmail=X +register.emailIsAlreadyAssociated=X +register.resendClaimAddress=X +register.reactivateOrcidAssociated=X diff --git a/src/locale/properties/register/register.zh_CN.properties b/src/locale/properties/register/register.zh_CN.properties index 809d006bfe..b761458bda 100644 --- a/src/locale/properties/register/register.zh_CN.properties +++ b/src/locale/properties/register/register.zh_CN.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=您的电子邮件不符 register.Email=电子邮件 register.VisibilityParties=受信任组织 register.emailPlaceholder=您最常用的电子邮件地址 -register.emailIsAlreadyAssociated=此电子邮件已与现有的 ORCID 记录有关联。请使用不同的电子邮件地址。 diff --git a/src/locale/properties/register/register.zh_TW.properties b/src/locale/properties/register/register.zh_TW.properties index 2bd0062584..a75b7d6bec 100644 --- a/src/locale/properties/register/register.zh_TW.properties +++ b/src/locale/properties/register/register.zh_TW.properties @@ -189,4 +189,3 @@ register.emailAreNotValid=您的電子郵件不符 register.Email=電子郵件 register.VisibilityParties=受信任組織 register.emailPlaceholder=您最常使用的電子郵件地址 -register.emailIsAlreadyAssociated=此電子郵件已與現有的 ORCID 記錄有關聯。請使用不同的電子郵件地址。