mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
add message detail and translations
This commit is contained in:
@@ -28,7 +28,7 @@ const ENTRY_COMPONENTS = [
|
||||
SharedModule,
|
||||
AdminNotifyDashboardRoutingModule,
|
||||
SearchModule,
|
||||
SearchPageModule,
|
||||
SearchPageModule
|
||||
],
|
||||
providers: [
|
||||
AdminNotifyMessagesService,
|
||||
|
@@ -11,4 +11,12 @@
|
||||
<div class="col text-right">{{'notify-detail-modal.' + notifyMessage[key] | translate: {default: notifyMessage[key] ?? "n/a" } }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn-primary" (click)="toggleCoarMessage()">
|
||||
{{'notify-message-modal.show-more' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<pre @fadeIn [innerHTML]="notifyMessage.message" class="bg-secondary text-white mt-2 p-2" *ngIf="isCoarMessageVisible"></pre>
|
||||
</div>
|
||||
|
@@ -3,10 +3,14 @@ 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 { fadeIn } from '../../../shared/animations/fade';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-detail-modal',
|
||||
templateUrl: './admin-notify-detail-modal.component.html',
|
||||
animations: [
|
||||
fadeIn
|
||||
]
|
||||
})
|
||||
export class AdminNotifyDetailModalComponent {
|
||||
@Input() notifyMessage: AdminNotifyMessage;
|
||||
@@ -18,6 +22,8 @@ export class AdminNotifyDetailModalComponent {
|
||||
@Output()
|
||||
response = new EventEmitter<boolean>();
|
||||
|
||||
public isCoarMessageVisible = false;
|
||||
|
||||
|
||||
constructor(protected activeModal: NgbActiveModal,
|
||||
public translationsService: TranslateService) {
|
||||
@@ -32,4 +38,8 @@ export class AdminNotifyDetailModalComponent {
|
||||
this.activeModal.close();
|
||||
this.response.emit(true);
|
||||
}
|
||||
|
||||
toggleCoarMessage() {
|
||||
this.isCoarMessageVisible = !this.isCoarMessageVisible;
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +0,0 @@
|
||||
.table-responsive {
|
||||
th, td {
|
||||
padding: 0.5rem !important;
|
||||
}
|
||||
}
|
@@ -22,7 +22,6 @@ import { DatePipe } from '@angular/common';
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-search-result',
|
||||
templateUrl: './admin-notify-search-result.component.html',
|
||||
styleUrls: ['./admin-notify-search-result.component.scss'],
|
||||
providers: [
|
||||
{
|
||||
provide: SEARCH_CONFIG_SERVICE,
|
||||
@@ -50,6 +49,26 @@ export class AdminNotifySearchResultComponent extends TabulatableResultListEleme
|
||||
|
||||
private dateTypeKeys: string[] = ['queueLastStartTime', 'queueTimeout'];
|
||||
|
||||
/**
|
||||
* Keys to be not shown in detail
|
||||
* @private
|
||||
*/
|
||||
private hiddenKeys: string[] = [
|
||||
'target',
|
||||
'object',
|
||||
'context',
|
||||
'origin',
|
||||
'_links',
|
||||
'metadata',
|
||||
'thumbnail',
|
||||
'item',
|
||||
'accessStatus',
|
||||
'queueStatus',
|
||||
'notificationId',
|
||||
'notificationType',
|
||||
'message'
|
||||
];
|
||||
|
||||
/**
|
||||
* The format for the date values
|
||||
* @private
|
||||
@@ -83,27 +102,19 @@ export class AdminNotifySearchResultComponent extends TabulatableResultListEleme
|
||||
* Open modal for details visualization
|
||||
* @param message the message to be displayed
|
||||
*/
|
||||
openDetailModal(message: AdminNotifyMessage) {
|
||||
openDetailModal(notifyMessage: AdminNotifyMessage) {
|
||||
const modalRef = this.modalService.open(AdminNotifyDetailModalComponent);
|
||||
const messageToOpen = {...message};
|
||||
// we delete not necessary or not readable keys
|
||||
delete messageToOpen.target;
|
||||
delete messageToOpen.object;
|
||||
delete messageToOpen.context;
|
||||
delete messageToOpen.origin;
|
||||
delete messageToOpen._links;
|
||||
delete messageToOpen.metadata;
|
||||
delete messageToOpen.thumbnail;
|
||||
delete messageToOpen.item;
|
||||
delete messageToOpen.accessStatus;
|
||||
delete messageToOpen.queueStatus;
|
||||
const messageToOpen = {...notifyMessage};
|
||||
// we exclude not necessary or not readable keys
|
||||
const messageKeys = Object.keys(messageToOpen).filter(key => !this.hiddenKeys.includes(key));
|
||||
|
||||
const messageKeys = Object.keys(messageToOpen);
|
||||
messageKeys.forEach(key => {
|
||||
if (this.dateTypeKeys.includes(key)) {
|
||||
messageToOpen[key] = this.datePipe.transform(messageToOpen[key], this.dateFormat);
|
||||
}
|
||||
});
|
||||
// format COAR message for technical visualization
|
||||
messageToOpen.message = JSON.stringify(JSON.parse(notifyMessage.message), null, 2);
|
||||
|
||||
modalRef.componentInstance.notifyMessage = messageToOpen;
|
||||
modalRef.componentInstance.notifyMessageKeys = messageKeys;
|
||||
|
@@ -68,6 +68,12 @@ export class AdminNotifyMessage extends DSpaceObject {
|
||||
@autoserialize
|
||||
context: string;
|
||||
|
||||
/**
|
||||
* The related COAR message
|
||||
*/
|
||||
@autoserialize
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* The attempts of the queue
|
||||
*/
|
||||
|
@@ -3499,6 +3499,28 @@
|
||||
|
||||
"search.filters.filter.activity_stream_type.label": "Search activity stream type",
|
||||
|
||||
"search.filters.applied.f.queue_status": "Queue Status",
|
||||
|
||||
"search.filters.queue_status.1,authority": "Queued",
|
||||
|
||||
"search.filters.queue_status.2,authority": "Processing",
|
||||
|
||||
"search.filters.queue_status.3,authority": "Processed",
|
||||
|
||||
"search.filters.queue_status.4,authority": "Failed",
|
||||
|
||||
"search.filters.queue_status.5,authority": "Untrusted",
|
||||
|
||||
"search.filters.queue_status.6,authority": "Unmapped Action",
|
||||
|
||||
"search.filters.queue_status.7,authority": "Queued for retry",
|
||||
|
||||
"search.filters.applied.f.activity_stream_type": "Activity stream type",
|
||||
|
||||
"search.filters.applied.f.coar_notify_type": "COAR Notify type",
|
||||
|
||||
"search.filters.applied.f.notification_type": "Notification type",
|
||||
|
||||
"search.filters.filter.coar_notify_type.label": "Search COAR Notify type",
|
||||
|
||||
"search.filters.filter.notification_type.label": "Search notification type",
|
||||
@@ -3525,18 +3547,26 @@
|
||||
|
||||
"search.filters.coar_notify_type.coar-notify:ReviewAction": "Review action",
|
||||
|
||||
"search.filters.coar_notify_type.coar-notify:ReviewAction,authority": "Review action",
|
||||
|
||||
"notify-detail-modal.coar-notify:ReviewAction": "Review action",
|
||||
|
||||
"search.filters.coar_notify_type.coar-notify:EndorsementAction": "Endorsement action",
|
||||
|
||||
"search.filters.coar_notify_type.coar-notify:EndorsementAction,authority": "Endorsement action",
|
||||
|
||||
"notify-detail-modal.coar-notify:EndorsementAction": "Endorsement action",
|
||||
|
||||
"search.filters.coar_notify_type.coar-notify:IngestAction": "Ingest action",
|
||||
|
||||
"search.filters.coar_notify_type.coar-notify:IngestAction,authority": "Ingest action",
|
||||
|
||||
"notify-detail-modal.coar-notify:IngestAction": "Ingest action",
|
||||
|
||||
"search.filters.coar_notify_type.coar-notify:RelationshipAction": "Relationship action",
|
||||
|
||||
"search.filters.coar_notify_type.coar-notify:RelationshipAction,authority": "Relationship action",
|
||||
|
||||
"notify-detail-modal.coar-notify:RelationshipAction": "Relationship action",
|
||||
|
||||
"search.filters.queue_status.QUEUE_STATUS_QUEUED": "Queued",
|
||||
@@ -3603,6 +3633,8 @@
|
||||
|
||||
"notify-message-modal.title": "Message Detail",
|
||||
|
||||
"notify-message-modal.show-more": "Show more",
|
||||
|
||||
"notify-message-result.timestamp": "Timestamp",
|
||||
|
||||
"notify-message-result.repositoryItem": "Repository Item",
|
||||
|
Reference in New Issue
Block a user