Add components descriptions, fix bug on navigation, align labels, add config example

This commit is contained in:
FrancescoMolinaro
2024-03-04 11:29:02 +01:00
parent 0e4b220db1
commit 23cb4ca7b7
15 changed files with 118 additions and 13 deletions

View File

@@ -433,3 +433,61 @@ search:
enabled: false enabled: false
# List of filters to enable in "Advanced Search" dropdown # List of filters to enable in "Advanced Search" dropdown
filter: [ 'title', 'author', 'subject', 'entityType' ] filter: [ 'title', 'author', 'subject', 'entityType' ]
# Notify metrics
# Configuration for Notify Admin Dashboard for metrics visualization
notifyMetrics:
# Configuration for received messages
- title: 'admin-notify-dashboard.received-ldn'
boxes:
- color: '#B8DAFF'
title: 'admin-notify-dashboard.NOTIFY.incoming.accepted'
config: 'NOTIFY.incoming.accepted'
description: 'admin-notify-dashboard.NOTIFY.incoming.accepted.description'
- color: '#D4EDDA'
title: 'admin-notify-dashboard.NOTIFY.incoming.processed'
config: 'NOTIFY.incoming.processed'
description: 'admin-notify-dashboard.NOTIFY.incoming.processed.description'
- color: '#FDBBC7'
title: 'admin-notify-dashboard.NOTIFY.incoming.failure'
config: 'NOTIFY.incoming.failure'
description: 'admin-notify-dashboard.NOTIFY.incoming.failure.description'
- color: '#FDBBC7'
title: 'admin-notify-dashboard.NOTIFY.incoming.untrusted'
config: 'NOTIFY.incoming.untrusted'
description: 'admin-notify-dashboard.NOTIFY.incoming.untrusted.description'
- color: '#43515F'
title: 'admin-notify-dashboard.NOTIFY.incoming.involvedItems'
textColor: '#fff'
config: 'NOTIFY.incoming.involvedItems'
description: 'admin-notify-dashboard.NOTIFY.incoming.involvedItems.description'
# Configuration for outgoing messages
- title: 'admin-notify-dashboard.generated-ldn'
boxes:
- color: '#B8DAFF'
title: 'admin-notify-dashboard.NOTIFY.outgoing.queued'
config: 'NOTIFY.outgoing.queued'
description: 'admin-notify-dashboard.NOTIFY.outgoing.queued.description'
- color: '#FDEEBB'
title: 'admin-notify-dashboard.NOTIFY.outgoing.queued_for_retry'
config: 'NOTIFY.outgoing.queued_for_retry'
description: 'admin-notify-dashboard.NOTIFY.outgoing.queued_for_retry.description'
- color: '#FDBBC7'
title: 'admin-notify-dashboard.NOTIFY.outgoing.failure'
config: 'NOTIFY.outgoing.failure'
description: 'admin-notify-dashboard.NOTIFY.outgoing.failure.description'
- color: '#43515F'
title: 'admin-notify-dashboard.NOTIFY.outgoing.involvedItems'
textColor: '#fff'
config: 'NOTIFY.outgoing.involvedItems'
description: 'admin-notify-dashboard.NOTIFY.outgoing.involvedItems.description'
- color: '#D4EDDA'
title: 'admin-notify-dashboard.NOTIFY.outgoing.delivered'
config: 'NOTIFY.outgoing.delivered'
description: 'admin-notify-dashboard.NOTIFY.outgoing.delivered.description'

View File

@@ -23,6 +23,10 @@ import { SearchConfigurationService } from '../../core/shared/search/search-conf
} }
] ]
}) })
/**
* Component used for visual representation and search of LDN messages for Admins
*/
export class AdminNotifyDashboardComponent implements OnInit{ export class AdminNotifyDashboardComponent implements OnInit{
public notifyMetricsRows$: Observable<AdminNotifyMetricsRow[]>; public notifyMetricsRows$: Observable<AdminNotifyMetricsRow[]>;

View File

@@ -12,6 +12,10 @@ import { fadeIn } from '../../../shared/animations/fade';
fadeIn fadeIn
] ]
}) })
/**
* Component for detailed view of LDN messages displayed in search result in AdminNotifyDashboardComponent
*/
export class AdminNotifyDetailModalComponent { export class AdminNotifyDetailModalComponent {
@Input() notifyMessage: AdminNotifyMessage; @Input() notifyMessage: AdminNotifyMessage;
@Input() notifyMessageKeys: string[]; @Input() notifyMessageKeys: string[];

View File

@@ -1,7 +1,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h2 class="border-bottom pb-2">{{'admin-notify-dashboard.title'| translate}}</h2> <h1 class="border-bottom pb-2">{{'admin-notify-dashboard.title'| translate}}</h1>
<div> <div>
<div> <div>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
@@ -12,7 +12,7 @@
<a class="nav-link active">{{'admin.notify.dashboard.inbound-logs' | translate}}</a> <a class="nav-link active">{{'admin.notify.dashboard.inbound-logs' | translate}}</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" [routerLink]="'../outbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.outbound-logs' | translate}}</a> <a class="nav-link" [routerLink]="'../outbound'" [queryParams]="{view: 'table', configuration: 'NOTIFY.outgoing'}">{{'admin.notify.dashboard.outbound-logs' | translate}}</a>
</ul> </ul>
<ds-admin-notify-logs-result [defaultConfiguration]="'NOTIFY.incoming'" ></ds-admin-notify-logs-result> <ds-admin-notify-logs-result [defaultConfiguration]="'NOTIFY.incoming'" ></ds-admin-notify-logs-result>

