argos/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.routing.ts

50 lines
1.4 KiB
TypeScript
Raw Normal View History

2023-12-28 16:18:49 +01:00
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
// import { DmpWizardComponent } from './description-wizard/description-wizard.component';
import { AppPermission } from '@app/core/common/enum/permission.enum';
import { PendingChangesGuard } from '@common/forms/pending-form-changes/pending-form-changes-guard.service';
// import { DmpOverviewComponent } from './overview/description-overview.component';
import { AuthGuard } from '@app/core/auth-guard.service';
2024-03-20 11:35:55 +01:00
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
2023-12-28 16:18:49 +01:00
import { DmpEditorComponent } from './dmp-editor.component';
2024-03-20 11:35:55 +01:00
import { DmpEditorResolver } from './dmp-editor.resolver';
2023-12-28 16:18:49 +01:00
const routes: Routes = [
{
path: '',
component: DmpEditorComponent,
canActivate: [AuthGuard],
canDeactivate: [PendingChangesGuard],
data: {
...BreadcrumbService.generateRouteDataConfiguration({
title: 'BREADCRUMBS.NEW-DMP'
}),
authContext: {
2024-03-13 16:45:25 +01:00
permissions: [AppPermission.NewDmp]
2023-12-28 16:18:49 +01:00
}
}
},
{
path: ':id',
canActivate: [AuthGuard],
component: DmpEditorComponent,
canDeactivate: [PendingChangesGuard],
resolve: {
'entity': DmpEditorResolver
},
data: {
...BreadcrumbService.generateRouteDataConfiguration({
title: 'BREADCRUMBS.EDIT-DMP'
2024-03-14 10:23:46 +01:00
})
2023-12-28 16:18:49 +01:00
}
2024-03-20 11:35:55 +01:00
}
2023-12-28 16:18:49 +01:00
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
providers: [DmpEditorResolver]
})
export class DmpEditorRoutingModule { }