Skip to content

Commit 64cb7a9

Browse files
committed
PD-4978
1 parent 00421e3 commit 64cb7a9

8 files changed

Lines changed: 34 additions & 24 deletions

File tree

projects/orcid-registry-ui/src/lib/components/permission-notifications/permission-notifications.component.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
gap: var(--orcid-space-4, 16px);
99
}
1010

11-
.permission-notifications__list ::ng-deep .action-surface__text {
12-
font-size: var(--orcid-font-size-body-small, 14px);
13-
line-height: 21px;
14-
}
15-
1611
.registry-brand-secondary-dark:hover {
1712
background-color: var(--orcid-color-brand-secondary-dark, #085c77);
1813
}

projects/orcid-ui/src/lib/components/action-surface-container/action-surface-container.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<section class="action-surface-container">
22
<header class="action-surface-container__header">
3-
<h2 class="action-surface-container__title orc-font-body" *ngIf="title">
3+
<h3 class="action-surface-container__title orcid-font-size-body-large" *ngIf="title">
44
{{ title }}
5-
</h2>
5+
</h3>
66
<p
77
class="action-surface-container__subtitle orc-font-body-small"
88
*ngIf="subtitle"

projects/orcid-ui/src/lib/components/action-surface-container/action-surface-container.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
-apple-system,
2626
sans-serif
2727
);
28-
font-size: 20px;
28+
font-size: var(--orcid-font-size-body, 16px);
2929
line-height: 1.25;
3030
font-weight: var(--orcid-font-weight-bold, 700);
3131
color: var(--orcid-color-text-dark-high, #000000);

src/app/core/inbox/permission-notifications.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class PermissionNotificationsService {
9797
(n): n is InboxNotificationPermission =>
9898
n?.notificationType === 'PERMISSION' && !n.readDate && !n.archivedDate
9999
)
100-
.sort((a, b) => Number(b.sentDate || 0) - Number(a.sentDate || 0))
100+
.sort((a, b) => Number(b.createdDate || 0) - Number(a.createdDate || 0))
101101
const byClient = new Map<string, InboxNotificationPermission>()
102102
for (const n of unreadPermission) {
103103
const clientId = n?.source?.sourceClientId?.path
@@ -106,7 +106,7 @@ export class PermissionNotificationsService {
106106
if (!byClient.has(clientId)) byClient.set(clientId, n)
107107
}
108108
return Array.from(byClient.values()).sort(
109-
(a, b) => Number(b.sentDate || 0) - Number(a.sentDate || 0)
109+
(a, b) => Number(b.createdDate || 0) - Number(a.createdDate || 0)
110110
)
111111
}
112112
}

src/app/layout/language/language.component.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { Component, OnInit, Inject, LOCALE_ID } from '@angular/core'
1+
import {
2+
ChangeDetectionStrategy,
3+
Component,
4+
Inject,
5+
LOCALE_ID,
6+
} from '@angular/core'
27

38
import { WINDOW } from 'src/app/cdk/window'
49
import { LanguageService } from 'src/app/core/language/language.service'
@@ -8,8 +13,9 @@ import { LanguageService } from 'src/app/core/language/language.service'
813
templateUrl: './language.component.html',
914
styleUrls: ['./language.component.scss'],
1015
standalone: false,
16+
changeDetection: ChangeDetectionStrategy.OnPush,
1117
})
12-
export class LanguageComponent implements OnInit {
18+
export class LanguageComponent {
1319
languageMenuOptions: { [key: string]: string }
1420
labelLanguage = $localize`:@@layout.ariaLabelLanguage:Select your preferred language. Current language is`
1521

@@ -31,6 +37,4 @@ export class LanguageComponent implements OnInit {
3137
this.window.location.reload()
3238
})
3339
}
34-
35-
ngOnInit() {}
3640
}
Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
import { Component, OnInit } from '@angular/core'
1+
import {
2+
ChangeDetectionStrategy,
3+
ChangeDetectorRef,
4+
Component,
5+
} from '@angular/core'
26
import { TogglzService } from 'src/app/core/togglz/togglz.service'
37
import { MaintenanceMessage } from 'src/app/types/togglz.local'
8+
import { take } from 'rxjs/operators'
49

510
@Component({
611
selector: 'app-maintenance-message',
@@ -10,17 +15,23 @@ import { MaintenanceMessage } from 'src/app/types/togglz.local'
1015
'./maintenance-message.component.scss',
1116
],
1217
standalone: false,
18+
changeDetection: ChangeDetectionStrategy.OnPush,
1319
})
14-
export class MaintenanceMessageComponent implements OnInit {
20+
export class MaintenanceMessageComponent {
1521
maintenanceMessage: MaintenanceMessage
1622
closableElement: Element
1723
labelMaintenance = $localize`:@@layout.ariaLabelMaintenance:Maintenance message`
1824

19-
constructor(togglz: TogglzService) {
20-
togglz.getMaintenanceMessages().subscribe((value) => {
21-
this.maintenanceMessage = value
22-
})
25+
constructor(
26+
togglz: TogglzService,
27+
private cdr: ChangeDetectorRef,
28+
) {
29+
togglz
30+
.getMaintenanceMessages()
31+
.pipe(take(1))
32+
.subscribe((value) => {
33+
this.maintenanceMessage = value
34+
this.cdr.markForCheck()
35+
})
2336
}
24-
25-
ngOnInit() {}
2637
}

src/app/record/components/top-bar/top-bar.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,6 @@ app-top-bar-actions {
147147
}
148148
}
149149

150-
app-warning-message {
150+
app-warning-message, orcid-registry-permission-notifications {
151151
margin-bottom: 16px;
152152
}

src/app/record/components/top-bar/top-bar.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class TopBarComponent implements OnInit, OnDestroy {
191191
(_, i) => i !== event.notificationIndex
192192
)
193193
if (target) {
194-
;(this.window as any).outOfRouterNavigation(target)
194+
this.window.open(target, '_blank')
195195
}
196196
})
197197
return

0 commit comments

Comments
 (0)