Files
dspace-angular/src/app/info/notify-info/notify-info.component.ts
2024-05-15 21:11:28 +02:00

47 lines
1.1 KiB
TypeScript

import { AsyncPipe } from '@angular/common';
import {
Component,
OnInit,
} from '@angular/core';
import { RouterLink } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core';
import {
map,
Observable,
} from 'rxjs';
import { NotifyInfoService } from '../../core/coar-notify/notify-info/notify-info.service';
@Component({
selector: 'ds-notify-info',
templateUrl: './notify-info.component.html',
styleUrls: ['./notify-info.component.scss'],
imports: [
RouterLink,
TranslateModule,
AsyncPipe,
],
standalone: true,
})
/**
* Component for displaying COAR notification information.
*/
export class NotifyInfoComponent implements OnInit {
/**
* Observable containing the COAR REST INBOX API URLs.
*/
coarRestApiUrls$: Observable<string>;
constructor(
protected notifyInfoService: NotifyInfoService,
) {
}
ngOnInit() {
this.coarRestApiUrls$ = this.notifyInfoService.getCoarLdnLocalInboxUrls().pipe(
map((urls: string[]) => urls.map((url: string) => `<a href="${url}" target="_blank">${url}</a>`).join(', ')),
);
}
}