argos/dmp-admin/src/app/routes.ts

74 lines
2.2 KiB
TypeScript

import { FormComponent } from './dataset-profile-form/form/form.component';
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { GooggleSignInComponent } from './login/googgle-sign-in/googgle-sign-in.component';
import { DatasetsViewerComponent } from './datasets-viewer/datasets-viewer.component';
import { ProfileEditorComponent } from './bootstrap/profile-editor/profile-editor.component';
import { DmpProfileEditorComponent } from './managers/dmp-profile-editor/dmp-profile-editor.component';
import { DatasetprofileEditorComponent } from './managers/datasetprofile-editor/datasetprofile-editor.component';
import { MainWindowComponent } from './main-window/main-window.component';
import { NgModule } from '@angular/core';
import { AuthGuard } from './guards/auth.guard';
import { AppComponent } from 'app/app.component';
import { MainSignInComponent } from 'app/login/main-sign-in/main-sign-in.component';
import { UnauthorizedComponent } from './unauthorized/unauthorized.component';
// Route Configuration
const routes: Routes = [
{
path: '',
redirectTo: '/main',
pathMatch: 'full'
},
{
path: 'app-root',
component: AppComponent,
canActivate: [AuthGuard]
},
{
path: 'datasets',
component: DatasetsViewerComponent,
canActivate: [AuthGuard]
},
{
path: 'datasetprofiles',
component: DatasetprofileEditorComponent,
canActivate: [AuthGuard]
},
{
path: 'datasets/profile',
component: ProfileEditorComponent,
canActivate: [AuthGuard]
//,data: { title: 'a title' }
},
{
path: 'main',
component: MainWindowComponent,
canActivate: [AuthGuard]
},
{ path: 'form', loadChildren: './dataset-profile-form/dataset-profile.module#DatasetProfileModule', canActivate: [AuthGuard]},
{ path: "unauthorized", loadChildren: './unauthorized/unauthorized.module#UnauthorizedModule' } ,
{ path: "login", component: MainSignInComponent }
];
@NgModule({
imports: [
RouterModule.forRoot(
routes
)
],
exports: [
RouterModule
],
providers: [
AuthGuard
]
})
export class AppRouting { }
//export const AppRouting: ModuleWithProviders = RouterModule.forRoot(routes);