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>
|
<p [innerHTML]="('coar-notify-support-title.content' | translate)"></p>
|
||||||
|
|
||||||
<h2>{{ 'coar-notify-support.ldn-inbox.title' | translate }}</h2>
|
<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>
|
<h2>{{ 'coar-notify-support.message-moderation.title' | translate }}</h2>
|
||||||
<p [innerHTML]="('coar-notify-support.message-moderation.content' | translate)"></p>
|
<p [innerHTML]="('coar-notify-support.message-moderation.content' | translate)"></p>
|
||||||
|
@@ -1,26 +1,24 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { NotifyInfoService } from './notify-info.service';
|
import { NotifyInfoService } from './notify-info.service';
|
||||||
|
import { Observable, of } from 'rxjs';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-notify-info',
|
selector: 'ds-notify-info',
|
||||||
templateUrl: './notify-info.component.html',
|
templateUrl: './notify-info.component.html',
|
||||||
styleUrls: ['./notify-info.component.scss']
|
styleUrls: ['./notify-info.component.scss'],
|
||||||
})
|
})
|
||||||
|
/**
|
||||||
|
* Component for displaying COAR notification information.
|
||||||
|
*/
|
||||||
export class NotifyInfoComponent implements OnInit {
|
export class NotifyInfoComponent implements OnInit {
|
||||||
coarLdnEnabled: boolean;
|
/**
|
||||||
coarRestApiUrl: string;
|
* Observable containing the COAR REST INBOX API URLs.
|
||||||
|
*/
|
||||||
|
coarRestApiUrl: Observable<string[]> = of([]);
|
||||||
|
|
||||||
constructor(
|
constructor(public notifyInfoService: NotifyInfoService) {}
|
||||||
public notifyInfoService: NotifyInfoService,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.coarRestApiUrl = this.notifyInfoService.getCoarLdnRestApiUrl();
|
this.coarRestApiUrl = this.notifyInfoService.getCoarLdnLocalInboxUrls();
|
||||||
|
}
|
||||||
this.notifyInfoService.isCoarConfigEnabled().subscribe(value => {
|
|
||||||
this.coarLdnEnabled = value;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
|
|||||||
import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../../shared/operators';
|
import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../../shared/operators';
|
||||||
import { ConfigurationDataService } from '../../data/configuration-data.service';
|
import { ConfigurationDataService } from '../../data/configuration-data.service';
|
||||||
import { map, Observable } from 'rxjs';
|
import { map, Observable } from 'rxjs';
|
||||||
import { DefaultAppConfig } from '../../../../config/default-app-config';
|
|
||||||
import { ConfigurationProperty } from '../../shared/configuration-property.model';
|
import { ConfigurationProperty } from '../../shared/configuration-property.model';
|
||||||
|
|
||||||
@Injectable({
|
@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
|
* Method to get the relation link for the inbox
|
||||||
* @returns the relation link for the inbox
|
* @returns the relation link for the inbox
|
||||||
|
Reference in New Issue
Block a user