[umbrella]: Update library and theme. Add monitor.ts with routes for dashboard-style routing modules
This commit is contained in:
parent
6da63f1e53
commit
fe05d257fa
|
@ -1,89 +1,24 @@
|
|||
import {NgModule} from '@angular/core';
|
||||
import {RouterModule} from '@angular/router';
|
||||
import {RouterModule, Routes} from '@angular/router';
|
||||
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {MonitorComponent} from "./monitor.component";
|
||||
import {OpenaireErrorPageComponent} from "../error/errorPage.component";
|
||||
import {Monitor} from "./monitor";
|
||||
|
||||
let routes: Routes = new Monitor(':stakeholder').routes;
|
||||
routes.splice(0, 0, {path: '', redirectTo: '/admin', pathMatch: 'full'});
|
||||
/*routes.splice(2, 0, {
|
||||
path: ':stakeholder/browse/:type',
|
||||
loadChildren: () => import('../browse-stakeholders/browse-stakeholders.module').then(m => m.BrowseStakeholdersModule),
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
activeMenuItem: "dashboard"
|
||||
}
|
||||
});*/
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{path: '', redirectTo: '/admin', pathMatch: 'full'},
|
||||
{
|
||||
path: ':stakeholder',
|
||||
component: MonitorComponent,
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
activeMenuItem: "dashboard"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':stakeholder/indicators',
|
||||
loadChildren: () => import('../openaireLibrary/monitor/indicators/indicators.module').then(m => m.IndicatorsModule),
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
hasSidebar: false
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':stakeholder/develop',
|
||||
loadChildren: () => import('../develop/develop.module').then(m => m.DevelopModule),
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
hasSidebar: false
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':stakeholder/methodology',
|
||||
loadChildren: () => import('../openaireLibrary/monitor/methodology/methodology.module').then(m => m.MethodologyModule),
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
hasSidebar: false
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':stakeholder/search',
|
||||
loadChildren: () => import('../search/search.module').then(m => m.SearchModule),
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
hasSidebar: false,
|
||||
activeMenuItem: "search"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':stakeholder/error',
|
||||
component: OpenaireErrorPageComponent,
|
||||
data: {hasSidebar: false}
|
||||
},
|
||||
{
|
||||
path: ':stakeholder/user-info',
|
||||
loadChildren: () => import('../login/libUser.module').then(m => m.LibUserModule),
|
||||
data: {hasSidebar: false}
|
||||
},
|
||||
{
|
||||
path: ':stakeholder/:topic',
|
||||
component: MonitorComponent,
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
activeMenuItem: "dashboard"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':stakeholder/:topic/:category',
|
||||
component: MonitorComponent,
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
activeMenuItem: "dashboard"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':stakeholder/:topic/:category/:subCategory',
|
||||
component: MonitorComponent,
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
activeMenuItem: "dashboard"
|
||||
}
|
||||
}
|
||||
])
|
||||
RouterModule.forChild(routes)
|
||||
]
|
||||
})
|
||||
export class MonitorRoutingModule {
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
import {Routes} from "@angular/router";
|
||||
import {MonitorComponent} from "./monitor.component";
|
||||
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
|
||||
import {OpenaireErrorPageComponent} from "../error/errorPage.component";
|
||||
|
||||
export class Monitor {
|
||||
routes: Routes;
|
||||
|
||||
constructor(param: ':stakeholder' | ':child') {
|
||||
this.routes = [
|
||||
{
|
||||
path: param,
|
||||
component: MonitorComponent,
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
activeMenuItem: "dashboard"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: param + '/indicators',
|
||||
loadChildren: () => import('../openaireLibrary/monitor/indicators/indicators.module').then(m => m.IndicatorsModule),
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
hasSidebar: false
|
||||
}
|
||||
},
|
||||
{
|
||||
path: param + '/develop',
|
||||
loadChildren: () => import('../develop/develop.module').then(m => m.DevelopModule),
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
hasSidebar: false
|
||||
}
|
||||
},
|
||||
{
|
||||
path: param + '/methodology',
|
||||
loadChildren: () => import('../openaireLibrary/monitor/methodology/methodology.module').then(m => m.MethodologyModule),
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
hasSidebar: false
|
||||
}
|
||||
},
|
||||
{
|
||||
path: param + '/search',
|
||||
loadChildren: () => import('../search/search.module').then(m => m.SearchModule),
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
hasSidebar: false,
|
||||
activeMenuItem: param === ':stakeholder'?"search":'dashboard'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: param + '/error',
|
||||
component: OpenaireErrorPageComponent,
|
||||
data: {hasSidebar: false}
|
||||
},
|
||||
{
|
||||
path: param + '/user-info',
|
||||
loadChildren: () => import('../login/libUser.module').then(m => m.LibUserModule),
|
||||
data: {hasSidebar: false}
|
||||
},
|
||||
{
|
||||
path: param + '/:topic',
|
||||
component: MonitorComponent,
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
activeMenuItem: "dashboard"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: param + '/:topic/:category',
|
||||
component: MonitorComponent,
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
activeMenuItem: "dashboard"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: param + '/:topic/:category/:subCategory',
|
||||
component: MonitorComponent,
|
||||
canDeactivate: [PreviousRouteRecorder],
|
||||
data: {
|
||||
activeMenuItem: "dashboard"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
Subproject commit 8774a79230f2ca9b8955e62726bb453b9719a64f
|
||||
Subproject commit a1c8b2d9fe0b4f227235e5867c83b5f523154f5b
|
|
@ -1 +1 @@
|
|||
Subproject commit fe10d2e9195fdebf3d906f28abbb072f3617c4ee
|
||||
Subproject commit fdbb44cd21351f99af6c8341b5e43dec2b1d9eea
|
Loading…
Reference in New Issue