mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
fix missing label in modal, add search-labels, fix reprocess message
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<div *ngFor="let key of notifyMessageKeys">
|
||||
<div class="row mb-4">
|
||||
<div class="font-weight-bold col">{{ key + '.notify-detail-modal' | translate}}</div>
|
||||
<div class="col text-right">{{'notify-detail-modal.' + notifyMessage[key] | translate: {default: notifyMessage[key]} }}</div>
|
||||
<div class="col text-right">{{'notify-detail-modal.' + notifyMessage[key] | translate: {default: notifyMessage[key] ?? "n/a" } }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { AdminNotifyMessage } from '../models/admin-notify-message.model';
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { MissingTranslationHelper } from "../../../shared/translate/missing-translation.helper";
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { MissingTranslationHelper } from '../../../shared/translate/missing-translation.helper';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-detail-modal',
|
||||
|
@@ -15,9 +15,16 @@
|
||||
<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>
|
||||
<div class="container my-4">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-3 text-left h4">{{'admin.notify.dashboard.inbound' | translate}}</div>
|
||||
<div class="col-md-9">
|
||||
<ds-search-labels [inPlaceSearch]="true"></ds-search-labels>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ds-themed-search
|
||||
[configuration]="'NOTIFY.incoming'"
|
||||
[configuration]="defaultConfiguration"
|
||||
[showViewModes]="false"
|
||||
[searchEnabled]="false"
|
||||
[context]="context"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
||||
import { Context } from '../../../../core/shared/context.model';
|
||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||
@@ -14,8 +14,14 @@ import { SearchConfigurationService } from '../../../../core/shared/search/searc
|
||||
}
|
||||
]
|
||||
})
|
||||
export class AdminNotifyIncomingComponent {
|
||||
export class AdminNotifyIncomingComponent implements OnInit{
|
||||
public defaultConfiguration = 'NOTIFY.incoming';
|
||||
protected readonly context = Context.CoarNotify;
|
||||
constructor(@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.searchConfigService.getCurrentConfiguration('').subscribe(x => console.log(x));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -15,7 +15,16 @@
|
||||
<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>
|
||||
<div class="container my-4">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-3 text-left h4">{{'admin.notify.dashboard.outbound' | translate}}</div>
|
||||
<div class="col-md-9">
|
||||
<ds-search-labels [inPlaceSearch]="true"></ds-search-labels>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<ds-themed-search
|
||||
[configuration]="'NOTIFY.outgoing'"
|
||||
[showViewModes]="false"
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<div class="mb-2">{{ row.title | translate }}</div>
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-sm" *ngFor="let box of row.boxes">
|
||||
<ds-notification-box [boxConfig]="box"></ds-notification-box>
|
||||
<ds-notification-box (selectedBoxConfig)="navigateToSelectedSearchConfig($event)" [boxConfig]="box"></ds-notification-box>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -9,4 +9,8 @@ export class AdminNotifyMetricsComponent {
|
||||
|
||||
@Input()
|
||||
boxesConfig: AdminNotifyMetricsRow[];
|
||||
|
||||
public navigateToSelectedSearchConfig($event: string) {
|
||||
console.log($event);
|
||||
}
|
||||
}
|
||||
|
@@ -1,41 +1,41 @@
|
||||
<div class="table-responsive mt-2">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr class="text-nowrap">
|
||||
<th scope="col">{{ 'notify-message-result.timestamp' | translate}}</th>
|
||||
<th scope="col">{{'notify-message-result.repositoryItem' | translate}}</th>
|
||||
<th scope="col">{{ 'notify-message-result.ldnService' | translate}}</th>
|
||||
<th scope="col">{{ 'notify-message-result.type' | translate }}</th>
|
||||
<th scope="col">{{ 'notify-message-result.status' | translate }}</th>
|
||||
<th scope="col">{{ 'notify-message-result.action' | translate }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let message of (messagesSubject$ | async)">
|
||||
<td class="text-nowrap">
|
||||
<div>{{ message.queueLastStartTime | date:"YYYY/MM/d hh:mm:ss" }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<a [routerLink]="'/items/' + (isInbound ? message.context : message.object)">{{ message.relatedItem }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<div>{{ message.ldnService }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>{{ message.activityStreamType }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>{{ 'notify-detail-modal.' + message.queueStatusLabel | translate }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex flex-column">
|
||||
<button class="btn mb-2 btn-dark" (click)="openDetailModal(message)">{{ 'notify-message-result.detail' | translate }}</button>
|
||||
<button *ngIf="message.queueStatusLabel === reprocessStatus" (click)="reprocessMessage(message)" class="btn btn-warning">
|
||||
{{ 'notify-message-result.reprocess' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="table-responsive mt-2">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr class="text-nowrap">
|
||||
<th scope="col">{{ 'notify-message-result.timestamp' | translate}}</th>
|
||||
<th scope="col">{{'notify-message-result.repositoryItem' | translate}}</th>
|
||||
<th scope="col">{{ 'notify-message-result.ldnService' | translate}}</th>
|
||||
<th scope="col">{{ 'notify-message-result.type' | translate }}</th>
|
||||
<th scope="col">{{ 'notify-message-result.status' | translate }}</th>
|
||||
<th scope="col">{{ 'notify-message-result.action' | translate }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let message of (messagesSubject$ | async)">
|
||||
<td class="text-nowrap">
|
||||
<div>{{ message.queueLastStartTime | date:"YYYY/MM/d hh:mm:ss" }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<a [routerLink]="'/items/' + (isInbound ? message.context : message.object)">{{ message.relatedItem }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<div>{{ message.ldnService }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>{{ message.activityStreamType }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>{{ 'notify-detail-modal.' + message.queueStatusLabel | translate }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex flex-column">
|
||||
<button class="btn mb-2 btn-dark" (click)="openDetailModal(message)">{{ 'notify-message-result.detail' | translate }}</button>
|
||||
<button *ngIf="message.queueStatusLabel !== reprocessStatus" (click)="reprocessMessage(message)" class="btn btn-warning">
|
||||
{{ 'notify-message-result.reprocess' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@@ -70,7 +70,7 @@ export class AdminNotifySearchResultComponent extends TabulatableResultListEleme
|
||||
this.mapDetailsToMessages();
|
||||
this.subs.push(this.searchConfigService.getCurrentConfiguration('')
|
||||
.subscribe(configuration => {
|
||||
this.isInbound = configuration === 'NOTIFY.incoming';
|
||||
this.isInbound = configuration.startsWith('NOTIFY.incoming');
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@@ -73,25 +73,28 @@ export class AdminNotifyMessagesService extends IdentifiableDataService<AdminNot
|
||||
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)),
|
||||
tap(request => this.requestService.send(request)),
|
||||
switchMap((request: RestRequest) => this.rdbService.buildFromRequestUUID<AdminNotifyMessage>(request.uuid)),
|
||||
getFirstCompletedRemoteData(),
|
||||
getAllSucceededRemoteDataPayload(),
|
||||
map(endpoint => endpoint.replace('{id}', message.id)),
|
||||
map((endpointURL: string) => new GetRequest(requestId, endpointURL)),
|
||||
tap(request => this.requestService.send(request)),
|
||||
switchMap((request: RestRequest) => this.rdbService.buildFromRequestUUID<AdminNotifyMessage>(request.uuid)),
|
||||
getFirstCompletedRemoteData(),
|
||||
getAllSucceededRemoteDataPayload(),
|
||||
mergeMap(reprocessedMessage => this.getDetailedMessages([reprocessedMessage])),
|
||||
).pipe(
|
||||
mergeMap((newMessage) => messageSubject.pipe(
|
||||
map(messages => {
|
||||
const messageToUpdate = messages.find(currentMessage => currentMessage.id === message.id);
|
||||
const indexOfMessageToUpdate = messages.indexOf(messageToUpdate);
|
||||
newMessage.target = messageToUpdate.target;
|
||||
newMessage.object = messageToUpdate.object;
|
||||
newMessage.origin = messageToUpdate.origin;
|
||||
newMessage.context = messageToUpdate.context;
|
||||
messages[indexOfMessageToUpdate] = newMessage;
|
||||
return messages;
|
||||
})
|
||||
)),
|
||||
mergeMap((newMessages) => messageSubject.pipe(
|
||||
map(messages => {
|
||||
const detailedReprocessedMessage = newMessages[0];
|
||||
const messageToUpdate = messages.find(currentMessage => currentMessage.id === message.id);
|
||||
const indexOfMessageToUpdate = messages.indexOf(messageToUpdate);
|
||||
detailedReprocessedMessage.target = message.target;
|
||||
detailedReprocessedMessage.object = message.object;
|
||||
detailedReprocessedMessage.origin = message.origin;
|
||||
detailedReprocessedMessage.context = message.context;
|
||||
messages[indexOfMessageToUpdate] = detailedReprocessedMessage;
|
||||
|
||||
return messages;
|
||||
})
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<div class="w-100 h-100 pt-4 pb-3 px-2 box-container" [ngStyle]="{'background-color': boxConfig.color}">
|
||||
<div (click)="onClick(boxConfig)" class="w-100 h-100 pt-4 pb-3 px-2 box-container" [ngStyle]="{'background-color': boxConfig.color}">
|
||||
<div [ngStyle]="{'color': boxConfig.textColor}" class="d-flex flex-column justify-content-center align-items-center">
|
||||
<div class="mb-3 font-weight-bold box-counter">{{ boxConfig.count ?? 0 }}</div>
|
||||
<div class="font-weight-bold d-flex justify-content-center w-100">{{ boxConfig.title | translate }}</div>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import {
|
||||
AdminNotifyMetricsBox
|
||||
} from '../../admin/admin-notify-dashboard/admin-notify-metrics/admin-notify-metrics.model';
|
||||
@@ -16,4 +16,9 @@ import { ViewMode } from '../../core/shared/view-mode.model';
|
||||
})
|
||||
export class NotificationBoxComponent {
|
||||
@Input() boxConfig: AdminNotifyMetricsBox;
|
||||
@Output() selectedBoxConfig: EventEmitter<string> = new EventEmitter();
|
||||
|
||||
public onClick(boxConfig: AdminNotifyMetricsBox) {
|
||||
this.selectedBoxConfig.emit(boxConfig.config);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user