View File

@@ -23,6 +23,11 @@ import { map } from 'rxjs/operators';
} }
] ]
}) })
/**
* Component for visualization of search page and related results for the logs of the Notify dashboard
*/
export class AdminNotifyLogsResultComponent implements OnInit { export class AdminNotifyLogsResultComponent implements OnInit {
@Input() @Input()

View File

@@ -1,7 +1,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h2 class="border-bottom pb-2">{{'admin-notify-dashboard.title'| translate}}</h2> <h1 class="border-bottom pb-2">{{'admin-notify-dashboard.title'| translate}}</h1>
<div> <div>
<div> <div>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
@@ -9,7 +9,7 @@
<a class="nav-link" [routerLink]="'../'">{{'admin-notify-dashboard.metrics' | translate}}</a> <a class="nav-link" [routerLink]="'../'">{{'admin-notify-dashboard.metrics' | translate}}</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" [routerLink]="'../inbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.inbound-logs' | translate}}</a> <a class="nav-link" [routerLink]="'../inbound'" [queryParams]="{view: 'table', configuration: 'NOTIFY.incoming'}">{{'admin.notify.dashboard.inbound-logs' | translate}}</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link active">{{'admin.notify.dashboard.outbound-logs' | translate}}</a> <a class="nav-link active">{{'admin.notify.dashboard.outbound-logs' | translate}}</a>

View File

