fix missing label in modal, add search-labels, fix reprocess message

This commit is contained in:
FrancescoMolinaro
2024-01-12 16:44:32 +01:00
parent 1693d49e27
commit dbf4233e07
12 changed files with 105 additions and 71 deletions

View File

@@ -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>

View File

@@ -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',

View File

@@ -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"

View File

@@ -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));
}
}

View File

@@ -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"

View File

@@ -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>

View File

@@ -9,4 +9,8 @@ export class AdminNotifyMetricsComponent {
@Input()
boxesConfig: AdminNotifyMetricsRow[];
public navigateToSelectedSearchConfig($event: string) {
console.log($event);
}
}

View File

@@ -1,4 +1,4 @@
<div class="table-responsive mt-2">
<div class="table-responsive mt-2">
<table class="table table-striped table-hover">
<thead>
<tr class="text-nowrap">
@@ -30,7 +30,7 @@
<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">
<button *ngIf="message.queueStatusLabel !== reprocessStatus" (click)="reprocessMessage(message)" class="btn btn-warning">
{{ 'notify-message-result.reprocess' | translate }}
</button>
</div>
@@ -38,4 +38,4 @@
</tr>
</tbody>
</table>
</div>
</div>

View File

@@ -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');
})
);
}

View File

@@ -79,16 +79,19 @@ export class AdminNotifyMessagesService extends IdentifiableDataService<AdminNot
switchMap((request: RestRequest) => this.rdbService.buildFromRequestUUID<AdminNotifyMessage>(request.uuid)),
getFirstCompletedRemoteData(),
getAllSucceededRemoteDataPayload(),
mergeMap(reprocessedMessage => this.getDetailedMessages([reprocessedMessage])),
).pipe(
mergeMap((newMessage) => messageSubject.pipe(
mergeMap((newMessages) => messageSubject.pipe(
map(messages => {
const detailedReprocessedMessage = newMessages[0];
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;
detailedReprocessedMessage.target = message.target;
detailedReprocessedMessage.object = message.object;
detailedReprocessedMessage.origin = message.origin;
detailedReprocessedMessage.context = message.context;
messages[indexOfMessageToUpdate] = detailedReprocessedMessage;
return messages;
})
)),

View File

@@ -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>

View File

@@ -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);
}
}