add link, rename tabs, small refactor

This commit is contained in:
FrancescoMolinaro
2024-01-09 12:33:49 +01:00
parent b6245d3c2d
commit 7719626256
7 changed files with 27 additions and 28 deletions

View File

@@ -8,10 +8,10 @@
<a class="nav-link active">{{'admin-notify-dashboard.metrics' | translate}}</a>
</li>
<li class="nav-item">
<a class="nav-link" [routerLink]="'inbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.inbound' | translate}}</a>
<a class="nav-link" [routerLink]="'inbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.inbound-logs' | translate}}</a>
</li>
<li class="nav-item">
<a class="nav-link" [routerLink]="'outbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.outbound' | translate}}</a>
<a class="nav-link" [routerLink]="'outbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.outbound-logs' | translate}}</a>
</ul>
<div class="mt-2">
<ds-admin-notify-metrics *ngIf="(notifyMetricsRows$ | async)?.length" [boxesConfig]="notifyMetricsRows$ | async"></ds-admin-notify-metrics>

View File

@@ -9,10 +9,10 @@
<a class="nav-link" [routerLink]="'../'">{{'admin-notify-dashboard.metrics' | translate}}</a>
</li>
<li class="nav-item">
<a class="nav-link active">{{'admin.notify.dashboard.inbound' | translate}}</a>
<a class="nav-link active">{{'admin.notify.dashboard.inbound-logs' | translate}}</a>
</li>
<li class="nav-item">
<a class="nav-link" [routerLink]="'../outbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.outbound' | translate}}</a>
<a class="nav-link" [routerLink]="'../outbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.outbound-logs' | translate}}</a>
</ul>
<div class="col-12 text-left h4 my-4">{{'admin.notify.dashboard.inbound' | translate}}</div>

View File

@@ -9,10 +9,10 @@
<a class="nav-link" [routerLink]="'../'">{{'admin-notify-dashboard.metrics' | translate}}</a>
</li>
<li class="nav-item">
<a class="nav-link" [routerLink]="'../inbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.inbound' | translate}}</a>
<a class="nav-link" [routerLink]="'../inbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.inbound-logs' | translate}}</a>
</li>
<li class="nav-item">
<a class="nav-link active">{{'admin.notify.dashboard.outbound' | translate}}</a>
<a class="nav-link active">{{'admin.notify.dashboard.outbound-logs' | translate}}</a>
</ul>
<div class="col-12 text-left h4 my-4">{{'admin.notify.dashboard.outbound' | translate}}</div>

View File

@@ -16,12 +16,10 @@
<div>{{ message.queueLastStartTime }}</div>
</td>
<td>
<div *ngIf="isInbound">{{ message.context }}</div>
<div *ngIf="!isInbound">{{ message.object }}</div>
<a [routerLink]="'/items/' + (isInbound ? message.context : message.object)">{{ message.relatedItem }}</a>
</td>
<td>
<div *ngIf="isInbound">{{ message.origin }}</div>
<div *ngIf="!isInbound">{{ message.target }}</div>
<div>{{ message.ldnService }}</div>
</td>
<td>
<div>{{ message.coarNotifyType }}</div>

View File

@@ -60,6 +60,18 @@ export class AdminNotifyMessage extends DSpaceObject {
@autoserialize
object: string;
/**
* The name of the related item
*/
@autoserialize
relatedItem: string;
/**
* The name of the related ldn service
*/
@autoserialize
ldnService: string;
/**
* The context of the message
*/

View File

@@ -58,27 +58,15 @@ export class AdminNotifyMessagesService extends IdentifiableDataService<AdminNot
public getDetailedMessages(messages: AdminNotifyMessage[]): Observable<AdminNotifyMessage[]> {
return from(messages.map(message => this.formatMessageLabels(message))).pipe(
mergeMap(message =>
message.target ? this.ldnServicesService.findById(message.target.toString()).pipe(
message.target || message.origin ? this.ldnServicesService.findById((message.target || message.origin).toString()).pipe(
getAllSucceededRemoteDataPayload(),
map(detail => ({...message, target: detail.name}))
map(detail => ({...message, ldnService: detail.name}))
) : of(message),
),
mergeMap(message =>
message.object ? this.itemDataService.findById(message.object.toString()).pipe(
message.object || message.context ? this.itemDataService.findById(message.object || message.context).pipe(
getAllSucceededRemoteDataPayload(),
map(detail => ({...message, object: detail.name}))
) : of(message),
),
mergeMap(message =>
message.origin ? this.ldnServicesService.findById(message.origin.toString()).pipe(
getAllSucceededRemoteDataPayload(),
map(detail => ({...message, origin: detail.name}))
) : of(message),
),
mergeMap(message =>
message.context ? this.itemDataService.findById(message.context).pipe(
getAllSucceededRemoteDataPayload(),
map(detail => ({...message, context: detail.name}))
map(detail => ({...message, relatedItem: detail.name}))
) : of(message),
),
scan((acc: any, value: any) => [...acc, value], []),
@@ -93,7 +81,6 @@ export class AdminNotifyMessagesService extends IdentifiableDataService<AdminNot
public reprocessMessage(message: AdminNotifyMessage, messageSubject: BehaviorSubject<AdminNotifyMessage[]>): Observable<AdminNotifyMessage[]> {
const requestId = this.requestService.generateRequestId();
return this.halService.getEndpoint(this.reprocessEndpoint).pipe(
map(endpoint => endpoint.replace('{id}', message.id)),
map((endpointURL: string) => new GetRequest(requestId, endpointURL)),

View File

@@ -3473,9 +3473,11 @@
"admin.notify.dashboard.inbound": "Inbound messages",
"admin.notify.dashboard.inbound-logs": "Logs/Inbound",
"admin.notify.dashboard.outbound": "Outbound messages",
"admin.notify.dashboard.breadcrumbs": "Dashboard",
"admin.notify.dashboard.outbound-logs": "Logs/Outbound",
"NOTIFY.incoming.search.results.head": "Incoming",