diff --git a/minify.sh b/minify.sh
index 18454d0..bf76d44 100755
--- a/minify.sh
+++ b/minify.sh
@@ -4,12 +4,12 @@
cd $(dirname $0)
# array of files to minify
-FILES=(inline main polyfills scripts styles vendor)
+FILES=(inline.bundle main.bundle polyfills.bundle scripts.bundle styles.bundle vendor.bundle 0.chunk 1.chunk 2.chunk 3.chunk 4.chunk 5.chunk 6.chunk 7.chunk)
OPTIONS="-c toplevel,dead_code=true,unused=true"
for i in "${FILES[@]}"
do
echo "minify ${i} ..."
- $(npm bin)/uglifyjs public/${i}.bundle.js ${OPTIONS} -o public/${i}.bundle.js
- rm -f public/${i}.bundle.js.map
+ $(npm bin)/uglifyjs public/${i}.js ${OPTIONS} -o public/${i}.js
+ rm -f public/${i}.js.map
done
diff --git a/static/e2e/test.e2e-spec.ts b/static/e2e/test.e2e-spec.ts
index 5ceddf2..1ba9a7a 100644
--- a/static/e2e/test.e2e-spec.ts
+++ b/static/e2e/test.e2e-spec.ts
@@ -1,4 +1,4 @@
-import {browser, element, by} from 'protractor';
+import {browser, by, element} from 'protractor';
describe('Main Page Access', function () {
@@ -7,7 +7,7 @@ describe('Main Page Access', function () {
browser.get('/')
});
- it('should open army overview initially', async() => {
+ it('should open army overview initially', async () => {
let elem = element(by.css('h1'));
let text = elem.getText();
expect(text).toBe("Übersicht über alle Spieler, Squads und Armeen");
diff --git a/static/karma.conf.js b/static/karma.conf.js
index d46e1e3..4135a17 100644
--- a/static/karma.conf.js
+++ b/static/karma.conf.js
@@ -13,13 +13,13 @@ module.exports = function (config) {
require('@angular/cli/plugins/karma')
],
files: [
- { pattern: './src/test.ts', watched: false }
+ {pattern: './src/test.ts', watched: false}
],
preprocessors: {
'./src/test.ts': ['@angular/cli']
},
mime: {
- 'text/x-typescript': ['ts','tsx']
+ 'text/x-typescript': ['ts', 'tsx']
},
remapIstanbulReporter: {
reports: {
@@ -32,8 +32,8 @@ module.exports = function (config) {
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
- ? ['spec', 'karma-remap-istanbul']
- : ['spec'],
+ ? ['spec', 'karma-remap-istanbul']
+ : ['spec'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
diff --git a/static/protractor-html-reporter.conf.js b/static/protractor-html-reporter.conf.js
index b9360f8..acb2f7d 100644
--- a/static/protractor-html-reporter.conf.js
+++ b/static/protractor-html-reporter.conf.js
@@ -29,24 +29,25 @@ exports.config = {
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
- print: function() {}
+ print: function () {
+ }
},
useAllAngular2AppRoots: true,
- beforeLaunch: function() {
+ beforeLaunch: function () {
require('ts-node').register({
project: 'e2e'
});
- return new Promise(function(resolve){
+ return new Promise(function (resolve) {
reporter.beforeLaunch(resolve);
});
},
- afterLaunch: function(exitCode) {
- return new Promise(function(resolve){
+ afterLaunch: function (exitCode) {
+ return new Promise(function (resolve) {
reporter.afterLaunch(resolve.bind(this, exitCode));
});
},
- onPrepare: function() {
+ onPrepare: function () {
jasmine.getEnv().addReporter(reporter);
jasmine.getEnv().addReporter(new SpecReporter());
},
-};
\ No newline at end of file
+};
diff --git a/static/protractor.conf.js b/static/protractor.conf.js
index 954a56e..04ea2bc 100644
--- a/static/protractor.conf.js
+++ b/static/protractor.conf.js
@@ -1,9 +1,9 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
-const { SpecReporter } = require('jasmine-spec-reporter');
+const {SpecReporter} = require('jasmine-spec-reporter');
-exports.config= {
+exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
@@ -17,14 +17,15 @@ exports.config= {
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
- print: function() {}
+ print: function () {
+ }
},
- beforeLaunch: function() {
+ beforeLaunch: function () {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
},
onPrepare() {
- jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
+ jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
}
};
diff --git a/static/src/app/admin/admin.component.ts b/static/src/app/admin/admin.component.ts
index 3d470a9..b8ce4b9 100644
--- a/static/src/app/admin/admin.component.ts
+++ b/static/src/app/admin/admin.component.ts
@@ -61,7 +61,7 @@ export class AdminComponent {
/**
* compare ngValue with ngModel to assign selected element
*/
- equals(o1: Squad , o2: Squad) {
+ equals(o1: Squad, o2: Squad) {
if (o1 && o2) {
return o1._id === o2._id;
}
diff --git a/static/src/app/app.component.css b/static/src/app/app.component.css
index 1bf8f81..73039f4 100644
--- a/static/src/app/app.component.css
+++ b/static/src/app/app.component.css
@@ -47,11 +47,19 @@ unprocessed-child:hover {
/* Safari 4.0 - 8.0 */
@-webkit-keyframes color-blink {
- from {background-color: #222222;}
- to {background-color: orange;}
+ from {
+ background-color: #222222;
+ }
+ to {
+ background-color: orange;
+ }
}
@keyframes color-blink {
- from {background-color: #222222;}
- to {background-color: orange;}
+ from {
+ background-color: #222222;
+ }
+ to {
+ background-color: orange;
+ }
}
diff --git a/static/src/app/app.component.html b/static/src/app/app.component.html
index 239d81b..e7dff4e 100644
--- a/static/src/app/app.component.html
+++ b/static/src/app/app.component.html
@@ -53,17 +53,21 @@
-
Anträge
diff --git a/static/src/app/app.component.ts b/static/src/app/app.component.ts
index e594b3d..f785986 100644
--- a/static/src/app/app.component.ts
+++ b/static/src/app/app.component.ts
@@ -1,4 +1,4 @@
-import {Component, Inject, Optional} from '@angular/core';
+import {Component} from '@angular/core';
import {Router} from '@angular/router';
import {LoginService} from './services/login-service/login-service';
import {PromotionService} from "./services/promotion-service/promotion.service";
diff --git a/static/src/app/app.config.ts b/static/src/app/app.config.ts
index b19bbeb..2559dbd 100644
--- a/static/src/app/app.config.ts
+++ b/static/src/app/app.config.ts
@@ -1,20 +1,19 @@
-
export class AppConfig {
public readonly apiUrl = '/api';
- public readonly apiAppUserPath = this.apiUrl + '/account/';
- public readonly apiAwardPath = this.apiUrl + '/awardings';
- public readonly apiDecorationPath = this.apiUrl + '/decorations/';
+ public readonly apiAppUserPath = this.apiUrl + '/account/';
+ public readonly apiAwardPath = this.apiUrl + '/awardings';
+ public readonly apiDecorationPath = this.apiUrl + '/decorations/';
public readonly apiAuthenticationPath = this.apiUrl + '/authenticate';
- public readonly apiSignupPath = this.apiUrl + '/authenticate/signup';
- public readonly apiRankPath = this.apiUrl + '/ranks/';
- public readonly apiSquadPath = this.apiUrl + '/squads/';
- public readonly apiUserPath = this.apiUrl + '/users/';
- public readonly apiOverviewPath = this.apiUrl + '/overview';
- public readonly apiRequestAwardPath = this.apiUrl + '/request/award';
- public readonly apiPromotionPath = this.apiUrl + '/request/promotion';
- public readonly apiWarPath = this.apiUrl + '/wars';
+ public readonly apiSignupPath = this.apiUrl + '/authenticate/signup';
+ public readonly apiRankPath = this.apiUrl + '/ranks/';
+ public readonly apiSquadPath = this.apiUrl + '/squads/';
+ public readonly apiUserPath = this.apiUrl + '/users/';
+ public readonly apiOverviewPath = this.apiUrl + '/overview';
+ public readonly apiRequestAwardPath = this.apiUrl + '/request/award';
+ public readonly apiPromotionPath = this.apiUrl + '/request/promotion';
+ public readonly apiWarPath = this.apiUrl + '/wars';
}
diff --git a/static/src/app/app.module.ts b/static/src/app/app.module.ts
index 23eccc1..a06a627 100644
--- a/static/src/app/app.module.ts
+++ b/static/src/app/app.module.ts
@@ -8,7 +8,6 @@ import {SquadService} from "./services/squad-service/squad.service";
import {SquadStore} from "./services/stores/squad.store";
import {DecorationStore} from "./services/stores/decoration.store";
import {DecorationService} from "./services/decoration-service/decoration.service";
-import {SquadItemComponent} from "./squads/squad-list/squad-item.component";
import {RankStore} from "./services/stores/rank.store";
import {RankService} from "./services/rank-service/rank.service";
import {AppConfig} from "./app.config";
@@ -43,8 +42,7 @@ import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
],
declarations: [
AppComponent,
- routingComponents,
- SquadItemComponent],
+ routingComponents],
bootstrap: [AppComponent]
})
export class AppModule {
diff --git a/static/src/app/app.routing.ts b/static/src/app/app.routing.ts
index e2c9ec1..9a61cac 100644
--- a/static/src/app/app.routing.ts
+++ b/static/src/app/app.routing.ts
@@ -2,7 +2,6 @@ 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 {squadsRoutes, squadsRoutingComponents} from "./squads/squads.routing";
import {armyRoutes, armyRoutingComponents} from "./army/army.routing";
import {SignupComponent} from "./login/signup.component";
import {RouteConfig} from "./app.config";
@@ -20,8 +19,12 @@ export const appRoutes: Routes = [
{path: RouteConfig.request, loadChildren: './request/request.module#RequestModule'},
{path: RouteConfig.userPath, loadChildren: './users/users.module#UsersModule', canActivate: [LoginGuardHL]},
- {path: RouteConfig.squadPath, children: squadsRoutes, canActivate: [LoginGuardHL]},
- {path: RouteConfig.decorationPath, loadChildren: './decorations/decoration.module#DecorationsModule', 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.adminPanelPath, loadChildren: './admin/admin.module#AdminModule', canActivate: [LoginGuardAdmin]},
@@ -33,6 +36,6 @@ export const appRoutes: Routes = [
export const appRouting = RouterModule.forRoot(appRoutes);
-export const routingComponents = [LoginComponent, SignupComponent, ...armyRoutingComponents, NotFoundComponent, ...squadsRoutingComponents];
+export const routingComponents = [LoginComponent, SignupComponent, ...armyRoutingComponents, NotFoundComponent];
export const routingProviders = [LoginGuardSQL, LoginGuardHL, LoginGuardMT, LoginGuardAdmin];
diff --git a/static/src/app/army/army-member.component.ts b/static/src/app/army/army-member.component.ts
index 4a3a70a..0355e4a 100644
--- a/static/src/app/army/army-member.component.ts
+++ b/static/src/app/army/army-member.component.ts
@@ -3,7 +3,7 @@ import {User} from "../models/model-interfaces";
import {ActivatedRoute, Router} from "@angular/router";
import {UserService} from "../services/user-service/user.service";
import {Subscription} from "rxjs/Subscription";
-import {AppConfig, RouteConfig} from "../app.config";
+import {RouteConfig} from "../app.config";
@Component({
diff --git a/static/src/app/army/army.component.html b/static/src/app/army/army.component.html
index 7f09601..3a02e79 100644
--- a/static/src/app/army/army.component.html
+++ b/static/src/app/army/army.component.html
@@ -16,7 +16,8 @@
-
{{member.rank}} {{member.username}}
+
{{member.rank}} {{member.username}}
+
diff --git a/static/src/app/common/show-error/show-error.component.ts b/static/src/app/common/show-error/show-error.component.ts
index 6e52f73..31f08a5 100644
--- a/static/src/app/common/show-error/show-error.component.ts
+++ b/static/src/app/common/show-error/show-error.component.ts
@@ -1,5 +1,5 @@
-import {Component, Input, Optional} from '@angular/core';
-import {NgForm, FormGroup} from '@angular/forms';
+import {Component, Input} from '@angular/core';
+import {FormGroup, NgForm} from '@angular/forms';
@Component({
selector: 'show-error',
diff --git a/static/src/app/decorations/decoration-list/decoration-item.component.ts b/static/src/app/decorations/decoration-list/decoration-item.component.ts
index c816b12..f366857 100644
--- a/static/src/app/decorations/decoration-list/decoration-item.component.ts
+++ b/static/src/app/decorations/decoration-list/decoration-item.component.ts
@@ -8,7 +8,7 @@ import {Decoration} from "../../models/model-interfaces";
styleUrls: ['./decoration-item.component.css', '../../style/list-entry.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
inputs: ['decoration', 'selected'],
- outputs: ['decorationDelete','decorationSelected'],
+ outputs: ['decorationDelete', 'decorationSelected'],
})
export class DecorationItemComponent {
diff --git a/static/src/app/decorations/decoration-list/decoration-list.component.html b/static/src/app/decorations/decoration-list/decoration-list.component.html
index 342eaf0..e54319c 100644
--- a/static/src/app/decorations/decoration-list/decoration-list.component.html
+++ b/static/src/app/decorations/decoration-list/decoration-list.component.html
@@ -49,10 +49,10 @@
+ [decoration]="decoration"
+ (decorationDelete)="deleteDecoration(decoration)"
+ (decorationSelected)="selectDecoration($event)"
+ [selected]="decoration._id == selectedDecorationId">
diff --git a/static/src/app/decorations/edit-decoration/edit-decoration.component.html b/static/src/app/decorations/edit-decoration/edit-decoration.component.html
index a1b5eca..d148c9a 100644
--- a/static/src/app/decorations/edit-decoration/edit-decoration.component.html
+++ b/static/src/app/decorations/edit-decoration/edit-decoration.component.html
@@ -38,7 +38,7 @@
+ [(ngModel)]="decoration.sortingNumber">
@@ -51,7 +51,7 @@
-

+
diff --git a/static/src/app/squads/squad-list/squad-list.component.html b/static/src/app/squads/squad-list/squad-list.component.html
index d992163..213e65e 100644
--- a/static/src/app/squads/squad-list/squad-list.component.html
+++ b/static/src/app/squads/squad-list/squad-list.component.html
@@ -41,10 +41,10 @@
+ [squad]="squad"
+ (squadDelete)="deleteSquad(squad)"
+ (squadSelected)="selectSquad($event)"
+ [selected]="squad._id == selectedSquadId">
diff --git a/static/src/app/squads/squads.module.ts b/static/src/app/squads/squads.module.ts
new file mode 100644
index 0000000..dff17fa
--- /dev/null
+++ b/static/src/app/squads/squads.module.ts
@@ -0,0 +1,15 @@
+import {NgModule} from '@angular/core';
+import {CommonModule} from "@angular/common";
+import {SharedModule} from "../shared.module";
+import {squadRouterModule, squadsRoutingComponents} from "./squads.routing";
+import {SquadStore} from "../services/stores/squad.store";
+import {SquadService} from "../services/squad-service/squad.service";
+
+@NgModule({
+ declarations: squadsRoutingComponents,
+ imports: [CommonModule, SharedModule, squadRouterModule],
+ providers: [SquadStore, SquadService]
+})
+export class SquadsModule {
+ static routes = squadRouterModule;
+}
diff --git a/static/src/app/squads/squads.routing.ts b/static/src/app/squads/squads.routing.ts
index 7a8149b..ef29775 100644
--- a/static/src/app/squads/squads.routing.ts
+++ b/static/src/app/squads/squads.routing.ts
@@ -1,7 +1,9 @@
-import {Routes} from "@angular/router";
+import {RouterModule, Routes} from "@angular/router";
import {SquadComponent} from "./squads.component";
import {SquadListComponent} from "./squad-list/squad-list.component";
import {EditSquadComponent} from "./edit-squad/edit-squad.component";
+import {ModuleWithProviders} from "@angular/core";
+import {SquadItemComponent} from "./squad-list/squad-item.component";
export const squadsRoutes: Routes = [{
path: '', component: SquadComponent,
@@ -23,5 +25,7 @@ export const squadsRoutes: Routes = [{
outlet: 'right'
}];
-export const squadsRoutingComponents = [SquadComponent, SquadListComponent, EditSquadComponent];
+export const squadRouterModule: ModuleWithProviders = RouterModule.forChild(squadsRoutes);
+
+export const squadsRoutingComponents = [SquadComponent, SquadItemComponent, SquadListComponent, EditSquadComponent];
diff --git a/static/src/app/statistic/war-detail/war-detail.component.ts b/static/src/app/statistic/war-detail/war-detail.component.ts
index 861b7a0..a0827b4 100644
--- a/static/src/app/statistic/war-detail/war-detail.component.ts
+++ b/static/src/app/statistic/war-detail/war-detail.component.ts
@@ -1,7 +1,6 @@
import {Component} from "@angular/core";
-import {ActivatedRoute, Router} from "@angular/router";
+import {ActivatedRoute} from "@angular/router";
import {WarService} from "../../services/war-service/war.service";
-import {LoginService} from "../../services/login-service/login-service";
import {Player, War} from "../../models/model-interfaces";
diff --git a/static/src/app/statistic/war-list/war-item.component.html b/static/src/app/statistic/war-list/war-item.component.html
index f62c441..dd962b5 100644
--- a/static/src/app/statistic/war-list/war-item.component.html
+++ b/static/src/app/statistic/war-list/war-item.component.html
@@ -6,11 +6,12 @@
{{war.title}}
- vom {{war.date | date: 'dd.MM.yyyy'}}
+ vom {{war.date | date: 'dd.MM.yyyy'}}
-
+
diff --git a/static/src/app/style/list-entry.css b/static/src/app/style/list-entry.css
index 0985751..a73838c 100644
--- a/static/src/app/style/list-entry.css
+++ b/static/src/app/style/list-entry.css
@@ -40,7 +40,7 @@ span {
}
.trash {
- float:right;
+ float: right;
padding-top: 18px;
font-size: 17px;
}
diff --git a/static/src/app/users/user-list/user-item.component.html b/static/src/app/users/user-list/user-item.component.html
index d5589d5..a3dbaa6 100644
--- a/static/src/app/users/user-list/user-item.component.html
+++ b/static/src/app/users/user-list/user-item.component.html
@@ -12,7 +12,8 @@
-
+
diff --git a/static/src/environments/environment.e2e.ts b/static/src/environments/environment.e2e.ts
index 329b2ec..50f3955 100644
--- a/static/src/environments/environment.e2e.ts
+++ b/static/src/environments/environment.e2e.ts
@@ -1,4 +1,3 @@
-
export const environment = {
production: false,
e2eMode: true
diff --git a/static/src/index.html b/static/src/index.html
index d6dc0f8..8716323 100644
--- a/static/src/index.html
+++ b/static/src/index.html
@@ -9,6 +9,6 @@
- Loading...
+Loading...