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";
|
|
|
|
import {decorationsRoutes, decorationsRoutingComponents} from "./decorations/decoration.routing";
|
|
|
|
import {ranksRoutes, ranksRoutingComponents} from "./ranks/ranks.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";
|
|
|
|
import {AdminComponent} from "./admin/admin.component";
|
2017-06-09 18:30:35 +02:00
|
|
|
import {RequestAwardComponent} from "./request/award/req-award.component";
|
2017-06-10 13:16:15 +02:00
|
|
|
import {RequestPromotionComponent} from "./request/promotion/req-promotion.component";
|
2017-06-10 22:07:32 +02:00
|
|
|
import {ConfirmPromotionComponent} from "./request/confirm-promotion/confirm-promotion.component";
|
|
|
|
import {ConfirmAwardComponent} from "./request/confirm-award/confirm-award.component";
|
2017-08-01 23:52:10 +02:00
|
|
|
import {RouteConfig} from "./app.config";
|
2017-08-06 10:42:37 +02:00
|
|
|
import {statsRoutes, statsRoutingComponents} from "./statistic/stats.routing";
|
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-08-06 10:42:37 +02:00
|
|
|
{path: RouteConfig.statsPath, children: statsRoutes},
|
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-08-01 23:52:10 +02:00
|
|
|
{path: RouteConfig.requestAwardPath, component: RequestAwardComponent, canActivate: [LoginGuardSQL]},
|
|
|
|
{path: RouteConfig.requestPromotionPath, component: RequestPromotionComponent, canActivate: [LoginGuardSQL]},
|
|
|
|
{path: RouteConfig.confirmAwardPath, component: ConfirmAwardComponent, canActivate: [LoginGuardHL]},
|
|
|
|
{path: RouteConfig.confirmPromotionPath, component: ConfirmPromotionComponent, canActivate: [LoginGuardHL]},
|
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]},
|
|
|
|
{path: RouteConfig.decorationPath, children: decorationsRoutes, canActivate: [LoginGuardHL]},
|
|
|
|
{path: RouteConfig.rankPath, children: ranksRoutes, canActivate: [LoginGuardHL]},
|
2017-05-10 11:04:06 +02:00
|
|
|
|
2017-08-01 23:52:10 +02:00
|
|
|
{path: RouteConfig.adminPanelPath, component: AdminComponent, 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-06-10 22:07:32 +02:00
|
|
|
export const routingComponents = [LoginComponent, SignupComponent, RequestAwardComponent, RequestPromotionComponent, ConfirmAwardComponent,
|
2017-08-26 22:46:59 +02:00
|
|
|
ConfirmPromotionComponent, AdminComponent, ...armyRoutingComponents, NotFoundComponent,
|
2017-08-06 10:42:37 +02:00
|
|
|
...squadsRoutingComponents, ...decorationsRoutingComponents, ...ranksRoutingComponents, ...statsRoutingComponents];
|
2017-05-10 11:04:06 +02:00
|
|
|
|
2017-07-14 23:33:17 +02:00
|
|
|
export const routingProviders = [LoginGuardSQL, LoginGuardHL, LoginGuardMT, LoginGuardAdmin];
|