mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 18:44:14 +00:00
update config and integrate rest
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<a ngbNavLink>{{'admin-notify-dashboard.metrics' | translate}}</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div id="metrics">
|
||||
<ds-admin-notify-metrics></ds-admin-notify-metrics>
|
||||
<ds-admin-notify-metrics [boxesConfig]="metricsConfig"></ds-admin-notify-metrics>
|
||||
</div>
|
||||
</ng-template>
|
||||
</li>
|
||||
|
@@ -1,47 +1,35 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { SearchConfigurationService } from "../../core/shared/search/search-configuration.service";
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { SearchService } from "../../core/shared/search/search.service";
|
||||
import { environment } from "../../../environments/environment";
|
||||
import { PaginatedSearchOptions } from "../../shared/search/models/paginated-search-options.model";
|
||||
import { SEARCH_CONFIG_SERVICE } from "../../my-dspace-page/my-dspace-page.component";
|
||||
import { PaginationComponentOptions } from "../../shared/pagination/pagination-component-options.model";
|
||||
import { SearchFilterConfig } from "../../shared/search/models/search-filter-config.model";
|
||||
import { concatAll, concatWith, flatMap, forkJoin, from, mergeAll, switchMap } from "rxjs";
|
||||
import { concat, delay } from "rxjs/operators";
|
||||
import { getFirstSucceededRemoteData } from "../../core/shared/operators";
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-dashboard',
|
||||
templateUrl: './admin-notify-dashboard.component.html',
|
||||
styleUrls: ['./admin-notify-dashboard.component.scss'],
|
||||
providers: [
|
||||
{
|
||||
provide: SEARCH_CONFIG_SERVICE,
|
||||
useClass: SearchConfigurationService
|
||||
}
|
||||
]
|
||||
})
|
||||
export class AdminNotifyDashboardComponent implements OnInit{
|
||||
mockFilterConfig : SearchFilterConfig = Object.assign(new SearchFilterConfig(), {
|
||||
type: {
|
||||
value: "discovery-filter"
|
||||
},
|
||||
pageSize: 10,
|
||||
name: "author",
|
||||
filterType: "text",
|
||||
_links: {
|
||||
self: {
|
||||
href: "https://dspace-coar.4science.cloud/server/api/discover/facets/author"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mockPaginatedSearchOptions = new PaginatedSearchOptions({
|
||||
pagination: Object.assign(new PaginationComponentOptions(), { id: 'page-id', currentPage: 1, pageSize: 20 }),
|
||||
configuration: '',
|
||||
metricsConfig = environment.notifyMetrics;
|
||||
private singleResultOptions = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'single-result-options',
|
||||
pageSize: 1
|
||||
});
|
||||
|
||||
constructor(private searchService: SearchService,
|
||||
@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
|
||||
) {}
|
||||
constructor(private searchService: SearchService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.searchService.getFacetValuesFor(this.mockFilterConfig, 1, this.mockPaginatedSearchOptions).subscribe(c => console.log(c))
|
||||
const discoveryConfigurations = this.metricsConfig
|
||||
.map(row => row.boxes)
|
||||
.map(boxes => boxes.map(box => box.config).filter(config => !!config));
|
||||
const mergedConfigurations = discoveryConfigurations[0].concat(discoveryConfigurations[1]);
|
||||
const searchConfigurations = mergedConfigurations
|
||||
.map(config => Object.assign(new PaginatedSearchOptions({}),
|
||||
{ configuration: config, pagination: this.singleResultOptions }
|
||||
));
|
||||
// TODO: check for search completion before executing next one
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { AdminNotifyMetricsRow } from './admin-notify-metrics.model';
|
||||
import { AdminNotifyMetricsRowsConfig } from './admin-notify-metrics.config';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-metrics',
|
||||
@@ -9,5 +8,6 @@ import { AdminNotifyMetricsRowsConfig } from './admin-notify-metrics.config';
|
||||
})
|
||||
export class AdminNotifyMetricsComponent {
|
||||
|
||||
boxesConfig: AdminNotifyMetricsRow[] = AdminNotifyMetricsRowsConfig;
|
||||
@Input()
|
||||
boxesConfig: AdminNotifyMetricsRow[];
|
||||
}
|
||||
|
@@ -1,56 +0,0 @@
|
||||
import { AdminNotifyMetricsRow } from './admin-notify-metrics.model';
|
||||
|
||||
export const AdminNotifyMetricsRowsConfig: AdminNotifyMetricsRow[] = [
|
||||
{
|
||||
title: 'Number of received LDN',
|
||||
boxes: [
|
||||
{
|
||||
color: '#B8DAFF',
|
||||
title: 'Accepted',
|
||||
},
|
||||
{
|
||||
color: '#D4EDDA',
|
||||
title: 'Processed LDN',
|
||||
},
|
||||
{
|
||||
color: '#FDBBC7',
|
||||
title: 'Failure',
|
||||
},
|
||||
{
|
||||
color: '#FDBBC7',
|
||||
title: 'Untrusted',
|
||||
},
|
||||
{
|
||||
color: '#43515F',
|
||||
title: 'Incoming LDM messages',
|
||||
textColor: '#fff'
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'Number of generated LDN',
|
||||
boxes: [
|
||||
{
|
||||
color: '#D4EDDA',
|
||||
title: 'Delivered',
|
||||
},
|
||||
{
|
||||
color: '#B8DAFF',
|
||||
title: 'Queued',
|
||||
},
|
||||
{
|
||||
color: '#FDEEBB',
|
||||
title: 'Queued for retry',
|
||||
},
|
||||
{
|
||||
color: '#FDBBC7',
|
||||
title: 'Failure',
|
||||
},
|
||||
{
|
||||
color: '#43515F',
|
||||
title: 'Outgoing LDM messages',
|
||||
textColor: '#fff'
|
||||
},
|
||||
]
|
||||
}
|
||||
];
|
@@ -2,6 +2,7 @@ export interface AdminNotifyMetricsBox {
|
||||
color: string;
|
||||
textColor?: string;
|
||||
title: string;
|
||||
config: string;
|
||||
count?: number
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,9 @@ import { HomeConfig } from './homepage-config.interface';
|
||||
import { MarkdownConfig } from './markdown-config.interface';
|
||||
import { FilterVocabularyConfig } from './filter-vocabulary-config';
|
||||
import { DiscoverySortConfig } from './discovery-sort.config';
|
||||
import {
|
||||
AdminNotifyMetricsRow
|
||||
} from "../app/admin/admin-notify-dashboard/admin-notify-metrics/admin-notify-metrics.model";
|
||||
|
||||
interface AppConfig extends Config {
|
||||
ui: UIServerConfig;
|
||||
@@ -50,6 +53,7 @@ interface AppConfig extends Config {
|
||||
markdown: MarkdownConfig;
|
||||
vocabularies: FilterVocabularyConfig[];
|
||||
comcolSelectionSort: DiscoverySortConfig;
|
||||
notifyMetrics: AdminNotifyMetricsRow[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -23,6 +23,9 @@ import { HomeConfig } from './homepage-config.interface';
|
||||
import { MarkdownConfig } from './markdown-config.interface';
|
||||
import { FilterVocabularyConfig } from './filter-vocabulary-config';
|
||||
import { DiscoverySortConfig } from './discovery-sort.config';
|
||||
import {
|
||||
AdminNotifyMetricsRow
|
||||
} from "../app/admin/admin-notify-dashboard/admin-notify-metrics/admin-notify-metrics.model";
|
||||
|
||||
export class DefaultAppConfig implements AppConfig {
|
||||
production = false;
|
||||
@@ -443,4 +446,69 @@ export class DefaultAppConfig implements AppConfig {
|
||||
sortField:'dc.title',
|
||||
sortDirection:'ASC',
|
||||
};
|
||||
|
||||
notifyMetrics: AdminNotifyMetricsRow[] = [
|
||||
{
|
||||
title: 'Number of received LDN',
|
||||
boxes: [
|
||||
{
|
||||
color: '#B8DAFF',
|
||||
title: 'Accepted',
|
||||
config: 'NOTIFY.incoming.accepted'
|
||||
},
|
||||
{
|
||||
color: '#D4EDDA',
|
||||
title: 'Processed LDN',
|
||||
config: 'NOTIFY.incoming.processed'
|
||||
},
|
||||
{
|
||||
color: '#FDBBC7',
|
||||
title: 'Failure',
|
||||
config: 'NOTIFY.incoming.failure'
|
||||
},
|
||||
{
|
||||
color: '#FDBBC7',
|
||||
title: 'Untrusted',
|
||||
config: 'NOTIFY.incoming.untrusted'
|
||||
},
|
||||
{
|
||||
color: '#43515F',
|
||||
title: 'Involved items',
|
||||
textColor: '#fff',
|
||||
config: ''
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'Number of generated LDN',
|
||||
boxes: [
|
||||
{
|
||||
color: '#D4EDDA',
|
||||
title: 'Delivered',
|
||||
config: 'NOTIFY.outgoing.delivered'
|
||||
},
|
||||
{
|
||||
color: '#B8DAFF',
|
||||
title: 'Queued',
|
||||
config: 'NOTIFY.outgoing.queued'
|
||||
},
|
||||
{
|
||||
color: '#FDEEBB',
|
||||
title: 'Queued for retry',
|
||||
config: 'NOTIFY.outgoing.queued_for_retry'
|
||||
},
|
||||
{
|
||||
color: '#FDBBC7',
|
||||
title: 'Failure',
|
||||
config: 'NOTIFY.outgoing.failure'
|
||||
},
|
||||
{
|
||||
color: '#43515F',
|
||||
title: 'Involved items',
|
||||
textColor: '#fff',
|
||||
config: ''
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -317,5 +317,70 @@ export const environment: BuildConfig = {
|
||||
vocabulary: 'srsc',
|
||||
enabled: true
|
||||
}
|
||||
],
|
||||
|
||||
notifyMetrics: [
|
||||
{
|
||||
title: 'Number of received LDN',
|
||||
boxes: [
|
||||
{
|
||||
color: '#B8DAFF',
|
||||
title: 'Accepted',
|
||||
config: 'NOTIFY.incoming.accepted'
|
||||
},
|
||||
{
|
||||
color: '#D4EDDA',
|
||||
title: 'Processed LDN',
|
||||
config: 'NOTIFY.incoming.processed'
|
||||
},
|
||||
{
|
||||
color: '#FDBBC7',
|
||||
title: 'Failure',
|
||||
config: 'NOTIFY.incoming.failure'
|
||||
},
|
||||
{
|
||||
color: '#FDBBC7',
|
||||
title: 'Untrusted',
|
||||
config: 'NOTIFY.incoming.untrusted'
|
||||
},
|
||||
{
|
||||
color: '#43515F',
|
||||
title: 'Incoming LDM messages',
|
||||
textColor: '#fff',
|
||||
config: ''
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'Number of generated LDN',
|
||||
boxes: [
|
||||
{
|
||||
color: '#D4EDDA',
|
||||
title: 'Delivered',
|
||||
config: 'NOTIFY.outgoing.delivered'
|
||||
},
|
||||
{
|
||||
color: '#B8DAFF',
|
||||
title: 'Queued',
|
||||
config: 'NOTIFY.outgoing.queued'
|
||||
},
|
||||
{
|
||||
color: '#FDEEBB',
|
||||
title: 'Queued for retry',
|
||||
config: 'NOTIFY.outgoing.queued_for_retry'
|
||||
},
|
||||
{
|
||||
color: '#FDBBC7',
|
||||
title: 'Failure',
|
||||
config: 'NOTIFY.outgoing.failure'
|
||||
},
|
||||
{
|
||||
color: '#43515F',
|
||||
title: 'Outgoing LDM messages',
|
||||
textColor: '#fff',
|
||||
config: ''
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
Reference in New Issue
Block a user