@@ -7,6 +7,10 @@ import { ViewMode } from '../../../core/shared/view-mode.model';
selector: 'ds-admin-notify-metrics', selector: 'ds-admin-notify-metrics',
templateUrl: './admin-notify-metrics.component.html', templateUrl: './admin-notify-metrics.component.html',
}) })
/**
* Component used to display the number of notification for each configured box in the notifyMetrics section
*/
export class AdminNotifyMetricsComponent { export class AdminNotifyMetricsComponent {
@Input() @Input()

View File

@@ -1,3 +1,7 @@
/**
* The properties for each Box to be displayed in rows in the AdminNotifyMetricsComponent
*/
export interface AdminNotifyMetricsBox { export interface AdminNotifyMetricsBox {
color: string; color: string;
textColor?: string; textColor?: string;
@@ -6,7 +10,9 @@ export interface AdminNotifyMetricsBox {
config: string; config: string;
count?: number; count?: number;
} }
/**
* The properties for each Row containing a list of AdminNotifyMetricsBox to be displayed in the AdminNotifyMetricsComponent
*/
export interface AdminNotifyMetricsRow { export interface AdminNotifyMetricsRow {
title: string; title: string;
boxes: AdminNotifyMetricsBox[] boxes: AdminNotifyMetricsBox[]

View File

@@ -29,6 +29,11 @@ import { DatePipe } from '@angular/common';
} }
] ]
}) })
/**
* Component for visualization in table format of the search results related to the AdminNotifyDashboardComponent
*/
export class AdminNotifySearchResultComponent extends TabulatableResultListElementsComponent<PaginatedList<AdminNotifySearchResult>, AdminNotifySearchResult> implements OnInit, OnDestroy{ export class AdminNotifySearchResultComponent extends TabulatableResultListElementsComponent<PaginatedList<AdminNotifySearchResult>, AdminNotifySearchResult> implements OnInit, OnDestroy{
public messagesSubject$: BehaviorSubject<AdminNotifyMessage[]> = new BehaviorSubject([]); public messagesSubject$: BehaviorSubject<AdminNotifyMessage[]> = new BehaviorSubject([]);
public reprocessStatus = 'QUEUE_STATUS_QUEUED_FOR_RETRY'; public reprocessStatus = 'QUEUE_STATUS_QUEUED_FOR_RETRY';

View File

@@ -14,6 +14,10 @@ import { ViewMode } from '../../core/shared/view-mode.model';
templateUrl: './notification-box.component.html', templateUrl: './notification-box.component.html',
styleUrls: ['./notification-box.component.scss'] styleUrls: ['./notification-box.component.scss']
}) })
/**
* Component to display the count of notifications for each type of LDN message and to access the related filtered search
* (each box works as a filter button setting a specific search configuration)
*/
export class NotificationBoxComponent { export class NotificationBoxComponent {
@Input() boxConfig: AdminNotifyMetricsBox; @Input() boxConfig: AdminNotifyMetricsBox;
@Output() selectedBoxConfig: EventEmitter<string> = new EventEmitter(); @Output() selectedBoxConfig: EventEmitter<string> = new EventEmitter();

View File

@@ -10,6 +10,11 @@ import { PaginatedList } from '../../../../core/data/paginated-list.model';
selector: 'ds-objects-collection-tabulatable', selector: 'ds-objects-collection-tabulatable',
template: ``, template: ``,
}) })
/**
* Abstract class that describe the properties for the rendering of search result's paginated lists of objects in a table.
* To be used as descriptor of the actual result component e.g. TabulatableResultListElementsComponent
*/
export class AbstractTabulatableElementComponent<T extends PaginatedList<ListableObject>> { export class AbstractTabulatableElementComponent<T extends PaginatedList<ListableObject>> {
/** /**

View File

@@ -29,7 +29,9 @@ import { getTabulatableObjectsComponent } from './tabulatable-objects.decorator'
templateUrl: './tabulatable-objects-loader.component.html' templateUrl: './tabulatable-objects-loader.component.html'
}) })
/** /**
* Component for determining what component to use depending on the item's entity type (dspace.entity.type) * Component to load the matching component flagged by the tabulatableObjectsComponent decorator.
* Each component flagged by the decorator needs to have a ViewMode set as Table in order to be matched by the loader.
* e.g. @tabulatableObjectsComponent(PaginatedList<AdminNotifySearchResult>, ViewMode.Table, Context.CoarNotify)
*/ */
export class TabulatableObjectsLoaderComponent implements OnInit, OnChanges, OnDestroy { export class TabulatableObjectsLoaderComponent implements OnInit, OnChanges, OnDestroy {
/** /**

View File

@@ -9,4 +9,7 @@ import { SearchResult } from '../../../search/models/search-result.model';
selector: 'ds-search-result-table-element', selector: 'ds-search-result-table-element',
template: `` template: ``
}) })
/**
* Component that describes the implementations and interfaces needed from any extension of this class to be used in search results for visualization in ViewMode.Table
*/
export class TabulatableResultListElementsComponent<T extends PaginatedList<K>, K extends SearchResult<any>> extends AbstractTabulatableElementComponent<T> {} export class TabulatableResultListElementsComponent<T extends PaginatedList<K>, K extends SearchResult<any>> extends AbstractTabulatableElementComponent<T> {}

View File

@@ -19,6 +19,11 @@ import { fadeIn } from '../animations/fade';
styleUrls: ['./object-table.component.scss'], styleUrls: ['./object-table.component.scss'],
animations: [fadeIn] animations: [fadeIn]
}) })
/**
* Component used to wrap and load paginated search results if the ViewMode is set to Table.
* Each ViewMode has a different type of wrapper that can be checked in ObjectCollectionComponent
*/
export class ObjectTableComponent { export class ObjectTableComponent {
/** /**
* The view mode of this component * The view mode of this component

View File

@@ -2636,6 +2636,10 @@
"item.truncatable-part.show-less": "Collapse", "item.truncatable-part.show-less": "Collapse",
"item.qa-event-notification.check.notification-info": "There are {{num}} pending suggestions related to your account",
"item.qa-event-notification-info.check.button": "View",
"mydspace.qa-event-notification.check.notification-info": "There are {{num}} pending suggestions related to your account", "mydspace.qa-event-notification.check.notification-info": "There are {{num}} pending suggestions related to your account",
"mydspace.qa-event-notification-info.check.button": "View", "mydspace.qa-event-notification-info.check.button": "View",
@@ -6157,10 +6161,6 @@
"submission.sections.notify.info": "The selected service is compatible with the item according to its current status. {{ service.name }}: {{ service.description }}", "submission.sections.notify.info": "The selected service is compatible with the item according to its current status. {{ service.name }}: {{ service.description }}",
"item.qa-event-notification.check.notification-info": "There are {{num}} pending review to check",
"item.qa-event-notification-info.check.button": "Check",
"item.page.endorsement": "Endorsement", "item.page.endorsement": "Endorsement",
"item.page.review": "Review", "item.page.review": "Review",
@@ -6366,11 +6366,11 @@
"admin-notify-dashboard.NOTIFY.outgoing.queued_for_retry.description": "Notifications currently queued for retry", "admin-notify-dashboard.NOTIFY.outgoing.queued_for_retry.description": "Notifications currently queued for retry",
"admin-notify-dashboard.NOTIFY.incoming.involvedItems": "Involved items", "admin-notify-dashboard.NOTIFY.incoming.involvedItems": "Items involved",
"admin-notify-dashboard.NOTIFY.incoming.involvedItems.description": "Items related to inbound notifications", "admin-notify-dashboard.NOTIFY.incoming.involvedItems.description": "Items related to inbound notifications",
"admin-notify-dashboard.NOTIFY.outgoing.involvedItems": "Involved items", "admin-notify-dashboard.NOTIFY.outgoing.involvedItems": "Items involved",
"admin-notify-dashboard.NOTIFY.outgoing.involvedItems.description": "Items related to outbound notifications", "admin-notify-dashboard.NOTIFY.outgoing.involvedItems.description": "Items related to outbound notifications",