diff --git a/package-lock.json b/package-lock.json index 5a0dca3..f570986 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "opt-cc", - "version": "1.1.2", + "version": "1.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/static/package-lock.json b/static/package-lock.json index 5f561fb..0ad4833 100644 --- a/static/package-lock.json +++ b/static/package-lock.json @@ -523,6 +523,12 @@ "integrity": "sha1-dMt3+2BS7a/yqJhN2v2I1BnyXKw=", "dev": true }, + "@types/systemjs": { + "version": "0.20.4", + "resolved": "https://registry.npmjs.org/@types/systemjs/-/systemjs-0.20.4.tgz", + "integrity": "sha512-LpX7BmY9KuCZnxJ0XYBofrLwJ+0BL/FyAvfLxpejUUjzBwOqU03L9CLF6SILxWw8aWhcavFpu1b7M2bLbg1irQ==", + "dev": true + }, "abbrev": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", diff --git a/static/package.json b/static/package.json index 6f8dcca..1f2dbcf 100644 --- a/static/package.json +++ b/static/package.json @@ -41,6 +41,7 @@ "devDependencies": { "@types/jasmine": "2.5.38", "@types/node": "~6.0.60", + "@types/systemjs": "^0.20.4", "codelyzer": "~2.0.0-beta.1", "jasmine-core": "^2.5.2", "jasmine-spec-reporter": "^3.2.0", diff --git a/static/src/app/app.module.ts b/static/src/app/app.module.ts index 51f4444..9a29c67 100644 --- a/static/src/app/app.module.ts +++ b/static/src/app/app.module.ts @@ -50,7 +50,6 @@ import {AccordionModule} from "ngx-bootstrap"; AppUserService, AppUserStore, UserService, - UserStore, SquadService, SquadStore, DecorationService, @@ -72,7 +71,6 @@ import {AccordionModule} from "ngx-bootstrap"; DecorationItemComponent, RankItemComponent, FilterRankPipe, - UserItemComponent, SquadItemComponent, ShowErrorComponent, APPLICATION_VALIDATORS], diff --git a/static/src/app/app.routing.ts b/static/src/app/app.routing.ts index ed8e247..0ae3489 100644 --- a/static/src/app/app.routing.ts +++ b/static/src/app/app.routing.ts @@ -15,6 +15,7 @@ import {ConfirmPromotionComponent} from "./request/confirm-promotion/confirm-pro import {ConfirmAwardComponent} from "./request/confirm-award/confirm-award.component"; import {RouteConfig} from "./app.config"; import {statsRoutes, statsRoutingComponents} from "./statistic/stats.routing"; +import UsersModule from "./users/users.module"; export const appRoutes: Routes = [ @@ -31,7 +32,7 @@ export const appRoutes: Routes = [ {path: RouteConfig.confirmAwardPath, component: ConfirmAwardComponent, canActivate: [LoginGuardHL]}, {path: RouteConfig.confirmPromotionPath, component: ConfirmPromotionComponent, canActivate: [LoginGuardHL]}, - {path: RouteConfig.userPath, children: usersRoutes, 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,7 +47,7 @@ export const appRoutes: Routes = [ export const appRouting = RouterModule.forRoot(appRoutes); export const routingComponents = [LoginComponent, SignupComponent, RequestAwardComponent, RequestPromotionComponent, ConfirmAwardComponent, - ConfirmPromotionComponent, AdminComponent, ...armyRoutingComponents, NotFoundComponent, ...usersRoutingComponents, + ConfirmPromotionComponent, AdminComponent, ...armyRoutingComponents, NotFoundComponent, ...squadsRoutingComponents, ...decorationsRoutingComponents, ...ranksRoutingComponents, ...statsRoutingComponents]; export const routingProviders = [LoginGuardSQL, LoginGuardHL, LoginGuardMT, LoginGuardAdmin]; diff --git a/static/src/app/users/users.module.ts b/static/src/app/users/users.module.ts new file mode 100644 index 0000000..a9a51c4 --- /dev/null +++ b/static/src/app/users/users.module.ts @@ -0,0 +1,28 @@ +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 {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: [ UsersComponent, UserListComponent, UserItemComponent, EditUserComponent, AwardUserComponent, ShowErrorComponent ], + imports: [ BrowserModule, FormsModule, ReactiveFormsModule, HttpModule, ClipboardModule, DataTableModule, + BrowserAnimationsModule, NgxChartsModule, AccordionModule.forRoot(), routes ], + providers: [ UserStore, UserService ] +}) +export default class UsersModule { + static routes = routes; +}; diff --git a/static/src/app/users/users.routing.ts b/static/src/app/users/users.routing.ts index 9e51e3a..001e08a 100644 --- a/static/src/app/users/users.routing.ts +++ b/static/src/app/users/users.routing.ts @@ -1,8 +1,9 @@ -import {Routes} from "@angular/router"; +import {RouterModule, Routes} from "@angular/router"; import {UsersComponent} from "./users.component"; 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"; export const usersRoutes: Routes = [{ path: '', component: UsersComponent, @@ -30,4 +31,6 @@ export const usersRoutes: Routes = [{ } ]; +export const routes: ModuleWithProviders = RouterModule.forChild(usersRoutes); + export const usersRoutingComponents = [UsersComponent, UserListComponent, EditUserComponent, AwardUserComponent];