Skip to content

Commit 83bbb98

Browse files
Fix COAR notify link on the info component
1 parent c2c832e commit 83bbb98

7 files changed

Lines changed: 30 additions & 38 deletions

File tree

src/app/footer/footer.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ <h5 class="text-uppercase">Footer Content</h5>
8484
</div>
8585
<div *ngIf="coarLdnEnabled$ | async" class="notify-enabled text-white">
8686
<a class="coar-notify-support-route" routerLink="info/coar-notify-support">
87-
<img class="n-coar" src="assets/images/n-coar.png" [attr.alt]="'menu.header.image.logo' | translate" />
87+
<img class="n-coar" src="assets/images/n-coar.svg" [attr.alt]="'menu.header.image.logo' | translate" />
8888
{{ 'footer.link.coar-notify-support' | translate }}
8989
</a>
9090
</div>
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
<div class="container">
2-
<head>
3-
<title>{{ 'coar-notify-support.title' | translate }}</title>
4-
</head>
5-
<body>
6-
<h1>{{ 'coar-notify-support.title' | translate }}</h1>
7-
<p [innerHTML]="('coar-notify-support-title.content' | translate)"></p>
2+
<h1>{{ 'coar-notify-support.title' | translate }}</h1>
3+
<p [innerHTML]="'coar-notify-support-title.content' | translate"></p>
84

9-
<h2>{{ 'coar-notify-support.ldn-inbox.title' | translate }}</h2>
10-
<p [innerHTML]="('coar-notify-support.ldn-inbox.content' | translate).replace('{ldnInboxUrl}', generateCoarRestApiLinksHTML() | async)"></p>
5+
<h2>{{ 'coar-notify-support.ldn-inbox.title' | translate }}</h2>
6+
<p [innerHTML]="'coar-notify-support.ldn-inbox.content' | translate:{ ldnInboxUrl: coarRestApiUrls$ | async }"></p>
117

12-
<h2>{{ 'coar-notify-support.message-moderation.title' | translate }}</h2>
13-
<p>
14-
{{ 'coar-notify-support.message-moderation.content' | translate }}
15-
<a routerLink="/info/feedback" >{{ 'coar-notify-support.message-moderation.feedback-form' | translate }}</a>
16-
</p>
17-
</body>
8+
<h2>{{ 'coar-notify-support.message-moderation.title' | translate }}</h2>
9+
<p>
10+
{{ 'coar-notify-support.message-moderation.content' | translate }}
11+
<a routerLink="/info/feedback">{{ 'coar-notify-support.message-moderation.feedback-form' | translate }}</a>
12+
</p>
1813
</div>

src/app/info/notify-info/notify-info.component.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ describe('NotifyInfoComponent', () => {
1616
let notifyInfoServiceSpy: any;
1717

1818
beforeEach(async () => {
19-
notifyInfoServiceSpy = jasmine.createSpyObj('NotifyInfoService', ['getCoarLdnLocalInboxUrls']);
19+
notifyInfoServiceSpy = jasmine.createSpyObj('NotifyInfoService', {
20+
getCoarLdnLocalInboxUrls: of([]),
21+
});
2022

2123
await TestBed.configureTestingModule({
2224
imports: [TranslateModule.forRoot(), NotifyInfoComponent],
@@ -31,8 +33,7 @@ describe('NotifyInfoComponent', () => {
3133
beforeEach(() => {
3234
fixture = TestBed.createComponent(NotifyInfoComponent);
3335
component = fixture.componentInstance;
34-
component.coarRestApiUrl = of([]);
35-
spyOn(component, 'generateCoarRestApiLinksHTML').and.returnValue(of(''));
36+
component.coarRestApiUrls$ = of('');
3637
fixture.detectChanges();
3738
});
3839

src/app/info/notify-info/notify-info.component.ts

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { TranslateModule } from '@ngx-translate/core';
88
import {
99
map,
1010
Observable,
11-
of,
1211
} from 'rxjs';
1312

1413
import { NotifyInfoService } from '../../core/coar-notify/notify-info/notify-info.service';
@@ -31,26 +30,17 @@ export class NotifyInfoComponent implements OnInit {
3130
/**
3231
* Observable containing the COAR REST INBOX API URLs.
3332
*/
34-
coarRestApiUrl: Observable<string[]> = of([]);
33+
coarRestApiUrls$: Observable<string>;
3534

36-
constructor(private notifyInfoService: NotifyInfoService) {}
37-
38-
ngOnInit() {
39-
this.coarRestApiUrl = this.notifyInfoService.getCoarLdnLocalInboxUrls();
35+
constructor(
36+
protected notifyInfoService: NotifyInfoService,
37+
) {
4038
}
4139

42-
/**
43-
* Generates HTML code for COAR REST API links.
44-
* @returns An Observable that emits the generated HTML code.
45-
*/
46-
generateCoarRestApiLinksHTML() {
47-
return this.coarRestApiUrl.pipe(
48-
// transform the data into HTML
49-
map((urls) => {
50-
return urls.map(url => `
51-
<code><a href="${url}" target="_blank"><span class="api-url">${url}</span></a></code>
52-
`).join(',');
53-
}),
40+
ngOnInit() {
41+
this.coarRestApiUrls$ = this.notifyInfoService.getCoarLdnLocalInboxUrls().pipe(
42+
map((urls: string[]) => urls.map((url: string) => `<a href="${url}" target="_blank">${url}</a>`).join(', ')),
5443
);
5544
}
45+
5646
}

src/assets/i18n/en.json5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6092,11 +6092,11 @@
60926092

60936093
"coar-notify-support.title": "COAR Notify Protocol",
60946094

6095-
"coar-notify-support-title.content": "Here, we fully support the COAR Notify protocol, which is designed to enhance the communication between repositories. To learn more about the COAR Notify protocol, visit the <a href=\\\"https://notify.coar-repositories.org/\\\">COAR Notify website</a>.",
6095+
"coar-notify-support-title.content": "Here, we fully support the COAR Notify protocol, which is designed to enhance the communication between repositories. To learn more about the COAR Notify protocol, visit the <a href=\"https://notify.coar-repositories.org/\" rel=\"noopener noreferrer\">COAR Notify website</a>.",
60966096

60976097
"coar-notify-support.ldn-inbox.title": "LDN InBox",
60986098

6099-
"coar-notify-support.ldn-inbox.content": "For your convenience, our LDN (Linked Data Notifications) InBox is easily accessible at {ldnInboxUrl}. The LDN InBox enables seamless communication and data exchange, ensuring efficient and effective collaboration.",
6099+
"coar-notify-support.ldn-inbox.content": "For your convenience, our LDN (Linked Data Notifications) InBox is easily accessible at {{ ldnInboxUrl }}. The LDN InBox enables seamless communication and data exchange, ensuring efficient and effective collaboration.",
61006100

61016101
"coar-notify-support.message-moderation.title": "Message Moderation",
61026102

src/assets/images/n-coar.png

-5.43 KB
Binary file not shown.

src/assets/images/n-coar.svg

Lines changed: 6 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)