mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
add components, refactor sidebar section, add config
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service';
|
||||
import { AuthenticatedGuard } from "../../core/auth/authenticated.guard";
|
||||
import { AdminNotifyDashboardComponent } from "./admin-notify-dashboard.component";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{
|
||||
canActivate: [ AuthenticatedGuard ],
|
||||
path: '',
|
||||
component: AdminNotifyDashboardComponent,
|
||||
pathMatch: 'full',
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
data: {
|
||||
title: 'admin.notify.dashboard.page.title',
|
||||
breadcrumbKey: 'admin.notify.dashboard',
|
||||
showBreadcrumbsFluid: false
|
||||
}
|
||||
},
|
||||
])
|
||||
],
|
||||
providers: [
|
||||
I18nBreadcrumbResolver,
|
||||
I18nBreadcrumbsService,
|
||||
]
|
||||
})
|
||||
/**
|
||||
* Routing module for the Notifications section of the admin sidebar
|
||||
*/
|
||||
export class AdminNotifyDashboardRoutingModule {
|
||||
|
||||
}
|
@@ -1 +1,28 @@
|
||||
<p>admin-notify-dashboard works!</p>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2 class="border-bottom pb-2">{{'admin-notify-dashboard.title'| translate}}</h2>
|
||||
<div>
|
||||
<ul ngbNav #nav="ngbNav" [activeId]="'metrics'" class="nav-tabs">
|
||||
<li [ngbNavItem]="'metrics'">
|
||||
<a ngbNavLink>{{'admin-notify-dashboard.metrics' | translate}}</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div id="metrics">
|
||||
<ds-admin-notify-metrics></ds-admin-notify-metrics>
|
||||
</div>
|
||||
</ng-template>
|
||||
</li>
|
||||
<li [ngbNavItem]="'logs'">
|
||||
<a ngbNavLink>{{'admin-notify-dashboard.logs' | translate}}</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div id="logs">
|
||||
<ds-admin-notify-logs></ds-admin-notify-logs>
|
||||
</div>
|
||||
</ng-template>
|
||||
</li>
|
||||
</ul>
|
||||
<div [ngbNavOutlet]="nav" class="mt-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -0,0 +1,25 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { SharedModule } from '../../shared/shared.module';
|
||||
import { AdminNotifyDashboardComponent } from "./admin-notify-dashboard.component";
|
||||
import { AdminNotifyDashboardRoutingModule } from "./admin-notify-dashboard-routing.module";
|
||||
import { AdminNotifyMetricsComponent } from './admin-notify-metrics/admin-notify-metrics.component';
|
||||
import { AdminNotifyLogsComponent } from './admin-notify-logs/admin-notify-logs.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
SharedModule,
|
||||
RouterModule,
|
||||
AdminNotifyDashboardRoutingModule,
|
||||
],
|
||||
declarations: [
|
||||
AdminNotifyDashboardComponent,
|
||||
AdminNotifyMetricsComponent,
|
||||
AdminNotifyLogsComponent
|
||||
]
|
||||
})
|
||||
export class AdminNotifyDashboardModule {
|
||||
|
||||
}
|
@@ -0,0 +1 @@
|
||||
<p>admin-notify-logs works!</p>
|
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AdminNotifyLogsComponent } from './admin-notify-logs.component';
|
||||
|
||||
describe('AdminNotifyLogsComponent', () => {
|
||||
let component: AdminNotifyLogsComponent;
|
||||
let fixture: ComponentFixture<AdminNotifyLogsComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ AdminNotifyLogsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AdminNotifyLogsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-logs',
|
||||
templateUrl: './admin-notify-logs.component.html',
|
||||
styleUrls: ['./admin-notify-logs.component.scss']
|
||||
})
|
||||
export class AdminNotifyLogsComponent {
|
||||
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
<div class="container-fluid">
|
||||
<div *ngFor="let rows of boxesConfig">
|
||||
<div *ngFor="let box of rows.boxes">
|
||||
<div [ngStyle]="{'background-color': box.color}">
|
||||
<!--Here will go the actual count coming from the REST endpoint -->
|
||||
<div>0</div>
|
||||
<div>{{ box.title | translate }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AdminNotifyMetricsComponent } from './admin-notify-metrics.component';
|
||||
|
||||
describe('AdminNotifyMetricsComponent', () => {
|
||||
let component: AdminNotifyMetricsComponent;
|
||||
let fixture: ComponentFixture<AdminNotifyMetricsComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ AdminNotifyMetricsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AdminNotifyMetricsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,13 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { AdminNotifyMetricsRow } from "./admin-notify-metrics.model";
|
||||
import { AdminNotifyMetricsRowsConfig } from "./admin-notify-metrics.config";
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-metrics',
|
||||
templateUrl: './admin-notify-metrics.component.html',
|
||||
styleUrls: ['./admin-notify-metrics.component.scss']
|
||||
})
|
||||
export class AdminNotifyMetricsComponent {
|
||||
|
||||
boxesConfig: AdminNotifyMetricsRow[] = AdminNotifyMetricsRowsConfig;
|
||||
}
|
@@ -0,0 +1,64 @@
|
||||
import { AdminNotifyMetricsRow } from "./admin-notify-metrics.model";
|
||||
|
||||
export const AdminNotifyMetricsRowsConfig: AdminNotifyMetricsRow[] = [
|
||||
{
|
||||
title: 'Number of received LDN',
|
||||
boxes: [
|
||||
{
|
||||
color: 'blue',
|
||||
title: 'Accepted',
|
||||
index: 0
|
||||
},
|
||||
{
|
||||
color: 'green',
|
||||
title: 'Processed LDN',
|
||||
index: 1
|
||||
},
|
||||
{
|
||||
color: 'red',
|
||||
title: 'Failure',
|
||||
index: 2
|
||||
},
|
||||
{
|
||||
color: 'red',
|
||||
title: 'Untrusted',
|
||||
index: 3
|
||||
},
|
||||
{
|
||||
color: 'grey',
|
||||
title: 'Incoming LDM messages',
|
||||
index: 4
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'Number of generated LDN',
|
||||
boxes: [
|
||||
{
|
||||
color: 'green',
|
||||
title: 'Delivered',
|
||||
index: 0
|
||||
},
|
||||
{
|
||||
color: 'blue',
|
||||
title: 'Queued',
|
||||
index: 1
|
||||
},
|
||||
{
|
||||
color: 'yellow',
|
||||
title: 'Queued for retry',
|
||||
index: 2
|
||||
},
|
||||
{
|
||||
color: 'red',
|
||||
title: 'Failure',
|
||||
index: 3
|
||||
},
|
||||
{
|
||||
color: 'grey',
|
||||
title: 'Outgoing LDM messages',
|
||||
index: 4
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
@@ -0,0 +1,10 @@
|
||||
export interface AdminNotifyMetricsBox {
|
||||
color: string;
|
||||
title: string;
|
||||
index: number
|
||||
}
|
||||
|
||||
export interface AdminNotifyMetricsRow {
|
||||
title: string;
|
||||
boxes: AdminNotifyMetricsBox[]
|
||||
}
|
@@ -4,6 +4,8 @@ import { getAdminModuleRoute } from '../app-routing-paths';
|
||||
export const REGISTRIES_MODULE_PATH = 'registries';
|
||||
export const NOTIFICATIONS_MODULE_PATH = 'notifications';
|
||||
|
||||
export const NOTIFY_DASHBOARD_MODULE_PATH = 'notify-dashboard';
|
||||
|
||||
export const LDN_PATH = 'ldn';
|
||||
|
||||
export function getRegistriesModuleRoute() {
|
||||
@@ -13,7 +15,6 @@ export function getRegistriesModuleRoute() {
|
||||
export function getNotificationsModuleRoute() {
|
||||
return new URLCombiner(getAdminModuleRoute(), NOTIFICATIONS_MODULE_PATH).toString();
|
||||
}
|
||||
|
||||
export function getLdnServicesModuleRoute() {
|
||||
return new URLCombiner(getAdminModuleRoute(), LDN_PATH).toString();
|
||||
}
|
||||
|
@@ -6,7 +6,12 @@ import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.reso
|
||||
import { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow-page.component';
|
||||
import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service';
|
||||
import { AdminCurationTasksComponent } from './admin-curation-tasks/admin-curation-tasks.component';
|
||||
import { LDN_PATH, REGISTRIES_MODULE_PATH, NOTIFICATIONS_MODULE_PATH } from './admin-routing-paths';
|
||||
import {
|
||||
LDN_PATH,
|
||||
REGISTRIES_MODULE_PATH,
|
||||
NOTIFICATIONS_MODULE_PATH,
|
||||
NOTIFY_DASHBOARD_MODULE_PATH
|
||||
} from './admin-routing-paths';
|
||||
import { BatchImportPageComponent } from './admin-import-batch-page/batch-import-page.component';
|
||||
import { AdminNotifyDashboardComponent } from "./admin-notify-dashboard/admin-notify-dashboard.component";
|
||||
|
||||
@@ -71,10 +76,9 @@ import { AdminNotifyDashboardComponent } from "./admin-notify-dashboard/admin-no
|
||||
data: {title: 'admin.system-wide-alert.title', breadcrumbKey: 'admin.system-wide-alert'}
|
||||
},
|
||||
{
|
||||
path: 'notify-dashboard',
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
component: AdminNotifyDashboardComponent,
|
||||
data: {title: 'todo', breadcrumbKey: 'todo'}
|
||||
path: NOTIFY_DASHBOARD_MODULE_PATH,
|
||||
loadChildren: () => import('./admin-notify-dashboard/admin-notify-dashboard.module')
|
||||
.then((m) => m.AdminNotifyDashboardModule),
|
||||
},
|
||||
]),
|
||||
],
|
||||
|
@@ -12,7 +12,6 @@ import { ExpandableAdminSidebarSectionComponent } from './admin-sidebar/expandab
|
||||
import { BatchImportPageComponent } from './admin-import-batch-page/batch-import-page.component';
|
||||
import { UiSwitchModule } from 'ngx-ui-switch';
|
||||
import { UploadModule } from '../shared/upload/upload.module';
|
||||
import { AdminNotifyDashboardComponent } from './admin-notify-dashboard/admin-notify-dashboard.component';
|
||||
|
||||
const ENTRY_COMPONENTS = [
|
||||
// put only entry components that use custom decorator
|
||||
@@ -36,7 +35,6 @@ const ENTRY_COMPONENTS = [
|
||||
AdminCurationTasksComponent,
|
||||
MetadataImportPageComponent,
|
||||
BatchImportPageComponent,
|
||||
AdminNotifyDashboardComponent
|
||||
]
|
||||
})
|
||||
export class AdminModule {
|
||||
|
@@ -362,19 +362,6 @@ export class MenuResolver implements Resolve<boolean> {
|
||||
icon: 'terminal',
|
||||
index: 10
|
||||
},
|
||||
/* LDN Services */
|
||||
{
|
||||
id: 'ldn_services',
|
||||
active: false,
|
||||
visible: isSiteAdmin,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.services',
|
||||
link: '/admin/ldn/services'
|
||||
} as LinkMenuItemModel,
|
||||
icon: 'inbox',
|
||||
index: 14
|
||||
},
|
||||
{
|
||||
id: 'health',
|
||||
active: false,
|
||||
@@ -679,17 +666,40 @@ export class MenuResolver implements Resolve<boolean> {
|
||||
icon: 'exclamation-circle',
|
||||
index: 12
|
||||
},
|
||||
/* COAR Notify section */
|
||||
{
|
||||
id: 'notify_dashboard',
|
||||
id: 'coar_notify',
|
||||
active: false,
|
||||
visible: authorized,
|
||||
model: {
|
||||
type: MenuItemType.TEXT,
|
||||
text: 'menu.section.coar_notify'
|
||||
} as TextMenuItemModel,
|
||||
icon: 'inbox',
|
||||
index: 13
|
||||
},
|
||||
{
|
||||
id: 'notify_dashboard',
|
||||
active: false,
|
||||
parentID: 'coar_notify',
|
||||
visible: authorized,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.notify-dashboard',
|
||||
text: 'menu.section.notify_dashboard',
|
||||
link: '/admin/notify-dashboard'
|
||||
} as LinkMenuItemModel,
|
||||
icon: 'gauge',
|
||||
index: 13
|
||||
},
|
||||
/* LDN Services */
|
||||
{
|
||||
id: 'ldn_services',
|
||||
active: false,
|
||||
parentID: 'coar_notify',
|
||||
visible: authorized,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.services',
|
||||
link: '/admin/ldn/services'
|
||||
} as LinkMenuItemModel,
|
||||
},
|
||||
];
|
||||
|
||||
|
@@ -28,6 +28,8 @@
|
||||
|
||||
"admin.notifications.recitersuggestion.page.title": "Suggestions",
|
||||
|
||||
"admin.notify.dashboard": "Dashboard",
|
||||
|
||||
"error-page.description.401": "unauthorized",
|
||||
|
||||
"error-page.description.403": "forbidden",
|
||||
@@ -3075,7 +3077,9 @@
|
||||
|
||||
"menu.section.icon.export": "Export menu section",
|
||||
|
||||
"menu.section.notify-dashboard": "Notify Dashboard",
|
||||
"menu.section.notify_dashboard": "Dashboard",
|
||||
|
||||
"menu.section.coar_notify": "COAR Notify",
|
||||
|
||||
"menu.section.icon.find": "Find menu section",
|
||||
|
||||
@@ -3439,6 +3443,14 @@
|
||||
|
||||
"quality-assurance.event.reason": "Reason",
|
||||
|
||||
"admin-notify-dashboard.title": "Notify Dashboard",
|
||||
|
||||
"admin-notify-dashboard.metrics": "Notify metrics",
|
||||
|
||||
"admin-notify-dashboard.logs": "Notify logs",
|
||||
|
||||
"admin.notify.dashboard.breadcrumbs": "Dashboard",
|
||||
|
||||
"orgunit.listelement.badge": "Organizational Unit",
|
||||
|
||||
"orgunit.listelement.no-title": "Untitled",
|
||||
|
Reference in New Issue
Block a user