Compare commits

..

No commits in common. "92b3df335a5d90a14a447f660f3fbb158292cd5c" and "164f4543c7fd45413881ff0e9624ae68d2d0e007" have entirely different histories.

7 changed files with 48 additions and 52 deletions

View File

@ -1,10 +1,16 @@
import {NgModule} from '@angular/core';
import {BrowserModule} from "@angular/platform-browser";
import {Title, BrowserModule} from "@angular/platform-browser";
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {HttpModule} from '@angular/http';
import {AppComponent} from './app.component';
import {LoginService} from "./services/login-service/login-service";
import {UserStore} from "./services/stores/user.store";
import {ShowErrorComponent} from './common/show-error/show-error.component';
import {APPLICATION_VALIDATORS} from './models/app-validators';
import {appRouting, routingComponents, routingProviders} from './app.routing';
import {AUTH_ENABLED} from './app.tokens';
import {UserService} from "./services/user-service/user.service";
import {UserItemComponent} from "./users/user-list/user-item.component";
import {SquadService} from "./services/squad-service/squad.service";
import {SquadStore} from "./services/stores/squad.store";
import {DecorationStore} from "./services/stores/decoration.store";
@ -20,17 +26,20 @@ import {LoginGuardAdmin, LoginGuardHL, LoginGuardSQL} from "./login/login.guard"
import {AwardingService} from "./services/awarding-service/awarding.service";
import {HttpClient} from "./services/http-client";
import {ArmyService} from "./services/army-service/army.service";
import {ClipboardModule} from 'ngx-clipboard';
import { ClipboardModule } from 'ngx-clipboard';
import {AppUserService} from "./services/app-user-service/app-user.service";
import {AppUserStore} from "./services/stores/app-user.store";
import {PromotionService} from "./services/promotion-service/promotion.service";
import {FilterRankPipe} from "./filter/filter.pipe";
import {WarService} from "./services/war-service/war.service";
import {SharedModule} from "./shared.module";
import {DataTableModule} from "angular2-datatable";
import {NgxChartsModule} from "@swimlane/ngx-charts";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {AccordionModule} from "ngx-bootstrap";
@NgModule({
imports: [SharedModule, BrowserModule, BrowserAnimationsModule, appRouting, HttpModule, ClipboardModule],
imports: [BrowserModule, FormsModule, ReactiveFormsModule, appRouting, HttpModule, ClipboardModule, DataTableModule,
BrowserAnimationsModule, NgxChartsModule, AccordionModule.forRoot()],
providers: [
HttpClient,
LoginService,
@ -40,6 +49,7 @@ import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
ArmyService,
AppUserService,
AppUserStore,
UserService,
SquadService,
SquadStore,
DecorationService,
@ -48,7 +58,9 @@ import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
RankStore,
AwardingService,
PromotionService,
WarService,
AppConfig,
Title,
routingProviders,
{provide: AUTH_ENABLED, useValue: true}
],
@ -59,7 +71,9 @@ import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
DecorationItemComponent,
RankItemComponent,
FilterRankPipe,
SquadItemComponent],
SquadItemComponent,
ShowErrorComponent,
APPLICATION_VALIDATORS],
bootstrap: [AppComponent]
})
export class AppModule {

View File

@ -2,6 +2,7 @@ import {RouterModule, Routes} from "@angular/router";
import {LoginComponent} from "./login/index";
import {NotFoundComponent} from "./common/not-found/not-found.component";
import {LoginGuardAdmin, LoginGuardHL, LoginGuardMT, LoginGuardSQL} from "./login/login.guard";
import {usersRoutes, usersRoutingComponents} from "./users/users.routing";
import {squadsRoutes, squadsRoutingComponents} from "./squads/squads.routing";
import {decorationsRoutes, decorationsRoutingComponents} from "./decorations/decoration.routing";
import {ranksRoutes, ranksRoutingComponents} from "./ranks/ranks.routing";
@ -13,14 +14,15 @@ import {RequestPromotionComponent} from "./request/promotion/req-promotion.compo
import {ConfirmPromotionComponent} from "./request/confirm-promotion/confirm-promotion.component";
import {ConfirmAwardComponent} from "./request/confirm-award/confirm-award.component";
import {RouteConfig} from "./app.config";
import {statsRoutingComponents} from "./statistic/stats.routing";
import {statsRoutes, statsRoutingComponents} from "./statistic/stats.routing";
import UsersModule from "./users/users.module";
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.statsPath, children: statsRoutes},
{path: RouteConfig.loginPath, component: LoginComponent},
{path: RouteConfig.signUpPath, component: SignupComponent},
@ -30,7 +32,7 @@ export const appRoutes: Routes = [
{path: RouteConfig.confirmAwardPath, component: ConfirmAwardComponent, canActivate: [LoginGuardHL]},
{path: RouteConfig.confirmPromotionPath, component: ConfirmPromotionComponent, canActivate: [LoginGuardHL]},
{path: RouteConfig.userPath, loadChildren: './users/users.module#UsersModule', canActivate: [LoginGuardHL]},
{path: RouteConfig.userPath, loadChildren: './users/users.module', canActivate: [LoginGuardHL]},
{path: RouteConfig.squadPath, children: squadsRoutes, canActivate: [LoginGuardHL]},
{path: RouteConfig.decorationPath, children: decorationsRoutes, canActivate: [LoginGuardHL]},
{path: RouteConfig.rankPath, children: ranksRoutes, canActivate: [LoginGuardHL]},
@ -46,6 +48,6 @@ export const appRouting = RouterModule.forRoot(appRoutes);
export const routingComponents = [LoginComponent, SignupComponent, RequestAwardComponent, RequestPromotionComponent, ConfirmAwardComponent,
ConfirmPromotionComponent, AdminComponent, ...armyRoutingComponents, NotFoundComponent,
...squadsRoutingComponents, ...decorationsRoutingComponents, ...ranksRoutingComponents];
...squadsRoutingComponents, ...decorationsRoutingComponents, ...ranksRoutingComponents, ...statsRoutingComponents];
export const routingProviders = [LoginGuardSQL, LoginGuardHL, LoginGuardMT, LoginGuardAdmin];

