argos/dmp-frontend/src/app/app-routing.module.ts

60 lines
3.0 KiB
TypeScript
Raw Normal View History

2018-01-08 12:44:48 +01:00
import { InvitationAcceptedComponent } from './invitation-accepted/invitation-accepted.component';
2017-12-19 09:38:47 +01:00
import { UnauthorizedComponent } from './unauthorized/unauthorized.component';
2017-12-20 09:17:13 +01:00
import { NgModule } from '@angular/core';
2017-09-26 17:16:04 +02:00
import { RouterModule, Routes } from '@angular/router';
2017-12-20 09:17:13 +01:00
import { PageNotFoundComponent } from './not-found.component';
import { HomepageComponent } from './homepage/homepage.component';
2017-09-26 17:16:04 +02:00
import { DynamicFormComponent } from './form/dynamic-form.component';
import { AuthGuard } from './guards/auth.guard';
2017-11-01 18:18:27 +01:00
import { AppComponent } from './app.component';
2017-12-14 18:13:28 +01:00
import { ProjectListingModel } from './models/projects/ProjectListingModel';
import { ProjectListingComponent } from './projects/project-listing.component';
import { DataManagementPlanListingComponent } from './dmps/dmp-listing.component';
import { ProjectEditorComponent } from './projects/editor/project-editor.component';
import { DataManagementPlanEditorComponent } from './dmps/editor/dmp-editor.component';
2017-12-20 09:17:13 +01:00
import { DatasetEditorComponent } from './datasets/editor/dataset-editor.component';
import { DatasetListingComponent } from './datasets/dataset-listing.component';
import { DatasetWizardComponent } from './dataset-wizard/dataset-wizard.component';
2018-01-10 17:05:23 +01:00
import { LoginComponent } from './user-management/login/login.component';
2017-09-26 17:16:04 +02:00
const appRoutes: Routes = [
2017-12-20 09:17:13 +01:00
2017-12-06 09:58:50 +01:00
{ path: 'dynamic-form/:id', component: DynamicFormComponent, canActivate: [AuthGuard] },
2017-12-20 09:17:13 +01:00
{ path: 'projects', component: ProjectListingComponent, canActivate: [AuthGuard] },
{ path: 'project/:id', component: ProjectEditorComponent, canActivate: [AuthGuard] },
{ path: 'projects/new', component: ProjectEditorComponent, canActivate: [AuthGuard] },
{ path: 'dmps', component: DataManagementPlanListingComponent, canActivate: [AuthGuard] },
{ path: 'dmp/:id', component: DataManagementPlanEditorComponent, canActivate: [AuthGuard] },
{ path: 'dmps/new', component: DataManagementPlanEditorComponent, canActivate: [AuthGuard] },
{ path: 'datasets', component: DatasetListingComponent, canActivate: [AuthGuard] },
2018-01-17 12:57:41 +01:00
//{ path: 'dataset/new', component: DatasetWizardComponent, canActivate: [AuthGuard] },
{ path: 'dataset/new/:dmpId', component: DatasetWizardComponent, canActivate: [AuthGuard] },
2017-12-21 11:38:18 +01:00
{ path: 'dataset/:id', component: DatasetWizardComponent, canActivate: [AuthGuard] },
{ path: 'datasets/new', component: DatasetWizardComponent, canActivate: [AuthGuard] },
2018-01-08 12:44:48 +01:00
{ path: 'invitation/:id', component: InvitationAcceptedComponent},
2018-01-10 17:05:23 +01:00
{ path: 'login', loadChildren: './user-management/login.module#LoginModule' },
2017-12-20 09:17:13 +01:00
{ path: "unauthorized", loadChildren: './unauthorized/unauthorized.module#UnauthorizedModule' },
{ path: 'welcome', component: HomepageComponent, canActivate: [AuthGuard] },
{ path: '', redirectTo: '/welcome', pathMatch: 'full' },
2017-11-24 09:39:24 +01:00
2017-09-26 17:16:04 +02:00
];
@NgModule({
imports: [
RouterModule.forRoot(
appRoutes
2017-12-20 09:17:13 +01:00
, {
2017-12-05 17:56:21 +01:00
useHash: false
2017-11-07 16:06:17 +01:00
//,enableTracing: true <-- debugging purposes only
2017-12-20 09:17:13 +01:00
}
)
2017-09-26 17:16:04 +02:00
],
exports: [
RouterModule
],
providers: [
]
})
2017-11-01 18:18:27 +01:00
export class AppRoutingModule { }