102 lines
2.7 KiB
TypeScript
102 lines
2.7 KiB
TypeScript
import { NgModule } from '@angular/core';
|
|
import { RouterModule, Routes } from '@angular/router';
|
|
import { DmpBlueprintEditorComponent } from './editor/dmp-blueprint-editor.component';
|
|
import { DmpBlueprintListingComponent } from './listing/dmp-blueprint-listing.component';
|
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
|
import { AuthGuard } from '@app/core/auth-guard.service';
|
|
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
|
|
import { PendingChangesGuard } from '@common/forms/pending-form-changes/pending-form-changes-guard.service';
|
|
import { DmpBlueprintEditorResolver } from './editor/dmp-blueprint-editor.resolver';
|
|
|
|
const routes: Routes = [
|
|
{
|
|
path: '',
|
|
component: DmpBlueprintListingComponent,
|
|
canActivate: [AuthGuard]
|
|
},
|
|
{
|
|
path: 'versions/:groupid',
|
|
component: DmpBlueprintListingComponent,
|
|
canActivate: [AuthGuard],
|
|
data: {
|
|
mode: 'versions-listing'
|
|
}
|
|
},
|
|
{
|
|
path: 'new',
|
|
canActivate: [AuthGuard],
|
|
component: DmpBlueprintEditorComponent,
|
|
canDeactivate: [PendingChangesGuard],
|
|
data: {
|
|
authContext: {
|
|
permissions: [AppPermission.EditDmpBlueprint]
|
|
},
|
|
...BreadcrumbService.generateRouteDataConfiguration({
|
|
title: 'BREADCRUMBS.NEW-DMP-BLUEPRINT'
|
|
})
|
|
}
|
|
},
|
|
{
|
|
path: 'clone/:cloneid',
|
|
canActivate: [AuthGuard],
|
|
component: DmpBlueprintEditorComponent,
|
|
canDeactivate: [PendingChangesGuard],
|
|
resolve: {
|
|
'entity': DmpBlueprintEditorResolver
|
|
},
|
|
data: {
|
|
...BreadcrumbService.generateRouteDataConfiguration({
|
|
title: 'BREADCRUMBS.EDIT-DMP-BLUEPRINT'
|
|
}),
|
|
authContext: {
|
|
permissions: [AppPermission.EditDmpBlueprint]
|
|
},
|
|
action: 'clone'
|
|
}
|
|
},
|
|
{
|
|
path: 'new-version/:newversionid',
|
|
canActivate: [AuthGuard],
|
|
component: DmpBlueprintEditorComponent,
|
|
canDeactivate: [PendingChangesGuard],
|
|
resolve: {
|
|
'entity': DmpBlueprintEditorResolver
|
|
},
|
|
data: {
|
|
...BreadcrumbService.generateRouteDataConfiguration({
|
|
title: 'BREADCRUMBS.EDIT-DMP-BLUEPRINT'
|
|
}),
|
|
authContext: {
|
|
permissions: [AppPermission.EditDmpBlueprint]
|
|
},
|
|
action: 'new-version'
|
|
}
|
|
},
|
|
{
|
|
path: ':id',
|
|
canActivate: [AuthGuard],
|
|
component: DmpBlueprintEditorComponent,
|
|
canDeactivate: [PendingChangesGuard],
|
|
resolve: {
|
|
'entity': DmpBlueprintEditorResolver
|
|
},
|
|
data: {
|
|
...BreadcrumbService.generateRouteDataConfiguration({
|
|
title: 'BREADCRUMBS.EDIT-DMP-BLUEPRINT'
|
|
}),
|
|
authContext: {
|
|
permissions: [AppPermission.EditDmpBlueprint]
|
|
}
|
|
}
|
|
|
|
},
|
|
{ path: '**', loadChildren: () => import('@common/modules/page-not-found/page-not-found.module').then(m => m.PageNotFoundModule) },
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [RouterModule.forChild(routes)],
|
|
exports: [RouterModule],
|
|
providers: [DmpBlueprintEditorResolver]
|
|
})
|
|
export class DmpBlueprintRoutingModule { }
|