View File

@ -1,12 +0,0 @@
import {NgModule} from '@angular/core';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {ShowErrorComponent} from "./common/show-error/show-error.component";
import {CommonModule} from "@angular/common";
@NgModule({
declarations: [ShowErrorComponent],
imports: [CommonModule, FormsModule, ReactiveFormsModule],
exports: [FormsModule, ReactiveFormsModule, ShowErrorComponent]
})
export class SharedModule {
}

View File

@ -1,17 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from "@angular/common";
import {SharedModule} from "../shared.module";
import {statsRouterModule, statsRoutingComponents} from "./stats.routing";
import {WarService} from "../services/war-service/war.service";
import {DataTableModule} from "angular2-datatable";
import {NgxChartsModule} from "@swimlane/ngx-charts";
import {AccordionModule} from "ngx-bootstrap";
@NgModule({
declarations: statsRoutingComponents,
imports: [CommonModule, SharedModule, statsRouterModule, NgxChartsModule, AccordionModule.forRoot(), DataTableModule],
providers: [WarService]
})
export class StatsModule {
static routes = statsRouterModule;
}

View File

@ -1,11 +1,10 @@
import {RouterModule, Routes} from "@angular/router";
import {Routes} from "@angular/router";
import {StatisticComponent} from "./stats.component";
import {WarDetailComponent} from "./war-detail/war-detail.component";
import {WarSubmitComponent} from "./war-submit/war-submit.component";
import {WarListComponent} from "./war-list/war-list.component";
import {StatisticOverviewComponent} from "./overview/stats-overview.component";
import {WarItemComponent} from "./war-list/war-item.component";
import {ModuleWithProviders} from "@angular/core";
export const statsRoutes: Routes = [{
@ -33,8 +32,6 @@ export const statsRoutes: Routes = [{
outlet: 'right'
}];
export const statsRouterModule: ModuleWithProviders = RouterModule.forChild(statsRoutes);
export const statsRoutingComponents = [StatisticComponent, StatisticOverviewComponent, WarListComponent,
WarSubmitComponent, WarDetailComponent, WarItemComponent];

View File

@ -1,15 +1,28 @@
import {NgModule} from '@angular/core';
import { NgModule } from '@angular/core';
import {routes, usersRoutingComponents} from './users.routing';
import {UserStore} from "../services/stores/user.store";
import {UserService} from "../services/user-service/user.service";
import {CommonModule} from "@angular/common";
import {SharedModule} from "../shared.module";
import {BrowserModule} from "@angular/platform-browser";
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
import {HttpModule} from "@angular/http";
import {AccordionModule} from "ngx-bootstrap";
import {NgxChartsModule} from "@swimlane/ngx-charts";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {DataTableModule} from "angular2-datatable";
import {ClipboardModule} from "ngx-clipboard/dist";
import {UsersComponent} from "./users.component";
import {UserItemComponent} from "./user-list/user-item.component";
import {UserListComponent} from "./user-list/user-list.component";
import {EditUserComponent} from "./edit-user/edit-user.component";
import {AwardUserComponent} from "./award-user/award-user.component";
import {ShowErrorComponent} from "../common/show-error/show-error.component";
@NgModule({
declarations: usersRoutingComponents,
imports: [CommonModule, SharedModule, routes],
providers: [UserStore, UserService]
declarations: [ UsersComponent, UserListComponent, UserItemComponent, EditUserComponent, AwardUserComponent, ShowErrorComponent ],
imports: [ BrowserModule, FormsModule, ReactiveFormsModule, HttpModule, ClipboardModule, DataTableModule,
BrowserAnimationsModule, NgxChartsModule, AccordionModule.forRoot(), routes ],
providers: [ UserStore, UserService ]
})
export class UsersModule {
export default class UsersModule {
static routes = routes;
}
};

View File

@ -4,7 +4,6 @@ import {EditUserComponent} from "./edit-user/edit-user.component";
import {UserListComponent} from "./user-list/user-list.component";
import {AwardUserComponent} from "./award-user/award-user.component";
import {ModuleWithProviders} from "@angular/core";
import {UserItemComponent} from "./user-list/user-item.component";
export const usersRoutes: Routes = [{
path: '', component: UsersComponent,
@ -34,4 +33,4 @@ export const usersRoutes: Routes = [{
export const routes: ModuleWithProviders = RouterModule.forChild(usersRoutes);
export const usersRoutingComponents = [UserItemComponent, UsersComponent, UserListComponent, EditUserComponent, AwardUserComponent];
export const usersRoutingComponents = [UsersComponent, UserListComponent, EditUserComponent, AwardUserComponent];