From 64cb7a91935b33c5ba20d5d9e50c408853f6503d Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Date: Thu, 12 Feb 2026 14:42:20 -0600 Subject: [PATCH 1/3] PD-4978 --- .../permission-notifications.component.scss | 5 ---- .../action-surface-container.component.html | 4 +-- .../action-surface-container.component.scss | 2 +- .../inbox/permission-notifications.service.ts | 4 +-- src/app/layout/language/language.component.ts | 12 ++++++--- .../maintenance-message.component.ts | 27 +++++++++++++------ .../components/top-bar/top-bar.component.scss | 2 +- .../components/top-bar/top-bar.component.ts | 2 +- 8 files changed, 34 insertions(+), 24 deletions(-) diff --git a/projects/orcid-registry-ui/src/lib/components/permission-notifications/permission-notifications.component.scss b/projects/orcid-registry-ui/src/lib/components/permission-notifications/permission-notifications.component.scss index b67cd6701d..99b3253adb 100644 --- a/projects/orcid-registry-ui/src/lib/components/permission-notifications/permission-notifications.component.scss +++ b/projects/orcid-registry-ui/src/lib/components/permission-notifications/permission-notifications.component.scss @@ -8,11 +8,6 @@ gap: var(--orcid-space-4, 16px); } -.permission-notifications__list ::ng-deep .action-surface__text { - font-size: var(--orcid-font-size-body-small, 14px); - line-height: 21px; -} - .registry-brand-secondary-dark:hover { background-color: var(--orcid-color-brand-secondary-dark, #085c77); } diff --git a/projects/orcid-ui/src/lib/components/action-surface-container/action-surface-container.component.html b/projects/orcid-ui/src/lib/components/action-surface-container/action-surface-container.component.html index 7f1924c9c5..bb8c207998 100644 --- a/projects/orcid-ui/src/lib/components/action-surface-container/action-surface-container.component.html +++ b/projects/orcid-ui/src/lib/components/action-surface-container/action-surface-container.component.html @@ -1,8 +1,8 @@
-

+

{{ title }} -

+

n?.notificationType === 'PERMISSION' && !n.readDate && !n.archivedDate ) - .sort((a, b) => Number(b.sentDate || 0) - Number(a.sentDate || 0)) + .sort((a, b) => Number(b.createdDate || 0) - Number(a.createdDate || 0)) const byClient = new Map() for (const n of unreadPermission) { const clientId = n?.source?.sourceClientId?.path @@ -106,7 +106,7 @@ export class PermissionNotificationsService { if (!byClient.has(clientId)) byClient.set(clientId, n) } return Array.from(byClient.values()).sort( - (a, b) => Number(b.sentDate || 0) - Number(a.sentDate || 0) + (a, b) => Number(b.createdDate || 0) - Number(a.createdDate || 0) ) } } diff --git a/src/app/layout/language/language.component.ts b/src/app/layout/language/language.component.ts index eec5cda347..3aa939149c 100644 --- a/src/app/layout/language/language.component.ts +++ b/src/app/layout/language/language.component.ts @@ -1,4 +1,9 @@ -import { Component, OnInit, Inject, LOCALE_ID } from '@angular/core' +import { + ChangeDetectionStrategy, + Component, + Inject, + LOCALE_ID, +} from '@angular/core' import { WINDOW } from 'src/app/cdk/window' import { LanguageService } from 'src/app/core/language/language.service' @@ -8,8 +13,9 @@ import { LanguageService } from 'src/app/core/language/language.service' templateUrl: './language.component.html', styleUrls: ['./language.component.scss'], standalone: false, + changeDetection: ChangeDetectionStrategy.OnPush, }) -export class LanguageComponent implements OnInit { +export class LanguageComponent { languageMenuOptions: { [key: string]: string } labelLanguage = $localize`:@@layout.ariaLabelLanguage:Select your preferred language. Current language is` @@ -31,6 +37,4 @@ export class LanguageComponent implements OnInit { this.window.location.reload() }) } - - ngOnInit() {} } diff --git a/src/app/layout/maintenance-message/maintenance-message.component.ts b/src/app/layout/maintenance-message/maintenance-message.component.ts index 6534c2107d..97c029748e 100644 --- a/src/app/layout/maintenance-message/maintenance-message.component.ts +++ b/src/app/layout/maintenance-message/maintenance-message.component.ts @@ -1,6 +1,11 @@ -import { Component, OnInit } from '@angular/core' +import { + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, +} from '@angular/core' import { TogglzService } from 'src/app/core/togglz/togglz.service' import { MaintenanceMessage } from 'src/app/types/togglz.local' +import { take } from 'rxjs/operators' @Component({ selector: 'app-maintenance-message', @@ -10,17 +15,23 @@ import { MaintenanceMessage } from 'src/app/types/togglz.local' './maintenance-message.component.scss', ], standalone: false, + changeDetection: ChangeDetectionStrategy.OnPush, }) -export class MaintenanceMessageComponent implements OnInit { +export class MaintenanceMessageComponent { maintenanceMessage: MaintenanceMessage closableElement: Element labelMaintenance = $localize`:@@layout.ariaLabelMaintenance:Maintenance message` - constructor(togglz: TogglzService) { - togglz.getMaintenanceMessages().subscribe((value) => { - this.maintenanceMessage = value - }) + constructor( + togglz: TogglzService, + private cdr: ChangeDetectorRef, + ) { + togglz + .getMaintenanceMessages() + .pipe(take(1)) + .subscribe((value) => { + this.maintenanceMessage = value + this.cdr.markForCheck() + }) } - - ngOnInit() {} } diff --git a/src/app/record/components/top-bar/top-bar.component.scss b/src/app/record/components/top-bar/top-bar.component.scss index 0ad4cc9b42..bb85644a76 100644 --- a/src/app/record/components/top-bar/top-bar.component.scss +++ b/src/app/record/components/top-bar/top-bar.component.scss @@ -147,6 +147,6 @@ app-top-bar-actions { } } -app-warning-message { +app-warning-message, orcid-registry-permission-notifications { margin-bottom: 16px; } diff --git a/src/app/record/components/top-bar/top-bar.component.ts b/src/app/record/components/top-bar/top-bar.component.ts index ec83f6f7c3..bed687b48c 100644 --- a/src/app/record/components/top-bar/top-bar.component.ts +++ b/src/app/record/components/top-bar/top-bar.component.ts @@ -191,7 +191,7 @@ export class TopBarComponent implements OnInit, OnDestroy { (_, i) => i !== event.notificationIndex ) if (target) { - ;(this.window as any).outOfRouterNavigation(target) + this.window.open(target, '_blank') } }) return From 28339da7bc69fe53369fc12e6b77c3fad43964f5 Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Date: Thu, 12 Feb 2026 14:42:51 -0600 Subject: [PATCH 2/3] PD-4978 --- .../action-surface-container.component.html | 5 ++++- .../maintenance-message/maintenance-message.component.ts | 5 +---- src/app/record/components/top-bar/top-bar.component.scss | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/projects/orcid-ui/src/lib/components/action-surface-container/action-surface-container.component.html b/projects/orcid-ui/src/lib/components/action-surface-container/action-surface-container.component.html index bb8c207998..364392034d 100644 --- a/projects/orcid-ui/src/lib/components/action-surface-container/action-surface-container.component.html +++ b/projects/orcid-ui/src/lib/components/action-surface-container/action-surface-container.component.html @@ -1,6 +1,9 @@

