import { InvitationAcceptedComponent } from './invitation-accepted/invitation-accepted.component'; import { UnauthorizedComponent } from './unauthorized/unauthorized.component'; import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { PageNotFoundComponent } from './not-found.component'; import { HomepageComponent } from './homepage/homepage.component'; import { DynamicFormComponent } from './form/dynamic-form.component'; import { AuthGuard } from './guards/auth.guard'; import { AppComponent } from './app.component'; 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'; import { DatasetEditorComponent } from './datasets/editor/dataset-editor.component'; import { DatasetListingComponent } from './datasets/dataset-listing.component'; import { DatasetWizardComponent } from './dataset-wizard/dataset-wizard.component'; import { LoginComponent } from './user-management/login/login.component'; const appRoutes: Routes = [ { path: 'dynamic-form/:id', component: DynamicFormComponent, canActivate: [AuthGuard] }, { 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: 'dmp/:id/new_version', component: DataManagementPlanEditorComponent, canActivate: [AuthGuard], data:{clone:"clone"} }, { path: 'dmps/new', component: DataManagementPlanEditorComponent, canActivate: [AuthGuard] }, { path: 'datasets', component: DatasetListingComponent, canActivate: [AuthGuard] }, //{ path: 'dataset/new', component: DatasetWizardComponent, canActivate: [AuthGuard] }, { path: 'dataset/new/:dmpId', component: DatasetWizardComponent, canActivate: [AuthGuard] }, { path: 'dataset/:id', component: DatasetWizardComponent, canActivate: [AuthGuard] }, { path: 'datasets/new', component: DatasetWizardComponent, canActivate: [AuthGuard] }, { path: 'datasets/:dmpId', component: DatasetListingComponent, canActivate: [AuthGuard] }, { path: 'invitation/:id', component: InvitationAcceptedComponent}, { path: 'login', loadChildren: './user-management/login.module#LoginModule' }, { path: "unauthorized", loadChildren: './unauthorized/unauthorized.module#UnauthorizedModule' }, { path: 'welcome', component: HomepageComponent, canActivate: [AuthGuard] }, { path: '', redirectTo: '/welcome', pathMatch: 'full' }, ]; @NgModule({ imports: [ RouterModule.forRoot( appRoutes , { useHash: false //,enableTracing: true <-- debugging purposes only } ) ], exports: [ RouterModule ], providers: [ ] }) export class AppRoutingModule { }