Fix army user detail

pull/7/head
Florian Hartwich 2017-09-03 13:10:36 +02:00
parent 91c9986be7
commit f72a9f09cc
4 changed files with 58 additions and 22 deletions

View File

@ -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,

View File

@ -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);

View File

@ -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;

View File

@ -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;