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 8e10b020d..025cd4393 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 @@ -134,7 +134,11 @@

: email.sourceName || email.source " [isEmailOrDomain]="true" - [date]="email.verificationDate | monthDayYearDateToString" + [date]=" + email.verificationDate + | monthDayYearDateToString + | verificationDateCutoff + " [isLastItem]="true" > @@ -312,7 +316,11 @@

class="orc-font-small-print" [name]="orcidEmailValidation" [isEmailOrDomain]="true" - [date]="domain.createdDate | monthDayYearDateToString" + [date]=" + domain.createdDate + | monthDayYearDateToString + | verificationDateCutoff + " [isLastItem]="true" > diff --git a/src/app/cdk/side-bar/side-bar/side-bar.component.html b/src/app/cdk/side-bar/side-bar/side-bar.component.html index ec95bbbff..c8d875f19 100644 --- a/src/app/cdk/side-bar/side-bar/side-bar.component.html +++ b/src/app/cdk/side-bar/side-bar/side-bar.component.html @@ -147,7 +147,11 @@

: email.sourceName || email.source " [isEmailOrDomain]="true" - [date]="email.verificationDate | monthDayYearDateToString" + [date]=" + email.verificationDate + | monthDayYearDateToString + | verificationDateCutoff + " [isLastItem]="true" > @@ -187,7 +191,11 @@

*ngIf="emailsOpenState" [name]="orcidEmailValidation" [isEmailOrDomain]="true" - [date]="domain.createdDate | monthDayYearDateToString" + [date]=" + domain.createdDate + | monthDayYearDateToString + | verificationDateCutoff + " [isLastItem]="true" > diff --git a/src/app/constants.ts b/src/app/constants.ts index ac796d58f..15522e070 100644 --- a/src/app/constants.ts +++ b/src/app/constants.ts @@ -80,6 +80,8 @@ export const ITEM_ACTION_SELECT = 'select' export const ITEM_ACTION_EXPAND = 'expand' export const ITEM_ACTION_COLLAPSE = 'collapse' +export const VERIFICATION_DATE_CUTOFF = new Date('2024-10-28') + export const ApplicationRoutes = { myOrcid: 'my-orcid', twoFactor: '2fa-signin', diff --git a/src/app/shared/pipes/verification-date-cutoff-pipe/verification-date-cutoff.pipe.spec.ts b/src/app/shared/pipes/verification-date-cutoff-pipe/verification-date-cutoff.pipe.spec.ts new file mode 100644 index 000000000..b078ffc3d --- /dev/null +++ b/src/app/shared/pipes/verification-date-cutoff-pipe/verification-date-cutoff.pipe.spec.ts @@ -0,0 +1,8 @@ +import { VerificationDateCutoffPipe } from './verification-date-cutoff.pipe' + +describe('VerificationDateCutoffPipe', () => { + it('create an instance', () => { + const pipe = new VerificationDateCutoffPipe() + expect(pipe).toBeTruthy() + }) +}) diff --git a/src/app/shared/pipes/verification-date-cutoff-pipe/verification-date-cutoff.pipe.ts b/src/app/shared/pipes/verification-date-cutoff-pipe/verification-date-cutoff.pipe.ts new file mode 100644 index 000000000..10fb40747 --- /dev/null +++ b/src/app/shared/pipes/verification-date-cutoff-pipe/verification-date-cutoff.pipe.ts @@ -0,0 +1,17 @@ +import { Pipe, PipeTransform } from '@angular/core' +import { VERIFICATION_DATE_CUTOFF } from 'src/app/constants' + +@Pipe({ + name: 'verificationDateCutoff', +}) +export class VerificationDateCutoffPipe implements PipeTransform { + transform(value: string): string | null { + if (typeof value === 'string') { + const date = new Date(value) + if (date >= VERIFICATION_DATE_CUTOFF) { + return value + } + } + return null + } +} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index a2fffd957..5807f3340 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -50,6 +50,7 @@ import { AffiliationLabelPipe } from './pipes/affiliation-label.pipe' import { AffiliationTypePipe } from './pipes/affiliation-type/affiliation-type.pipe' import { ScopePathTypePipe } from './pipes/scope-path-type/scope-path-type.pipe' import { AppPanelsSortByAriaLabelPipe } from './pipes/app-panels-sort-by-aria-label/app-panels-sort-by-aria-label.pipe' +import { VerificationDateCutoffPipe } from './pipes/verification-date-cutoff-pipe/verification-date-cutoff.pipe' @NgModule({ imports: [ CommonModule, @@ -60,6 +61,7 @@ import { AppPanelsSortByAriaLabelPipe } from './pipes/app-panels-sort-by-aria-la ], declarations: [ MonthDayYearDateToStringPipe, + VerificationDateCutoffPipe, OfflineMessageComponent, CopyOnClickDirective, CopyOnClickComponent, @@ -107,6 +109,7 @@ import { AppPanelsSortByAriaLabelPipe } from './pipes/app-panels-sort-by-aria-la MatProgressSpinner, MatExpansionModule, MonthDayYearDateToStringPipe, + VerificationDateCutoffPipe, OfflineMessageComponent, MatPaginatorModule, CopyOnClickDirective,