Skip to content

Commit

Permalink
Merged in coar-CST-12454 (pull request DSpace#974)
Browse files Browse the repository at this point in the history
[CST-12454]  getting inbox url from rest for notify info page

Approved-by: Andrea Bollini
  • Loading branch information
alisaismailati authored and abollini committed Nov 1, 2023
2 parents efcd4d3 + 7117bc3 commit 5b3bcf4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h1>{{ 'coar-notify-support.title' | translate }}</h1>
<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('{ldnInboxUrl}', (coarRestApiUrl | async)?.join(', '))"></p>

<h2>{{ 'coar-notify-support.message-moderation.title' | translate }}</h2>
<p [innerHTML]="('coar-notify-support.message-moderation.content' | translate)"></p>
Expand Down
32 changes: 15 additions & 17 deletions src/app/core/coar-notify/notify-info/notify-info.component.ts
Original file line number Diff line number Diff line change
@@ -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;

constructor(
public notifyInfoService: NotifyInfoService,
) {
}
/**
* Observable containing the COAR REST INBOX API URLs.
*/
coarRestApiUrl: Observable<string[]> = of([]);

ngOnInit() {
this.coarRestApiUrl = this.notifyInfoService.getCoarLdnRestApiUrl();
constructor(public notifyInfoService: NotifyInfoService) {}

this.notifyInfoService.isCoarConfigEnabled().subscribe(value => {
this.coarLdnEnabled = value;
});
}
ngOnInit() {
this.coarRestApiUrl = this.notifyInfoService.getCoarLdnLocalInboxUrls();
}
}
13 changes: 0 additions & 13 deletions src/app/core/coar-notify/notify-info/notify-info.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@

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

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

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

Expand Down

0 comments on commit 5b3bcf4

Please sign in to comment.