From f72a9f09cca8ac09edef31d066c83e71c75e7c6a Mon Sep 17 00:00:00 2001 From: Florian Hartwich Date: Sun, 3 Sep 2017 13:10:36 +0200 Subject: [PATCH] Fix army user detail --- static/src/app/app.module.ts | 4 ++ static/src/app/app.routing.ts | 72 +++++++++++++++++------- static/src/app/request/request.module.ts | 3 +- static/src/app/users/users.module.ts | 1 - 4 files changed, 58 insertions(+), 22 deletions(-) diff --git a/static/src/app/app.module.ts b/static/src/app/app.module.ts index a06a627..f8f1d68 100644 --- a/static/src/app/app.module.ts +++ b/static/src/app/app.module.ts @@ -19,6 +19,8 @@ import {ClipboardModule} from 'ngx-clipboard'; import {PromotionService} from "./services/promotion-service/promotion.service"; import {SharedModule} from "./shared.module"; import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; +import {UserService} from "./services/user-service/user.service"; +import {UserStore} from "./services/stores/user.store"; @NgModule({ imports: [SharedModule, BrowserModule, BrowserAnimationsModule, appRouting, HttpModule, ClipboardModule], @@ -28,6 +30,8 @@ import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; LoginGuardSQL, LoginGuardHL, LoginGuardAdmin, + UserService, + UserStore, ArmyService, SquadService, SquadStore, diff --git a/static/src/app/app.routing.ts b/static/src/app/app.routing.ts index 9a61cac..8c7d093 100644 --- a/static/src/app/app.routing.ts +++ b/static/src/app/app.routing.ts @@ -7,31 +7,65 @@ import {SignupComponent} from "./login/signup.component"; import {RouteConfig} from "./app.config"; export const appRoutes: Routes = [ - - {path: RouteConfig.overviewPath, children: armyRoutes}, - {path: '', redirectTo: RouteConfig.overviewPath, pathMatch: 'full'}, - - {path: RouteConfig.statsPath, loadChildren: './statistic/stats.module#StatsModule'}, - - {path: RouteConfig.loginPath, component: LoginComponent}, - {path: RouteConfig.signUpPath, component: SignupComponent}, - - {path: RouteConfig.request, loadChildren: './request/request.module#RequestModule'}, - - {path: RouteConfig.userPath, loadChildren: './users/users.module#UsersModule', canActivate: [LoginGuardHL]}, - {path: RouteConfig.squadPath, loadChildren: './squads/squads.module#SquadsModule', canActivate: [LoginGuardHL]}, + { + path: RouteConfig.overviewPath, + children: armyRoutes + }, + { + path: '', redirectTo: RouteConfig.overviewPath, + pathMatch: 'full' + }, + { + path: RouteConfig.statsPath, + loadChildren: './statistic/stats.module#StatsModule' + }, + { + path: RouteConfig.loginPath, + component: LoginComponent + }, + { + path: RouteConfig.signUpPath, + component: SignupComponent + }, + { + path: RouteConfig.request, + loadChildren: './request/request.module#RequestModule' + }, + { + path: RouteConfig.userPath, + loadChildren: './users/users.module#UsersModule', + canActivate: [LoginGuardHL] + }, + { + path: RouteConfig.squadPath, + loadChildren: './squads/squads.module#SquadsModule', + canActivate: [LoginGuardHL] + }, { path: RouteConfig.decorationPath, loadChildren: './decorations/decoration.module#DecorationsModule', canActivate: [LoginGuardHL] }, - {path: RouteConfig.rankPath, loadChildren: './ranks/ranks.module#RanksModule', canActivate: [LoginGuardHL]}, + { + path: RouteConfig.rankPath, + loadChildren: './ranks/ranks.module#RanksModule', + canActivate: [LoginGuardHL] + }, + { + path: RouteConfig.adminPanelPath, + loadChildren: './admin/admin.module#AdminModule', + canActivate: [LoginGuardAdmin] + }, - {path: RouteConfig.adminPanelPath, loadChildren: './admin/admin.module#AdminModule', canActivate: [LoginGuardAdmin]}, - - /** Redirect Konfigurationen **/ - {path: '404', component: NotFoundComponent}, - {path: '**', redirectTo: '/404'}, // immer als letztes konfigurieren - erste Route die matched wird angesteuert + /** Redirect Configuration **/ + { + path: '404', + component: NotFoundComponent + }, + { + path: '**', + redirectTo: '/404' + } // always configure this last - first matching route gets processed ]; export const appRouting = RouterModule.forRoot(appRoutes); diff --git a/static/src/app/request/request.module.ts b/static/src/app/request/request.module.ts index f00e6d6..36ab3e0 100644 --- a/static/src/app/request/request.module.ts +++ b/static/src/app/request/request.module.ts @@ -14,8 +14,7 @@ import {UserStore} from "../services/stores/user.store"; @NgModule({ declarations: [RequestComponent, RequestPromotionComponent, RequestAwardComponent, ConfirmPromotionComponent, ConfirmAwardComponent, FilterRankPipe], - imports: [CommonModule, SharedModule, requestRouterModule], - providers: [UserStore, UserService] + imports: [CommonModule, SharedModule, requestRouterModule] }) export class RequestModule { static routes = requestRouterModule; diff --git a/static/src/app/users/users.module.ts b/static/src/app/users/users.module.ts index d770eb8..44c8cbd 100644 --- a/static/src/app/users/users.module.ts +++ b/static/src/app/users/users.module.ts @@ -8,7 +8,6 @@ import {SharedModule} from "../shared.module"; @NgModule({ declarations: usersRoutingComponents, imports: [CommonModule, SharedModule, routes], - providers: [UserStore, UserService] }) export class UsersModule { static routes = routes;