2017-06-10 22:07:32 +02:00
|
|
|
import {RouterModule, Routes} from "@angular/router";
|
|
|
|
import {LoginComponent} from "./login/index";
|
2017-08-06 10:42:37 +02:00
|
|
|
import {NotFoundComponent} from "./common/not-found/not-found.component";
|
2017-07-14 23:33:17 +02:00
|
|
|
import {LoginGuardAdmin, LoginGuardHL, LoginGuardMT, LoginGuardSQL} from "./login/login.guard";
|
2017-05-10 11:04:06 +02:00
|
|
|
import {squadsRoutes, squadsRoutingComponents} from "./squads/squads.routing";
|
2017-05-18 14:32:51 +02:00
|
|
|
import {armyRoutes, armyRoutingComponents} from "./army/army.routing";
|
2017-06-08 19:46:36 +02:00
|
|
|
import {SignupComponent} from "./login/signup.component";
|
2017-08-01 23:52:10 +02:00
|
|
|
import {RouteConfig} from "./app.config";
|
2017-05-10 11:04:06 +02:00
|
|
|
|
|
|
|
export const appRoutes: Routes = [
|
|
|
|
|
2017-08-01 23:52:10 +02:00
|
|
|
{path: RouteConfig.overviewPath, children: armyRoutes},
|
|
|
|
{path: '', redirectTo: RouteConfig.overviewPath, pathMatch: 'full'},
|
2017-05-11 21:46:28 +02:00
|
|
|
|
2017-09-02 23:27:15 +02:00
|
|
|
{path: RouteConfig.statsPath, loadChildren: './statistic/stats.module#StatsModule'},
|
2017-07-08 21:56:11 +02:00
|
|
|
|
2017-08-01 23:52:10 +02:00
|
|
|
{path: RouteConfig.loginPath, component: LoginComponent},
|
|
|
|
{path: RouteConfig.signUpPath, component: SignupComponent},
|
2017-06-09 18:30:35 +02:00
|
|
|
|
2017-09-03 12:29:41 +02:00
|
|
|
{path: RouteConfig.request, loadChildren: './request/request.module#RequestModule'},
|
2017-06-09 18:30:35 +02:00
|
|
|
|
2017-09-02 22:59:13 +02:00
|
|
|
{path: RouteConfig.userPath, loadChildren: './users/users.module#UsersModule', canActivate: [LoginGuardHL]},
|
2017-08-01 23:52:10 +02:00
|
|
|
{path: RouteConfig.squadPath, children: squadsRoutes, canActivate: [LoginGuardHL]},
|
2017-09-03 12:29:41 +02:00
|
|
|
{path: RouteConfig.decorationPath, loadChildren: './decorations/decoration.module#DecorationsModule', canActivate: [LoginGuardHL]},
|
2017-09-03 12:37:42 +02:00
|
|
|
{path: RouteConfig.rankPath, loadChildren: './ranks/ranks.module#RanksModule', canActivate: [LoginGuardHL]},
|
2017-05-10 11:04:06 +02:00
|
|
|
|
2017-09-03 12:29:41 +02:00
|
|
|
{path: RouteConfig.adminPanelPath, loadChildren: './admin/admin.module#AdminModule', canActivate: [LoginGuardAdmin]},
|
2017-06-08 19:46:36 +02:00
|
|
|
|
2017-05-10 11:04:06 +02:00
|
|
|
/** Redirect Konfigurationen **/
|
|
|
|
{path: '404', component: NotFoundComponent},
|
|
|
|
{path: '**', redirectTo: '/404'}, // immer als letztes konfigurieren - erste Route die matched wird angesteuert
|
|
|
|
];
|
|
|
|
|
|
|
|
export const appRouting = RouterModule.forRoot(appRoutes);
|
|
|
|
|
2017-09-03 12:37:42 +02:00
|
|
|
export const routingComponents = [LoginComponent, SignupComponent, ...armyRoutingComponents, NotFoundComponent, ...squadsRoutingComponents];
|
2017-05-10 11:04:06 +02:00
|
|
|
|
2017-07-14 23:33:17 +02:00
|
|
|
export const routingProviders = [LoginGuardSQL, LoginGuardHL, LoginGuardMT, LoginGuardAdmin];
|