From d39cd59cd9f62d8fffd22faa26d70f02d48754e3 Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Tue, 15 Oct 2024 18:57:02 +0300 Subject: [PATCH] email modal verification changes --- .../modal-email/modal-email.component.html | 42 +++++++++++++++---- .../modal-email/modal-email.component.scss | 14 +++++-- .../modal-email/modal-email.component.ts | 4 +- .../record-emails/record-emails.service.ts | 7 ++++ src/app/types/record.endpoint.ts | 2 + .../properties/shared/shared.en.properties | 1 + .../side-bar/side-bar.en.properties | 1 + 7 files changed, 57 insertions(+), 14 deletions(-) diff --git a/src/app/cdk/side-bar/modals/modal-email/modal-email.component.html b/src/app/cdk/side-bar/modals/modal-email/modal-email.component.html index 7badc5956..172ec49eb 100644 --- a/src/app/cdk/side-bar/modals/modal-email/modal-email.component.html +++ b/src/app/cdk/side-bar/modals/modal-email/modal-email.component.html @@ -80,12 +80,26 @@

class="orc-font-small-print" > Please enter a valid email address, for example - joe@institution.edu + joe@institution.edu {{ domain.value }} - Verified email domain +
verificationsSend: string[] = [] @@ -82,7 +84,7 @@ export class ModalEmailComponent implements OnInit, OnDestroy { addedEmailsCount = 0 emailsForm: UntypedFormGroup = new UntypedFormGroup({}) emails: AssertionVisibilityString[] = [] - verifiedDomains = [] + verifiedDomains: AssertionVisibilityString[] = [] primaryEmail: AssertionVisibilityString | undefined = undefined originalEmailsBackendCopy: AssertionVisibilityString[] defaultVisibility: VisibilityStrings = 'PRIVATE' diff --git a/src/app/core/record-emails/record-emails.service.ts b/src/app/core/record-emails/record-emails.service.ts index ed8ed24fa..d79a75bad 100644 --- a/src/app/core/record-emails/record-emails.service.ts +++ b/src/app/core/record-emails/record-emails.service.ts @@ -62,6 +62,13 @@ export class RecordEmailsService { catchError((error) => of({ emails: [] })), map((value: EmailsEndpoint) => { value.emails.sort(this.sortByEmailCreationDate) + value.emailDomains.forEach((domain) => { + value.emails.forEach((email) => { + if (email.value.includes(domain.value)) { + email.professionalEmail = true + } + }) + }) return value }), tap((value) => { diff --git a/src/app/types/record.endpoint.ts b/src/app/types/record.endpoint.ts index a30c9f9e2..f4a03433f 100644 --- a/src/app/types/record.endpoint.ts +++ b/src/app/types/record.endpoint.ts @@ -104,8 +104,10 @@ export interface AssertionBase { urlName?: string sourceName?: string content?: string + professionalEmail?: boolean createdDate?: MonthDayYearDate lastModified?: MonthDayYearDate + verificationDate?: MonthDayYearDate assertionOriginOrcid?: any assertionOriginClientId?: any assertionOriginName?: any diff --git a/src/locale/properties/shared/shared.en.properties b/src/locale/properties/shared/shared.en.properties index 97493b809..65c0e52af 100644 --- a/src/locale/properties/shared/shared.en.properties +++ b/src/locale/properties/shared/shared.en.properties @@ -21,6 +21,7 @@ shared.whoCanSeeBio=Control who can see your biography by setting the visibility shared.whoCanSeeName=Control who can see your given, family and published names by setting the visibility. The default visibility for your names is shared.requiredInformation=Required information shared.created=Created: +shared.verified=Verified: shared.delete=Delete shared.showMore=Show more shared.showLess=Show less diff --git a/src/locale/properties/side-bar/side-bar.en.properties b/src/locale/properties/side-bar/side-bar.en.properties index dfed5e5f2..3e0165f4b 100644 --- a/src/locale/properties/side-bar/side-bar.en.properties +++ b/src/locale/properties/side-bar/side-bar.en.properties @@ -23,6 +23,7 @@ side-bar.verifiedEmailDomain=Verified email domain side-bar.whenYouVerifyEmail=When you verify a professional email address we will add the associated domain to your record. You can choose to show an email domain on your public record instead of the full email address. side-bar.findOutMoreAboutVerifiedEmailDomains=Find out more about verified email domains side-bar.noVerifiedEmailDomains=No verified email domains +side-bar.orcidEmailValidation=ORCID email validation side-bar.inYourOrcidRecord=in your ORCID record. side-bar.youNeedToVerify=You need to verify your primary email in order to access all of ORCID’s editing features. side-bar.youNeedToVerify2=To verify your email, click the link in the message sent to: