mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
[CST-12454] getting inbox url from rest for notify info page
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<p [innerHTML]="('coar-notify-support-title.content' | translate)"></p>
|
||||
|
||||
<h2>{{ 'coar-notify-support.ldn-inbox.title' | translate }}</h2>
|
||||
<p [innerHTML]="('coar-notify-support.ldn-inbox.content' | translate).replace('{restApiUrl}', coarRestApiUrl)"></p>
|
||||
<p [innerHTML]="('coar-notify-support.ldn-inbox.content' | translate).replace('{restApiUrl}', (coarRestApiUrl | async)?.join(', '))"></p>
|
||||
|
||||
<h2>{{ 'coar-notify-support.message-moderation.title' | translate }}</h2>
|
||||
<p [innerHTML]="('coar-notify-support.message-moderation.content' | translate)"></p>
|
||||
|
@@ -1,26 +1,24 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NotifyInfoService } from './notify-info.service';
|
||||
|
||||
import { Observable, of } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-notify-info',
|
||||
templateUrl: './notify-info.component.html',
|
||||
styleUrls: ['./notify-info.component.scss']
|
||||
selector: 'ds-notify-info',
|
||||
templateUrl: './notify-info.component.html',
|
||||
styleUrls: ['./notify-info.component.scss'],
|
||||
})
|
||||
/**
|
||||
* Component for displaying COAR notification information.
|
||||
*/
|
||||
export class NotifyInfoComponent implements OnInit {
|
||||
coarLdnEnabled: boolean;
|
||||
coarRestApiUrl: string;
|
||||
/**
|
||||
* Observable containing the COAR REST INBOX API URLs.
|
||||
*/
|
||||
coarRestApiUrl: Observable<string[]> = of([]);
|
||||
|
||||
constructor(
|
||||
public notifyInfoService: NotifyInfoService,
|
||||
) {
|
||||
}
|
||||
constructor(public notifyInfoService: NotifyInfoService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.coarRestApiUrl = this.notifyInfoService.getCoarLdnRestApiUrl();
|
||||
|
||||
this.notifyInfoService.isCoarConfigEnabled().subscribe(value => {
|
||||
this.coarLdnEnabled = value;
|
||||
});
|
||||
}
|
||||
ngOnInit() {
|
||||
this.coarRestApiUrl = this.notifyInfoService.getCoarLdnLocalInboxUrls();
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
|
||||
import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../../shared/operators';
|
||||
import { ConfigurationDataService } from '../../data/configuration-data.service';
|
||||
import { map, Observable } from 'rxjs';
|
||||
import { DefaultAppConfig } from '../../../../config/default-app-config';
|
||||
import { ConfigurationProperty } from '../../shared/configuration-property.model';
|
||||
|
||||
@Injectable({
|
||||
@@ -44,18 +43,6 @@ export class NotifyInfoService {
|
||||
);
|
||||
}
|
||||
|
||||
getCoarLdnRestApiUrl(): string {
|
||||
const appConfig = new DefaultAppConfig();
|
||||
const restConfig = appConfig.rest;
|
||||
|
||||
const ssl = restConfig.ssl;
|
||||
const host = restConfig.host;
|
||||
const port = restConfig.port;
|
||||
const namespace = restConfig.nameSpace;
|
||||
|
||||
return `${ssl ? 'https' : 'http'}://${host}:${port}${namespace}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the relation link for the inbox
|
||||
* @returns the relation link for the inbox
|
||||
|
Reference in New Issue
Block a user