-

+

{{ title }}

Date: Thu, 12 Feb 2026 14:52:44 -0600 Subject: [PATCH 3/3] PD-4978 --- .../inbox/permission-notifications.service.spec.ts | 10 +++++----- src/app/core/inbox/permission-notifications.service.ts | 10 ++++++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/app/core/inbox/permission-notifications.service.spec.ts b/src/app/core/inbox/permission-notifications.service.spec.ts index 63a4416fbb..a3b0dfb1c2 100644 --- a/src/app/core/inbox/permission-notifications.service.spec.ts +++ b/src/app/core/inbox/permission-notifications.service.spec.ts @@ -322,10 +322,10 @@ describe('PermissionNotificationsService', () => { }) }) - it('should sort by sentDate descending', (done) => { + it('should sort by createdDate descending', (done) => { const perm1 = createPermissionNotification({ putCode: 1, - sentDate: 1000, + createdDate: 1000, source: { sourceClientId: { path: 'client-a' } as any, sourceName: { content: 'A' }, @@ -333,7 +333,7 @@ describe('PermissionNotificationsService', () => { }) const perm2 = createPermissionNotification({ putCode: 2, - sentDate: 3000, + createdDate: 3000, source: { sourceClientId: { path: 'client-b' } as any, sourceName: { content: 'B' }, @@ -346,8 +346,8 @@ describe('PermissionNotificationsService', () => { ) service.loadUnreadPermissionNotifications(3).subscribe((result) => { - expect(result[0].sentDate).toBe(3000) - expect(result[1].sentDate).toBe(1000) + expect(result[0].createdDate).toBe(3000) + expect(result[1].createdDate).toBe(1000) done() }) }) diff --git a/src/app/core/inbox/permission-notifications.service.ts b/src/app/core/inbox/permission-notifications.service.ts index ae4b8a3ef0..6f011a0852 100644 --- a/src/app/core/inbox/permission-notifications.service.ts +++ b/src/app/core/inbox/permission-notifications.service.ts @@ -97,7 +97,11 @@ export class PermissionNotificationsService { (n): n is InboxNotificationPermission => n?.notificationType === 'PERMISSION' && !n.readDate && !n.archivedDate ) - .sort((a, b) => Number(b.createdDate || 0) - Number(a.createdDate || 0)) + .sort( + (a, b) => + new Date(b.createdDate || 0).getTime() - + new Date(a.createdDate || 0).getTime() + ) const byClient = new Map() for (const n of unreadPermission) { const clientId = n?.source?.sourceClientId?.path @@ -106,7 +110,9 @@ export class PermissionNotificationsService { if (!byClient.has(clientId)) byClient.set(clientId, n) } return Array.from(byClient.values()).sort( - (a, b) => Number(b.createdDate || 0) - Number(a.createdDate || 0) + (a, b) => + new Date(b.createdDate || 0).getTime() - + new Date(a.createdDate || 0).getTime() ) } }