2017-12-20 17:46:52 +01:00
|
|
|
|
import { FormComponent } from './dataset-profile-form/form/form.component';
|
2017-10-16 17:05:25 +02:00
|
|
|
|
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';
|
2017-10-27 09:48:33 +02:00
|
|
|
|
import { DatasetprofileEditorComponent } from './managers/datasetprofile-editor/datasetprofile-editor.component';
|
2017-10-16 17:05:25 +02:00
|
|
|
|
|
|
|
|
|
import { MainWindowComponent } from './main-window/main-window.component';
|
2018-01-31 16:46:32 +01:00
|
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
|
import { AuthGuard } from './guards/auth.guard';
|
2018-02-02 11:57:24 +01:00
|
|
|
|
import { AppComponent } from 'app/app.component';
|
|
|
|
|
import { MainSignInComponent } from 'app/login/main-sign-in/main-sign-in.component';
|
|
|
|
|
import { UnauthorizedComponent } from './unauthorized/unauthorized.component';
|
2017-10-16 17:05:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Route Configuration
|
2018-01-31 16:46:32 +01:00
|
|
|
|
const routes: Routes = [
|
2017-10-16 17:05:25 +02:00
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
path: '',
|
2018-02-02 11:57:24 +01:00
|
|
|
|
redirectTo: '/main',
|
2017-10-16 17:05:25 +02:00
|
|
|
|
pathMatch: 'full'
|
|
|
|
|
},
|
2018-02-02 11:57:24 +01:00
|
|
|
|
{
|
|
|
|
|
path: 'app-root',
|
|
|
|
|
component: AppComponent,
|
|
|
|
|
canActivate: [AuthGuard]
|
|
|
|
|
},
|
2017-10-16 17:05:25 +02:00
|
|
|
|
{
|
|
|
|
|
path: 'datasets',
|
2018-01-31 16:46:32 +01:00
|
|
|
|
component: DatasetsViewerComponent,
|
|
|
|
|
canActivate: [AuthGuard]
|
2017-10-16 17:05:25 +02:00
|
|
|
|
},
|
2017-10-27 09:48:33 +02:00
|
|
|
|
{
|
|
|
|
|
path: 'datasetprofiles',
|
2018-01-31 16:46:32 +01:00
|
|
|
|
component: DatasetprofileEditorComponent,
|
|
|
|
|
canActivate: [AuthGuard]
|
2017-10-18 10:29:22 +02:00
|
|
|
|
},
|
2017-10-16 17:05:25 +02:00
|
|
|
|
{
|
|
|
|
|
path: 'datasets/profile',
|
2018-01-31 16:46:32 +01:00
|
|
|
|
component: ProfileEditorComponent,
|
|
|
|
|
canActivate: [AuthGuard]
|
2017-10-16 17:05:25 +02:00
|
|
|
|
//,data: { title: 'a title' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'main',
|
2018-01-31 16:46:32 +01:00
|
|
|
|
component: MainWindowComponent,
|
|
|
|
|
canActivate: [AuthGuard]
|
2017-11-30 11:10:42 +01:00
|
|
|
|
},
|
2018-02-02 11:57:24 +01:00
|
|
|
|
{ path: 'form', loadChildren: './dataset-profile-form/dataset-profile.module#DatasetProfileModule', canActivate: [AuthGuard]},
|
|
|
|
|
{ path: "unauthorized", loadChildren: './unauthorized/unauthorized.module#UnauthorizedModule' } ,
|
|
|
|
|
{ path: "login", component: MainSignInComponent }
|
2017-10-16 17:05:25 +02:00
|
|
|
|
];
|
|
|
|
|
|
2018-01-31 16:46:32 +01:00
|
|
|
|
@NgModule({
|
|
|
|
|
imports: [
|
|
|
|
|
RouterModule.forRoot(
|
|
|
|
|
routes
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
exports: [
|
|
|
|
|
RouterModule
|
|
|
|
|
],
|
|
|
|
|
providers: [
|
2018-02-02 11:57:24 +01:00
|
|
|
|
AuthGuard
|
2018-01-31 16:46:32 +01:00
|
|
|
|
]
|
|
|
|
|
})
|
2017-10-16 17:05:25 +02:00
|
|
|
|
|
2018-01-31 16:46:32 +01:00
|
|
|
|
export class AppRouting { }
|
|
|
|
|
//export const AppRouting: ModuleWithProviders = RouterModule.forRoot(routes);
|