2018-03-07 11:56:50 +01:00
|
|
|
import {RouterModule, Routes} from '@angular/router';
|
2018-04-29 10:32:14 +02:00
|
|
|
import {NotFoundComponent} from './common/not-found';
|
2018-05-05 09:43:14 +02:00
|
|
|
import {LoginComponent, LoginGuardAdmin, LoginGuardHL, LoginGuardMT} from './login';
|
2018-03-07 11:56:50 +01:00
|
|
|
import {armyRoutes, armyRoutingComponents} from './army/army.routing';
|
|
|
|
import {SignupComponent} from './login/signup.component';
|
|
|
|
import {RouteConfig} from './app.config';
|
2019-02-25 14:32:29 +01:00
|
|
|
import {NavigationHeaderComponent} from './common/navigation/navigation-header.component';
|
|
|
|
import {SidenavListComponent} from './common/navigation/sidenav-list.component';
|
2017-05-10 11:04:06 +02:00
|
|
|
|
|
|
|
export const appRoutes: Routes = [
|
2017-09-03 13:10:36 +02:00
|
|
|
{
|
|
|
|
path: RouteConfig.overviewPath,
|
|
|
|
children: armyRoutes
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '', redirectTo: RouteConfig.overviewPath,
|
|
|
|
pathMatch: 'full'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: RouteConfig.statsPath,
|
|
|
|
loadChildren: './statistic/stats.module#StatsModule'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: RouteConfig.request,
|
|
|
|
loadChildren: './request/request.module#RequestModule'
|
|
|
|
},
|
|
|
|
{
|
2018-10-04 14:08:29 +02:00
|
|
|
path: RouteConfig.managePath,
|
|
|
|
loadChildren: './manage/manage.module#ManageModule',
|
2017-09-03 13:10:36 +02:00
|
|
|
canActivate: [LoginGuardHL]
|
|
|
|
},
|
2018-06-24 18:17:52 +02:00
|
|
|
{
|
|
|
|
path: RouteConfig.publicPath,
|
|
|
|
loadChildren: './pub/public.module#PublicModule'
|
|
|
|
},
|
2017-09-03 13:10:36 +02:00
|
|
|
{
|
|
|
|
path: RouteConfig.adminPanelPath,
|
|
|
|
loadChildren: './admin/admin.module#AdminModule',
|
|
|
|
canActivate: [LoginGuardAdmin]
|
|
|
|
},
|
2017-09-13 12:32:25 +02:00
|
|
|
{
|
|
|
|
path: RouteConfig.loginPath,
|
|
|
|
component: LoginComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: RouteConfig.signUpPath,
|
|
|
|
component: SignupComponent
|
|
|
|
},
|
2017-06-08 19:46:36 +02:00
|
|
|
|
2017-09-03 13:10:36 +02:00
|
|
|
/** Redirect Configuration **/
|
|
|
|
{
|
|
|
|
path: '404',
|
|
|
|
component: NotFoundComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '**',
|
|
|
|
redirectTo: '/404'
|
|
|
|
} // always configure this last - first matching route gets processed
|
2017-05-10 11:04:06 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
export const appRouting = RouterModule.forRoot(appRoutes);
|
|
|
|
|
2019-02-25 14:32:29 +01:00
|
|
|
export const routingComponents = [...armyRoutingComponents, LoginComponent, SignupComponent, NotFoundComponent,
|
|
|
|
NavigationHeaderComponent, SidenavListComponent];
|
2017-05-10 11:04:06 +02:00
|
|
|
|
2018-04-29 10:32:14 +02:00
|
|
|
export const routingProviders = [LoginGuardHL, LoginGuardMT, LoginGuardAdmin];
|