clean up code according to lint
parent
996ea41224
commit
f764bd52d5
|
@ -1,4 +1,4 @@
|
||||||
import {Component} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {AppUser, Squad} from '../models/model-interfaces';
|
import {AppUser, Squad} from '../models/model-interfaces';
|
||||||
import {Observable} from 'rxjs/Observable';
|
import {Observable} from 'rxjs/Observable';
|
||||||
import {AppUserService} from '../services/app-user-service/app-user.service';
|
import {AppUserService} from '../services/app-user-service/app-user.service';
|
||||||
|
@ -11,7 +11,7 @@ import {Fraction} from '../utils/fraction.enum';
|
||||||
templateUrl: './admin.component.html',
|
templateUrl: './admin.component.html',
|
||||||
styleUrls: ['./admin.component.css', '../style/overview.css']
|
styleUrls: ['./admin.component.css', '../style/overview.css']
|
||||||
})
|
})
|
||||||
export class AdminComponent {
|
export class AdminComponent implements OnInit {
|
||||||
|
|
||||||
users$: Observable<AppUser[]>;
|
users$: Observable<AppUser[]>;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ export class AdminComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.appUserService.updateUser(updateObject)
|
this.appUserService.updateUser(updateObject)
|
||||||
.subscribe(user => {
|
.subscribe(resUser => {
|
||||||
this.showSuccessLabel = true;
|
this.showSuccessLabel = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.showSuccessLabel = false;
|
this.showSuccessLabel = false;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {NavigationEnd, NavigationStart, Router} from '@angular/router';
|
import {NavigationEnd, NavigationStart, Router} from '@angular/router';
|
||||||
import {LoginService} from './services/app-user-service/login-service';
|
import {LoginService} from './services/app-user-service/login-service';
|
||||||
import {PromotionService} from './services/army-management/promotion.service';
|
import {PromotionService} from './services/army-management/promotion.service';
|
||||||
|
@ -12,11 +12,11 @@ declare function require(url: string);
|
||||||
templateUrl: 'app.component.html',
|
templateUrl: 'app.component.html',
|
||||||
styleUrls: ['app.component.css', 'style/load-indicator.css']
|
styleUrls: ['app.component.css', 'style/load-indicator.css']
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent implements OnInit {
|
||||||
|
|
||||||
config = RouteConfig;
|
config = RouteConfig;
|
||||||
|
|
||||||
loading: boolean = false;
|
loading = false;
|
||||||
|
|
||||||
version = 'v' + require('./../../../package.json').version;
|
version = 'v' + require('./../../../package.json').version;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, Inject} from '@angular/core';
|
import {Component, Inject, OnDestroy, OnInit} from '@angular/core';
|
||||||
import {Award, User} from '../models/model-interfaces';
|
import {Award, User} from '../models/model-interfaces';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {UserService} from '../services/army-management/user.service';
|
import {UserService} from '../services/army-management/user.service';
|
||||||
|
@ -15,7 +15,7 @@ import {CSSHelpers} from '../global.helpers';
|
||||||
templateUrl: './army-member.component.html',
|
templateUrl: './army-member.component.html',
|
||||||
styleUrls: ['./army-member.component.css']
|
styleUrls: ['./army-member.component.css']
|
||||||
})
|
})
|
||||||
export class ArmyMemberComponent {
|
export class ArmyMemberComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
subscription: Subscription;
|
subscription: Subscription;
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ export class ArmyMemberComponent {
|
||||||
|
|
||||||
this.subscription = this.route.params
|
this.subscription = this.route.params
|
||||||
.map(params => params['id'])
|
.map(params => params['id'])
|
||||||
.filter(id => id != undefined)
|
.filter(id => id !== undefined)
|
||||||
.flatMap(id => this.userService.getUser(id))
|
.flatMap(id => this.userService.getUser(id))
|
||||||
.subscribe(user => {
|
.subscribe(user => {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, Inject} from '@angular/core';
|
import {Component, Inject, OnDestroy, OnInit} from '@angular/core';
|
||||||
import {Army} from '../models/model-interfaces';
|
import {Army} from '../models/model-interfaces';
|
||||||
import {ArmyService} from '../services/army-service/army.service';
|
import {ArmyService} from '../services/army-service/army.service';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
|
@ -13,7 +13,7 @@ import {CSSHelpers} from '../global.helpers';
|
||||||
templateUrl: './army.component.html',
|
templateUrl: './army.component.html',
|
||||||
styleUrls: ['./army.component.css']
|
styleUrls: ['./army.component.css']
|
||||||
})
|
})
|
||||||
export class ArmyComponent {
|
export class ArmyComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
army: Army = {BLUFOR: {squads: [], memberCount: 0}, OPFOR: {squads: [], memberCount: 0}};
|
army: Army = {BLUFOR: {squads: [], memberCount: 0}, OPFOR: {squads: [], memberCount: 0}};
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ import {FormGroup, NgForm} from '@angular/forms';
|
||||||
export class ShowErrorComponent {
|
export class ShowErrorComponent {
|
||||||
|
|
||||||
@Input('path') controlPath;
|
@Input('path') controlPath;
|
||||||
|
|
||||||
@Input('text') displayName = '';
|
@Input('text') displayName = '';
|
||||||
|
|
||||||
private form: FormGroup;
|
private form: FormGroup;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {ChangeDetectionStrategy, Component, EventEmitter} from '@angular/core';
|
import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||||
import {Decoration} from '../../models/model-interfaces';
|
import {Decoration} from '../../models/model-interfaces';
|
||||||
import {Fraction} from '../../utils/fraction.enum';
|
import {Fraction} from '../../utils/fraction.enum';
|
||||||
|
|
||||||
|
@ -6,19 +6,21 @@ import {Fraction} from '../../utils/fraction.enum';
|
||||||
selector: 'decoration-item',
|
selector: 'decoration-item',
|
||||||
templateUrl: './decoration-item.component.html',
|
templateUrl: './decoration-item.component.html',
|
||||||
styleUrls: ['./decoration-item.component.css', '../../style/list-entry.css'],
|
styleUrls: ['./decoration-item.component.css', '../../style/list-entry.css'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
inputs: ['decoration', 'selected'],
|
|
||||||
outputs: ['decorationDelete', 'decorationSelected'],
|
|
||||||
})
|
})
|
||||||
export class DecorationItemComponent {
|
export class DecorationItemComponent implements OnInit {
|
||||||
|
|
||||||
|
@Input() selected: boolean;
|
||||||
|
|
||||||
|
@Input() decoration: Decoration;
|
||||||
|
|
||||||
|
@Output() decorationSelected = new EventEmitter();
|
||||||
|
|
||||||
|
@Output() decorationDelete = new EventEmitter();
|
||||||
|
|
||||||
selected: boolean;
|
|
||||||
decoration: Decoration;
|
|
||||||
imageSrc;
|
imageSrc;
|
||||||
imgStyle = {width: '', height: '', marginTop: ''};
|
|
||||||
|
|
||||||
decorationSelected = new EventEmitter();
|
imgStyle = {width: '', height: '', marginTop: ''};
|
||||||
decorationDelete = new EventEmitter();
|
|
||||||
|
|
||||||
readonly fraction = Fraction;
|
readonly fraction = Fraction;
|
||||||
|
|
||||||
|
|
|
@ -60,13 +60,16 @@ export class DecorationListComponent implements OnInit {
|
||||||
|
|
||||||
deleteDecoration(decoration) {
|
deleteDecoration(decoration) {
|
||||||
let fraction = 'Global';
|
let fraction = 'Global';
|
||||||
if (decoration.fraction === 'BLUFOR') fraction = Fraction.BLUFOR;
|
if (decoration.fraction === 'BLUFOR') {
|
||||||
else if (decoration.fraction === 'OPFOR') fraction = Fraction.OPFOR;
|
fraction = Fraction.BLUFOR;
|
||||||
|
} else if (decoration.fraction === 'OPFOR') {
|
||||||
|
fraction = Fraction.OPFOR;
|
||||||
|
}
|
||||||
|
|
||||||
if (confirm('Soll die Auszeichnung "' + decoration.name + '" (' + fraction + ') wirklich gelöscht werden?')) {
|
if (confirm('Soll die Auszeichnung "' + decoration.name + '" (' + fraction + ') wirklich gelöscht werden?')) {
|
||||||
this.decorationService.deleteDecoration(decoration)
|
this.decorationService.deleteDecoration(decoration)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component} from "@angular/core";
|
import {Component} from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'decorations',
|
selector: 'decorations',
|
||||||
|
|
|
@ -27,5 +27,6 @@ export const decorationsRoutes: Routes = [{
|
||||||
|
|
||||||
export const decorationRoutesModule: ModuleWithProviders = RouterModule.forChild(decorationsRoutes);
|
export const decorationRoutesModule: ModuleWithProviders = RouterModule.forChild(decorationsRoutes);
|
||||||
|
|
||||||
export const decorationsRoutingComponents = [DecorationItemComponent, DecorationComponent, DecorationListComponent, EditDecorationComponent];
|
export const decorationsRoutingComponents = [DecorationItemComponent, DecorationComponent, DecorationListComponent,
|
||||||
|
EditDecorationComponent];
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, ViewChild} from '@angular/core';
|
import {Component, OnDestroy, OnInit, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {NgForm} from '@angular/forms';
|
import {NgForm} from '@angular/forms';
|
||||||
import {Decoration} from '../../models/model-interfaces';
|
import {Decoration} from '../../models/model-interfaces';
|
||||||
|
@ -10,7 +10,7 @@ import {Fraction} from '../../utils/fraction.enum';
|
||||||
templateUrl: './edit-decoration.component.html',
|
templateUrl: './edit-decoration.component.html',
|
||||||
styleUrls: ['./edit-decoration.component.css', '../../style/entry-form.css', '../../style/overview.css']
|
styleUrls: ['./edit-decoration.component.css', '../../style/entry-form.css', '../../style/overview.css']
|
||||||
})
|
})
|
||||||
export class EditDecorationComponent {
|
export class EditDecorationComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
subscription: Subscription;
|
subscription: Subscription;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ export class EditDecorationComponent {
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.subscription = this.route.params
|
this.subscription = this.route.params
|
||||||
.map(params => params['id'])
|
.map(params => params['id'])
|
||||||
.filter(id => id != undefined)
|
.filter(id => id !== undefined)
|
||||||
.flatMap(id => this.decorationService.getDecoration(id))
|
.flatMap(id => this.decorationService.getDecoration(id))
|
||||||
.subscribe(decoration => {
|
.subscribe(decoration => {
|
||||||
this.decoration = decoration;
|
this.decoration = decoration;
|
||||||
|
|
|
@ -15,7 +15,7 @@ export class FilterRankPipe implements PipeTransform {
|
||||||
if (res.length === 0) {
|
if (res.length === 0) {
|
||||||
return [{name: '-'}];
|
return [{name: '-'}];
|
||||||
} else {
|
} else {
|
||||||
return res
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, ViewChild} from '@angular/core';
|
import {Component, OnDestroy, OnInit, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {NgForm} from '@angular/forms';
|
import {NgForm} from '@angular/forms';
|
||||||
import {Rank} from '../../models/model-interfaces';
|
import {Rank} from '../../models/model-interfaces';
|
||||||
|
@ -11,7 +11,7 @@ import {Fraction} from '../../utils/fraction.enum';
|
||||||
templateUrl: './edit-rank.component.html',
|
templateUrl: './edit-rank.component.html',
|
||||||
styleUrls: ['./edit-rank.component.css', '../../style/entry-form.css', '../../style/overview.css']
|
styleUrls: ['./edit-rank.component.css', '../../style/entry-form.css', '../../style/overview.css']
|
||||||
})
|
})
|
||||||
export class EditRankComponent {
|
export class EditRankComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
subscription: Subscription;
|
subscription: Subscription;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {ChangeDetectionStrategy, Component, EventEmitter} from '@angular/core';
|
import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||||
import {Rank} from '../../models/model-interfaces';
|
import {Rank} from '../../models/model-interfaces';
|
||||||
import {Fraction} from '../../utils/fraction.enum';
|
import {Fraction} from '../../utils/fraction.enum';
|
||||||
|
|
||||||
|
@ -6,19 +6,20 @@ import {Fraction} from '../../utils/fraction.enum';
|
||||||
selector: 'pjm-rank-item',
|
selector: 'pjm-rank-item',
|
||||||
templateUrl: './rank-item.component.html',
|
templateUrl: './rank-item.component.html',
|
||||||
styleUrls: ['./rank-item.component.css', '../../style/list-entry.css'],
|
styleUrls: ['./rank-item.component.css', '../../style/list-entry.css'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
inputs: ['rank', 'selected'],
|
|
||||||
outputs: ['rankSelected', 'rankDelete'],
|
|
||||||
})
|
})
|
||||||
export class RankItemComponent {
|
export class RankItemComponent implements OnInit {
|
||||||
|
|
||||||
|
@Input() selected: boolean;
|
||||||
|
|
||||||
|
@Input() rank: Rank;
|
||||||
|
|
||||||
|
@Output() rankSelected = new EventEmitter();
|
||||||
|
|
||||||
|
@Output() rankDelete = new EventEmitter();
|
||||||
|
|
||||||
selected: boolean;
|
|
||||||
rank: Rank;
|
|
||||||
imageSrc;
|
imageSrc;
|
||||||
|
|
||||||
rankSelected = new EventEmitter();
|
|
||||||
rankDelete = new EventEmitter();
|
|
||||||
|
|
||||||
readonly fraction = Fraction;
|
readonly fraction = Fraction;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component} from "@angular/core";
|
import {Component} from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ranks',
|
selector: 'ranks',
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, ViewChild} from '@angular/core';
|
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {Award, Decoration, User} from '../../models/model-interfaces';
|
import {Award, Decoration, User} from '../../models/model-interfaces';
|
||||||
import {NgForm} from '@angular/forms';
|
import {NgForm} from '@angular/forms';
|
||||||
|
@ -12,7 +12,7 @@ import {LoginService} from '../../services/app-user-service/login-service';
|
||||||
templateUrl: './req-award.component.html',
|
templateUrl: './req-award.component.html',
|
||||||
styleUrls: ['./req-award.component.css', '../../style/overview.css'],
|
styleUrls: ['./req-award.component.css', '../../style/overview.css'],
|
||||||
})
|
})
|
||||||
export class RequestAwardComponent {
|
export class RequestAwardComponent implements OnInit {
|
||||||
|
|
||||||
@ViewChild(NgForm) form: NgForm;
|
@ViewChild(NgForm) form: NgForm;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ export class RequestAwardComponent {
|
||||||
|
|
||||||
decoration: Decoration = {_id: '0'};
|
decoration: Decoration = {_id: '0'};
|
||||||
|
|
||||||
reason: string = '';
|
reason = '';
|
||||||
|
|
||||||
decorations: Decoration[];
|
decorations: Decoration[];
|
||||||
|
|
||||||
|
@ -96,9 +96,9 @@ export class RequestAwardComponent {
|
||||||
this.showSuccessLabel = true;
|
this.showSuccessLabel = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.showSuccessLabel = false;
|
this.showSuccessLabel = false;
|
||||||
}, 2000)
|
}, 2000);
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {Award} from '../../models/model-interfaces';
|
import {Award} from '../../models/model-interfaces';
|
||||||
import {AwardingService} from '../../services/army-management/awarding.service';
|
import {AwardingService} from '../../services/army-management/awarding.service';
|
||||||
import {LoginService} from '../../services/app-user-service/login-service';
|
import {LoginService} from '../../services/app-user-service/login-service';
|
||||||
|
@ -8,7 +8,7 @@ import {LoginService} from '../../services/app-user-service/login-service';
|
||||||
templateUrl: './confirm-award.component.html',
|
templateUrl: './confirm-award.component.html',
|
||||||
styleUrls: ['./confirm-award.component.css', '../../style/overview.css'],
|
styleUrls: ['./confirm-award.component.css', '../../style/overview.css'],
|
||||||
})
|
})
|
||||||
export class ConfirmAwardComponent {
|
export class ConfirmAwardComponent implements OnInit {
|
||||||
|
|
||||||
awards: Award[];
|
awards: Award[];
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ export class ConfirmAwardComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
let currentUser = this.loginService.getCurrentUser();
|
const currentUser = this.loginService.getCurrentUser();
|
||||||
this.awardingService.getUnconfirmedAwards(currentUser.squad.fraction).subscribe(awards => {
|
this.awardingService.getUnconfirmedAwards(currentUser.squad.fraction).subscribe(awards => {
|
||||||
this.awards = awards;
|
this.awards = awards;
|
||||||
});
|
});
|
||||||
|
@ -32,7 +32,7 @@ export class ConfirmAwardComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.awardingService.updateAward(updateObject).subscribe(res => {
|
this.awardingService.updateAward(updateObject).subscribe(res => {
|
||||||
let currentUser = this.loginService.getCurrentUser();
|
const currentUser = this.loginService.getCurrentUser();
|
||||||
this.awardingService.getUnconfirmedAwards(currentUser.squad.fraction).subscribe(awards => {
|
this.awardingService.getUnconfirmedAwards(currentUser.squad.fraction).subscribe(awards => {
|
||||||
this.awards = awards;
|
this.awards = awards;
|
||||||
if (awards.length < 1) {
|
if (awards.length < 1) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {Promotion, Rank} from '../../models/model-interfaces';
|
import {Promotion, Rank} from '../../models/model-interfaces';
|
||||||
import {RankService} from '../../services/army-management/rank.service';
|
import {RankService} from '../../services/army-management/rank.service';
|
||||||
import {PromotionService} from '../../services/army-management/promotion.service';
|
import {PromotionService} from '../../services/army-management/promotion.service';
|
||||||
|
@ -9,7 +9,7 @@ import {LoginService} from '../../services/app-user-service/login-service';
|
||||||
templateUrl: './confirm-promotion.component.html',
|
templateUrl: './confirm-promotion.component.html',
|
||||||
styleUrls: ['./confirm-promotion.component.css', '../../style/overview.css'],
|
styleUrls: ['./confirm-promotion.component.css', '../../style/overview.css'],
|
||||||
})
|
})
|
||||||
export class ConfirmPromotionComponent {
|
export class ConfirmPromotionComponent implements OnInit {
|
||||||
|
|
||||||
showSuccessLabel = false;
|
showSuccessLabel = false;
|
||||||
|
|
||||||
|
@ -23,15 +23,14 @@ export class ConfirmPromotionComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
let currentUser = this.loginService.getCurrentUser();
|
const currentUser = this.loginService.getCurrentUser();
|
||||||
// show only current users fraction promotions
|
// show only current users fraction promotions
|
||||||
this.rankService.findRanks('', currentUser.squad.fraction).subscribe(ranks => {
|
this.rankService.findRanks('', currentUser.squad.fraction).subscribe(ranks => {
|
||||||
this.ranks = ranks;
|
this.ranks = ranks;
|
||||||
});
|
});
|
||||||
this.promotionService.getUnconfirmedPromotions(currentUser.squad.fraction).subscribe(promotions => {
|
this.promotionService.getUnconfirmedPromotions(currentUser.squad.fraction).subscribe(promotions => {
|
||||||
this.promotions = promotions;
|
this.promotions = promotions;
|
||||||
})
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
confirm(promotion: Promotion, decision: boolean) {
|
confirm(promotion: Promotion, decision: boolean) {
|
||||||
|
@ -41,7 +40,7 @@ export class ConfirmPromotionComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.promotionService.updatePromotion(updateObject).subscribe(res => {
|
this.promotionService.updatePromotion(updateObject).subscribe(res => {
|
||||||
let currentUser = this.loginService.getCurrentUser();
|
const currentUser = this.loginService.getCurrentUser();
|
||||||
this.promotionService.getUnconfirmedPromotions(currentUser.squad.fraction).subscribe(promotions => {
|
this.promotionService.getUnconfirmedPromotions(currentUser.squad.fraction).subscribe(promotions => {
|
||||||
this.promotions = promotions;
|
this.promotions = promotions;
|
||||||
if (promotions.length < 1) {
|
if (promotions.length < 1) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, ViewChild} from '@angular/core';
|
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {Rank, User} from '../../models/model-interfaces';
|
import {Rank, User} from '../../models/model-interfaces';
|
||||||
import {NgForm} from '@angular/forms';
|
import {NgForm} from '@angular/forms';
|
||||||
|
@ -12,7 +12,7 @@ import {LoginService} from '../../services/app-user-service/login-service';
|
||||||
templateUrl: './req-promotion.component.html',
|
templateUrl: './req-promotion.component.html',
|
||||||
styleUrls: ['./req-promotion.component.css', '../../style/overview.css'],
|
styleUrls: ['./req-promotion.component.css', '../../style/overview.css'],
|
||||||
})
|
})
|
||||||
export class RequestPromotionComponent {
|
export class RequestPromotionComponent implements OnInit {
|
||||||
|
|
||||||
@ViewChild(NgForm) form: NgForm;
|
@ViewChild(NgForm) form: NgForm;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component} from "@angular/core";
|
import {Component} from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'request',
|
selector: 'request',
|
||||||
|
|
|
@ -32,7 +32,7 @@ export class UserService {
|
||||||
searchParams.append('offset', offset);
|
searchParams.append('offset', offset);
|
||||||
this.http.get(this.config.apiUserPath, searchParams)
|
this.http.get(this.config.apiUserPath, searchParams)
|
||||||
.do((res) => {
|
.do((res) => {
|
||||||
let headerCount = parseInt(res.headers.get('x-total-count'));
|
const headerCount = parseInt(res.headers.get('x-total-count'), 10);
|
||||||
if (headerCount) {
|
if (headerCount) {
|
||||||
this.totalCount = headerCount;
|
this.totalCount = headerCount;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {Injectable} from "@angular/core";
|
import {Injectable} from '@angular/core';
|
||||||
import {AppConfig} from "../../app.config";
|
import {AppConfig} from '../../app.config';
|
||||||
import {Http} from "@angular/http";
|
import {Http} from '@angular/http';
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {BehaviorSubject} from "rxjs/BehaviorSubject";
|
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
|
||||||
|
|
||||||
export const LOAD = 'LOAD';
|
export const LOAD = 'LOAD';
|
||||||
export const ADD = 'ADD';
|
export const ADD = 'ADD';
|
||||||
|
@ -29,7 +29,7 @@ export class Store<T extends Identifiable> {
|
||||||
return [...items, action.data];
|
return [...items, action.data];
|
||||||
case EDIT:
|
case EDIT:
|
||||||
return items.map(task => {
|
return items.map(task => {
|
||||||
var editedTask = action.data;
|
const editedTask = action.data;
|
||||||
if (task.id !== editedTask.id) {
|
if (task.id !== editedTask.id) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {NgModule} from '@angular/core';
|
import {NgModule} from '@angular/core';
|
||||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {ShowErrorComponent} from "./common/show-error/show-error.component";
|
import {ShowErrorComponent} from './common/show-error/show-error.component';
|
||||||
import {CommonModule} from "@angular/common";
|
import {CommonModule} from '@angular/common';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [ShowErrorComponent],
|
declarations: [ShowErrorComponent],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, ViewChild} from '@angular/core';
|
import {Component, OnDestroy, OnInit, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {NgForm} from '@angular/forms';
|
import {NgForm} from '@angular/forms';
|
||||||
import {Squad} from '../../models/model-interfaces';
|
import {Squad} from '../../models/model-interfaces';
|
||||||
|
@ -11,7 +11,7 @@ import {Fraction} from '../../utils/fraction.enum';
|
||||||
templateUrl: './edit-squad.component.html',
|
templateUrl: './edit-squad.component.html',
|
||||||
styleUrls: ['./edit-squad.component.css', '../../style/entry-form.css', '../../style/overview.css']
|
styleUrls: ['./edit-squad.component.css', '../../style/entry-form.css', '../../style/overview.css']
|
||||||
})
|
})
|
||||||
export class EditSquadComponent {
|
export class EditSquadComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
subscription: Subscription;
|
subscription: Subscription;
|
||||||
|
|
||||||
|
@ -88,8 +88,8 @@ export class EditSquadComponent {
|
||||||
this.showSuccessLabel = true;
|
this.showSuccessLabel = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.showSuccessLabel = false;
|
this.showSuccessLabel = false;
|
||||||
}, 2000)
|
}, 2000);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {ChangeDetectionStrategy, Component, EventEmitter} from '@angular/core';
|
import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||||
import {Squad} from '../../models/model-interfaces';
|
import {Squad} from '../../models/model-interfaces';
|
||||||
import {Fraction} from '../../utils/fraction.enum';
|
import {Fraction} from '../../utils/fraction.enum';
|
||||||
|
|
||||||
|
@ -6,17 +6,17 @@ import {Fraction} from '../../utils/fraction.enum';
|
||||||
selector: 'pjm-squad-item',
|
selector: 'pjm-squad-item',
|
||||||
templateUrl: './squad-item.component.html',
|
templateUrl: './squad-item.component.html',
|
||||||
styleUrls: ['./squad-item.component.css', '../../style/list-entry.css'],
|
styleUrls: ['./squad-item.component.css', '../../style/list-entry.css'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
inputs: ['squad', 'selected'],
|
|
||||||
outputs: ['squadSelected', 'squadDelete'],
|
|
||||||
})
|
})
|
||||||
export class SquadItemComponent {
|
export class SquadItemComponent implements OnInit {
|
||||||
|
|
||||||
selected: boolean;
|
@Input() selected: boolean;
|
||||||
squad: Squad;
|
|
||||||
|
|
||||||
squadSelected = new EventEmitter();
|
@Input() squad: Squad;
|
||||||
squadDelete = new EventEmitter();
|
|
||||||
|
@Output() squadSelected = new EventEmitter();
|
||||||
|
|
||||||
|
@Output() squadDelete = new EventEmitter();
|
||||||
|
|
||||||
imageSrc;
|
imageSrc;
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ export class SquadListComponent implements OnInit {
|
||||||
if (confirm('Soll das Squad "' + squad.name + '" (' + fraction + ') wirklich gelöscht werden?')) {
|
if (confirm('Soll das Squad "' + squad.name + '" (' + fraction + ') wirklich gelöscht werden?')) {
|
||||||
this.squadService.deleteSquad(squad)
|
this.squadService.deleteSquad(squad)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||||
import {CampaignPlayer} from '../../models/model-interfaces';
|
import {CampaignPlayer} from '../../models/model-interfaces';
|
||||||
import {PlayerService} from '../../services/logs/player.service';
|
import {PlayerService} from '../../services/logs/player.service';
|
||||||
import {ChartUtils} from '../../utils/chart-utils';
|
import {ChartUtils} from '../../utils/chart-utils';
|
||||||
|
@ -10,7 +10,7 @@ import {ChartUtils} from '../../utils/chart-utils';
|
||||||
styleUrls: ['./campaign-player-detail.component.css', '../../style/list-entry.css',
|
styleUrls: ['./campaign-player-detail.component.css', '../../style/list-entry.css',
|
||||||
'../../style/hide-scrollbar.css', '../../style/overview.css']
|
'../../style/hide-scrollbar.css', '../../style/overview.css']
|
||||||
})
|
})
|
||||||
export class CampaignPlayerDetailComponent {
|
export class CampaignPlayerDetailComponent implements OnInit {
|
||||||
|
|
||||||
@Input() campaignId: string;
|
@Input() campaignId: string;
|
||||||
|
|
||||||
|
@ -132,7 +132,8 @@ export class CampaignPlayerDetailComponent {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.vehicleKillData, this.deathData, this.respawnData, this.reviveData, this.captureData]);
|
Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.vehicleKillData,
|
||||||
|
this.deathData, this.respawnData, this.reviveData, this.captureData]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component} from '@angular/core';
|
import {Component, Input, OnInit} from '@angular/core';
|
||||||
import {ActivatedRoute} from '@angular/router';
|
import {ActivatedRoute} from '@angular/router';
|
||||||
import {PlayerService} from '../../services/logs/player.service';
|
import {PlayerService} from '../../services/logs/player.service';
|
||||||
import {CampaignService} from '../../services/logs/campaign.service';
|
import {CampaignService} from '../../services/logs/campaign.service';
|
||||||
|
@ -11,10 +11,11 @@ import {Player} from '../../models/model-interfaces';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'stats-highscore',
|
selector: 'stats-highscore',
|
||||||
templateUrl: './highscore.component.html',
|
templateUrl: './highscore.component.html',
|
||||||
styleUrls: ['./highscore.component.css', '../../style/list-entry.css', '../../style/overview.css'],
|
styleUrls: ['./highscore.component.css', '../../style/list-entry.css', '../../style/overview.css']
|
||||||
inputs: ['campaigns']
|
|
||||||
})
|
})
|
||||||
export class StatisticHighScoreComponent {
|
export class StatisticHighScoreComponent implements OnInit {
|
||||||
|
|
||||||
|
@Input() campaigns;
|
||||||
|
|
||||||
id = '';
|
id = '';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, Input} from '@angular/core';
|
import {Component, Input, OnInit} from '@angular/core';
|
||||||
import {ActivatedRoute} from '@angular/router';
|
import {ActivatedRoute} from '@angular/router';
|
||||||
import {CampaignService} from '../../services/logs/campaign.service';
|
import {CampaignService} from '../../services/logs/campaign.service';
|
||||||
import {ChartUtils} from '../../utils/chart-utils';
|
import {ChartUtils} from '../../utils/chart-utils';
|
||||||
|
@ -10,7 +10,7 @@ import {Fraction} from '../../utils/fraction.enum';
|
||||||
templateUrl: './stats-overview.component.html',
|
templateUrl: './stats-overview.component.html',
|
||||||
styleUrls: ['./stats-overview.component.css', '../../style/list-entry.css', '../../style/overview.css']
|
styleUrls: ['./stats-overview.component.css', '../../style/list-entry.css', '../../style/overview.css']
|
||||||
})
|
})
|
||||||
export class StatisticOverviewComponent {
|
export class StatisticOverviewComponent implements OnInit {
|
||||||
|
|
||||||
@Input() campaigns;
|
@Input() campaigns;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component} from "@angular/core";
|
import {Component} from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'stats',
|
selector: 'stats',
|
||||||
|
|
|
@ -51,7 +51,7 @@ export const statsRoutes: Routes = [{
|
||||||
path: 'campaign-player/:id/:playerName',
|
path: 'campaign-player/:id/:playerName',
|
||||||
component: CampaignPlayerDetailComponent,
|
component: CampaignPlayerDetailComponent,
|
||||||
outlet: 'right'
|
outlet: 'right'
|
||||||
},];
|
}];
|
||||||
|
|
||||||
export const statsRouterModule: ModuleWithProviders = RouterModule.forChild(statsRoutes);
|
export const statsRouterModule: ModuleWithProviders = RouterModule.forChild(statsRoutes);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, ElementRef, Input, SimpleChanges, ViewChild} from '@angular/core';
|
import {Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core';
|
||||||
import * as d3 from 'd3';
|
import * as d3 from 'd3';
|
||||||
import {ChartUtils} from '../../../utils/chart-utils';
|
import {ChartUtils} from '../../../utils/chart-utils';
|
||||||
import {Fraction} from '../../../utils/fraction.enum';
|
import {Fraction} from '../../../utils/fraction.enum';
|
||||||
|
@ -10,7 +10,7 @@ import {War} from '../../../models/model-interfaces';
|
||||||
templateUrl: './fraction-stats.component.html',
|
templateUrl: './fraction-stats.component.html',
|
||||||
styleUrls: ['./fraction-stats.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
|
styleUrls: ['./fraction-stats.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
|
||||||
})
|
})
|
||||||
export class FractionStatsComponent {
|
export class FractionStatsComponent implements OnInit, OnChanges {
|
||||||
|
|
||||||
readonly fraction = Fraction;
|
readonly fraction = Fraction;
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ export class FractionStatsComponent {
|
||||||
const fractionChange = budgetEntry.fraction === 'BLUFOR' ? 0 : 1;
|
const fractionChange = budgetEntry.fraction === 'BLUFOR' ? 0 : 1;
|
||||||
const fractionOld = budgetEntry.fraction !== 'BLUFOR' ? 0 : 1;
|
const fractionOld = budgetEntry.fraction !== 'BLUFOR' ? 0 : 1;
|
||||||
|
|
||||||
if (FractionStatsComponent.isTwoMinutesAhead(budgetEntryDate, this.tmpBudgetData)) {
|
if (this.isTwoMinutesAhead(budgetEntryDate, this.tmpBudgetData)) {
|
||||||
this.tmpBudgetData[fractionChange].series.push(ChartUtils.getSeriesEntry(new Date(budgetEntry.time), budgetEntry.newBudget));
|
this.tmpBudgetData[fractionChange].series.push(ChartUtils.getSeriesEntry(new Date(budgetEntry.time), budgetEntry.newBudget));
|
||||||
this.tmpBudgetData[fractionOld].series.push(ChartUtils.getSeriesEntry(new Date(budgetEntry.time),
|
this.tmpBudgetData[fractionOld].series.push(ChartUtils.getSeriesEntry(new Date(budgetEntry.time),
|
||||||
this.tmpBudgetData[fractionOld].series[this.tmpBudgetData[fractionOld].series.length - 1].value));
|
this.tmpBudgetData[fractionOld].series[this.tmpBudgetData[fractionOld].series.length - 1].value));
|
||||||
|
@ -177,7 +177,7 @@ export class FractionStatsComponent {
|
||||||
}
|
}
|
||||||
let killCountBlufor = 0, killCountOpfor = 0, ffKillCountBlufor = 0, ffKillCountOpfor = 0;
|
let killCountBlufor = 0, killCountOpfor = 0, ffKillCountBlufor = 0, ffKillCountOpfor = 0;
|
||||||
|
|
||||||
for (const {killEntry, index} of this.logData.kill.map((killEntry, index) => ({killEntry, index}))) {
|
for (const {killEntry, index} of this.logData.kill.map((entry, pos) => ({entry, pos}))) {
|
||||||
const killEntryDate = new Date(killEntry.time);
|
const killEntryDate = new Date(killEntry.time);
|
||||||
if (killEntry.friendlyFire === false) {
|
if (killEntry.friendlyFire === false) {
|
||||||
if (killEntry.fraction === 'BLUFOR') {
|
if (killEntry.fraction === 'BLUFOR') {
|
||||||
|
@ -186,7 +186,7 @@ export class FractionStatsComponent {
|
||||||
if (killEntry.fraction === 'OPFOR') {
|
if (killEntry.fraction === 'OPFOR') {
|
||||||
killCountOpfor++;
|
killCountOpfor++;
|
||||||
}
|
}
|
||||||
if (FractionStatsComponent.isTwoMinutesAhead(killEntryDate, this.tmpKillData)) {
|
if (this.isTwoMinutesAhead(killEntryDate, this.tmpKillData)) {
|
||||||
this.tmpKillData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountBlufor));
|
this.tmpKillData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountBlufor));
|
||||||
this.tmpKillData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountOpfor));
|
this.tmpKillData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountOpfor));
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ export class FractionStatsComponent {
|
||||||
if (killEntry.fraction === 'OPFOR') {
|
if (killEntry.fraction === 'OPFOR') {
|
||||||
ffKillCountOpfor++;
|
ffKillCountOpfor++;
|
||||||
}
|
}
|
||||||
if (FractionStatsComponent.isTwoMinutesAhead(killEntryDate, this.tmpFrienlyFireData)) {
|
if (this.isTwoMinutesAhead(killEntryDate, this.tmpFrienlyFireData)) {
|
||||||
this.tmpFrienlyFireData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountBlufor));
|
this.tmpFrienlyFireData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountBlufor));
|
||||||
this.tmpFrienlyFireData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountOpfor));
|
this.tmpFrienlyFireData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountOpfor));
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@ export class FractionStatsComponent {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let reviveCountBlufor = 0, reviveCountOpfor = 0, stabilizeCountBlufor = 0, stabilizeCountOpfor = 0;
|
let reviveCountBlufor = 0, reviveCountOpfor = 0, stabilizeCountBlufor = 0, stabilizeCountOpfor = 0;
|
||||||
for (const {reviveEntry, index} of this.logData.revive.map((reviveEntry, index) => ({reviveEntry, index}))) {
|
for (const {reviveEntry, index} of this.logData.revive.map((entry, pos) => ({entry, pos}))) {
|
||||||
const reviveEntryDate = new Date(reviveEntry.time);
|
const reviveEntryDate = new Date(reviveEntry.time);
|
||||||
if (reviveEntry.stabilized === false) {
|
if (reviveEntry.stabilized === false) {
|
||||||
if (reviveEntry.fraction === 'BLUFOR') {
|
if (reviveEntry.fraction === 'BLUFOR') {
|
||||||
|
@ -228,7 +228,7 @@ export class FractionStatsComponent {
|
||||||
} else {
|
} else {
|
||||||
reviveCountOpfor++;
|
reviveCountOpfor++;
|
||||||
}
|
}
|
||||||
if (FractionStatsComponent.isTwoMinutesAhead(reviveEntryDate, this.tmpReviveData)) {
|
if (this.isTwoMinutesAhead(reviveEntryDate, this.tmpReviveData)) {
|
||||||
this.tmpReviveData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountBlufor));
|
this.tmpReviveData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountBlufor));
|
||||||
this.tmpReviveData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountOpfor));
|
this.tmpReviveData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountOpfor));
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,7 @@ export class FractionStatsComponent {
|
||||||
} else {
|
} else {
|
||||||
stabilizeCountOpfor++;
|
stabilizeCountOpfor++;
|
||||||
}
|
}
|
||||||
if (FractionStatsComponent.isTwoMinutesAhead(reviveEntryDate, this.tmpStabilizeData)) {
|
if (this.isTwoMinutesAhead(reviveEntryDate, this.tmpStabilizeData)) {
|
||||||
this.tmpStabilizeData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountBlufor));
|
this.tmpStabilizeData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountBlufor));
|
||||||
this.tmpStabilizeData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountOpfor));
|
this.tmpStabilizeData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountOpfor));
|
||||||
}
|
}
|
||||||
|
@ -260,8 +260,8 @@ export class FractionStatsComponent {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let vehicleKillCountBlufor = 0, vehicleKillCountOpfor = 0;
|
let vehicleKillCountBlufor = 0, vehicleKillCountOpfor = 0;
|
||||||
for (const {transportEntry: vehicleEntry, index} of this.logData.vehicle.map((transportEntry, index) => ({
|
for (const {transportEntry: vehicleEntry, index} of this.logData.vehicle.map((entry, pos) => ({
|
||||||
transportEntry,
|
pos,
|
||||||
index
|
index
|
||||||
}))) {
|
}))) {
|
||||||
const vehicleEntryDate = new Date(vehicleEntry.time);
|
const vehicleEntryDate = new Date(vehicleEntry.time);
|
||||||
|
@ -270,7 +270,7 @@ export class FractionStatsComponent {
|
||||||
} else {
|
} else {
|
||||||
vehicleKillCountOpfor++;
|
vehicleKillCountOpfor++;
|
||||||
}
|
}
|
||||||
if (FractionStatsComponent.isTwoMinutesAhead(vehicleEntryDate, this.tmpVehicleData) || index === this.logData.vehicle.length - 1) {
|
if (this.isTwoMinutesAhead(vehicleEntryDate, this.tmpVehicleData) || index === this.logData.vehicle.length - 1) {
|
||||||
this.tmpVehicleData[0].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountBlufor));
|
this.tmpVehicleData[0].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountBlufor));
|
||||||
this.tmpVehicleData[1].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountOpfor));
|
this.tmpVehicleData[1].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountOpfor));
|
||||||
}
|
}
|
||||||
|
@ -284,9 +284,9 @@ export class FractionStatsComponent {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let transportCountBlufor = 0, transportCountOpfor = 0;
|
let transportCountBlufor = 0, transportCountOpfor = 0;
|
||||||
for (const {transportEntry, index} of this.logData.transport.map((transportEntry, index) => ({
|
for (const {transportEntry, index} of this.logData.transport.map((entry, pos) => ({
|
||||||
transportEntry,
|
entry,
|
||||||
index
|
pos
|
||||||
}))) {
|
}))) {
|
||||||
const transportEntryDate = new Date(transportEntry.time);
|
const transportEntryDate = new Date(transportEntry.time);
|
||||||
if (transportEntry.fraction === 'BLUFOR') {
|
if (transportEntry.fraction === 'BLUFOR') {
|
||||||
|
@ -294,7 +294,7 @@ export class FractionStatsComponent {
|
||||||
} else {
|
} else {
|
||||||
transportCountOpfor++;
|
transportCountOpfor++;
|
||||||
}
|
}
|
||||||
if (FractionStatsComponent.isTwoMinutesAhead(transportEntryDate, this.tmpTransportData) || index === this.logData.transport.length - 1) {
|
if (this.isTwoMinutesAhead(transportEntryDate, this.tmpTransportData) || index === this.logData.transport.length - 1) {
|
||||||
this.tmpTransportData[0].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountBlufor));
|
this.tmpTransportData[0].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountBlufor));
|
||||||
this.tmpTransportData[1].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountOpfor));
|
this.tmpTransportData[1].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountOpfor));
|
||||||
}
|
}
|
||||||
|
@ -327,7 +327,7 @@ export class FractionStatsComponent {
|
||||||
this.initialized.flag = true;
|
this.initialized.flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static isTwoMinutesAhead(entryDate: Date, tmpData: any): boolean {
|
protected isTwoMinutesAhead(entryDate: Date, tmpData: any): boolean {
|
||||||
return entryDate.getTime() >= tmpData[0].series[tmpData[0].series.length - 1].name.getTime() + (1.5 * 60000);
|
return entryDate.getTime() >= tmpData[0].series[tmpData[0].series.length - 1].name.getTime() + (1.5 * 60000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,7 +342,8 @@ export class FractionStatsComponent {
|
||||||
this.tmpStabilizeData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
this.tmpStabilizeData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||||
this.tmpFlagCaptureData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
this.tmpFlagCaptureData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||||
|
|
||||||
[this.tmpKillData, this.tmpFrienlyFireData, this.tmpVehicleData, this.tmpReviveData, this.tmpStabilizeData, this.tmpTransportData].forEach(tmp => {
|
[this.tmpKillData, this.tmpFrienlyFireData, this.tmpVehicleData, this.tmpReviveData, this.tmpStabilizeData,
|
||||||
|
this.tmpTransportData].forEach(tmp => {
|
||||||
[0, 1].forEach(index => {
|
[0, 1].forEach(index => {
|
||||||
tmp[index].series.push(ChartUtils.getSeriesEntry(this.startDateObj, 0));
|
tmp[index].series.push(ChartUtils.getSeriesEntry(this.startDateObj, 0));
|
||||||
});
|
});
|
||||||
|
@ -359,7 +360,8 @@ export class FractionStatsComponent {
|
||||||
} else {
|
} else {
|
||||||
for (const j in [0, 1]) {
|
for (const j in [0, 1]) {
|
||||||
if (tmpCollection[j].series[tmpCollection[j].series.length - 1].name < endDate) {
|
if (tmpCollection[j].series[tmpCollection[j].series.length - 1].name < endDate) {
|
||||||
tmpCollection[j].series.push(ChartUtils.getSeriesEntry(endDate, tmpCollection[j].series[tmpCollection[j].series.length - 1].value));
|
tmpCollection[j].series.push(ChartUtils.getSeriesEntry(endDate, tmpCollection[j]
|
||||||
|
.series[tmpCollection[j].series.length - 1].value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, ElementRef, EventEmitter, Input, Output, SimpleChanges} from '@angular/core';
|
import {Component, ElementRef, EventEmitter, Input, OnChanges, Output, SimpleChanges} from '@angular/core';
|
||||||
import {War} from '../../../models/model-interfaces';
|
import {War} from '../../../models/model-interfaces';
|
||||||
import {Fraction} from '../../../utils/fraction.enum';
|
import {Fraction} from '../../../utils/fraction.enum';
|
||||||
import {PlayerUtils} from '../../../utils/player-utils';
|
import {PlayerUtils} from '../../../utils/player-utils';
|
||||||
|
@ -8,7 +8,7 @@ import {PlayerUtils} from '../../../utils/player-utils';
|
||||||
templateUrl: './scoreboard.component.html',
|
templateUrl: './scoreboard.component.html',
|
||||||
styleUrls: ['./scoreboard.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
|
styleUrls: ['./scoreboard.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
|
||||||
})
|
})
|
||||||
export class ScoreboardComponent {
|
export class ScoreboardComponent implements OnChanges {
|
||||||
|
|
||||||
readonly fraction = Fraction;
|
readonly fraction = Fraction;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ export class ScoreboardComponent {
|
||||||
|
|
||||||
rows = [];
|
rows = [];
|
||||||
|
|
||||||
reorderable: boolean = false;
|
reorderable = false;
|
||||||
|
|
||||||
customClasses = {
|
customClasses = {
|
||||||
sortAscending: 'glyphicon glyphicon-triangle-top',
|
sortAscending: 'glyphicon glyphicon-triangle-top',
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {ActivatedRoute} from '@angular/router';
|
import {ActivatedRoute} from '@angular/router';
|
||||||
import {WarService} from '../../services/logs/war.service';
|
import {WarService} from '../../services/logs/war.service';
|
||||||
import {War} from '../../models/model-interfaces';
|
import {War} from '../../models/model-interfaces';
|
||||||
|
@ -12,7 +12,7 @@ import {LogsService} from '../../services/logs/logs.service';
|
||||||
templateUrl: './war-detail.component.html',
|
templateUrl: './war-detail.component.html',
|
||||||
styleUrls: ['./war-detail.component.css', '../../style/list-entry.css', '../../style/hide-scrollbar.css']
|
styleUrls: ['./war-detail.component.css', '../../style/list-entry.css', '../../style/hide-scrollbar.css']
|
||||||
})
|
})
|
||||||
export class WarDetailComponent {
|
export class WarDetailComponent implements OnInit {
|
||||||
|
|
||||||
readonly fraction = Fraction;
|
readonly fraction = Fraction;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {ChangeDetectionStrategy, Component, EventEmitter} from '@angular/core';
|
import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||||
import {War} from '../../models/model-interfaces';
|
import {War} from '../../models/model-interfaces';
|
||||||
import {LoginService} from '../../services/app-user-service/login-service';
|
import {LoginService} from '../../services/app-user-service/login-service';
|
||||||
|
|
||||||
|
@ -6,19 +6,17 @@ import {LoginService} from '../../services/app-user-service/login-service';
|
||||||
selector: 'pjm-war-item',
|
selector: 'pjm-war-item',
|
||||||
templateUrl: './war-item.component.html',
|
templateUrl: './war-item.component.html',
|
||||||
styleUrls: ['./war-item.component.css', '../../style/list-entry.css'],
|
styleUrls: ['./war-item.component.css', '../../style/list-entry.css'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
inputs: ['war', 'selected'],
|
|
||||||
outputs: ['warSelected', 'warDelete']
|
|
||||||
})
|
})
|
||||||
export class WarItemComponent {
|
export class WarItemComponent implements OnInit {
|
||||||
|
|
||||||
selected: boolean;
|
@Input() selected: boolean;
|
||||||
|
|
||||||
war: War;
|
@Input() war: War;
|
||||||
|
|
||||||
warSelected = new EventEmitter();
|
@Output() warSelected = new EventEmitter();
|
||||||
|
|
||||||
warDelete = new EventEmitter();
|
@Output() warDelete = new EventEmitter();
|
||||||
|
|
||||||
constructor(public loginService: LoginService) {
|
constructor(public loginService: LoginService) {
|
||||||
}
|
}
|
||||||
|
@ -27,7 +25,7 @@ export class WarItemComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
select() {
|
select() {
|
||||||
this.warSelected.emit(this.war._id)
|
this.warSelected.emit(this.war._id);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete() {
|
delete() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, ViewChild} from '@angular/core';
|
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {Award, Decoration} from '../../models/model-interfaces';
|
import {Award, Decoration} from '../../models/model-interfaces';
|
||||||
import {NgForm} from '@angular/forms';
|
import {NgForm} from '@angular/forms';
|
||||||
|
@ -11,7 +11,7 @@ import {Fraction} from '../../utils/fraction.enum';
|
||||||
templateUrl: './award-user.component.html',
|
templateUrl: './award-user.component.html',
|
||||||
styleUrls: ['./award-user.component.css', '../../style/overview.css', '../../style/hide-scrollbar.css'],
|
styleUrls: ['./award-user.component.css', '../../style/overview.css', '../../style/hide-scrollbar.css'],
|
||||||
})
|
})
|
||||||
export class AwardUserComponent {
|
export class AwardUserComponent implements OnInit {
|
||||||
|
|
||||||
@ViewChild(NgForm) form: NgForm;
|
@ViewChild(NgForm) form: NgForm;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import {Component, ViewChild} from '@angular/core';
|
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {Rank, Squad, User} from '../../models/model-interfaces';
|
import {Rank, Squad, User} from '../../models/model-interfaces';
|
||||||
import {UserService} from '../../services/army-management/user.service';
|
import {UserService} from '../../services/army-management/user.service';
|
||||||
import {SquadService} from '../../services/army-management/squad.service';
|
import {SquadService} from '../../services/army-management/squad.service';
|
||||||
import {RankService} from '../../services/army-management/rank.service';
|
import {RankService} from '../../services/army-management/rank.service';
|
||||||
import {Subscription} from 'rxjs';
|
import {Subscription} from 'rxjs/Subscription';
|
||||||
import {NgForm} from '@angular/forms';
|
import {NgForm} from '@angular/forms';
|
||||||
import {Fraction} from '../../utils/fraction.enum';
|
import {Fraction} from '../../utils/fraction.enum';
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import {Fraction} from '../../utils/fraction.enum';
|
||||||
templateUrl: './edit-user.component.html',
|
templateUrl: './edit-user.component.html',
|
||||||
styleUrls: ['./edit-user.component.css', '../../style/entry-form.css', '../../style/overview.css'],
|
styleUrls: ['./edit-user.component.css', '../../style/entry-form.css', '../../style/overview.css'],
|
||||||
})
|
})
|
||||||
export class EditUserComponent {
|
export class EditUserComponent implements OnInit {
|
||||||
|
|
||||||
@ViewChild(NgForm) form: NgForm;
|
@ViewChild(NgForm) form: NgForm;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component} from "@angular/core";
|
import {Component} from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'users',
|
selector: 'users',
|
||||||
|
|
|
@ -2,7 +2,7 @@ export class ChartUtils {
|
||||||
|
|
||||||
public static getShortDateString(date): string {
|
public static getShortDateString(date): string {
|
||||||
const isoDate = date.slice(0, 10);
|
const isoDate = date.slice(0, 10);
|
||||||
const dayDate = parseInt(isoDate.slice(8, 10));
|
const dayDate = parseInt(isoDate.slice(8, 10), 10);
|
||||||
return (dayDate < 10 ? '0' + dayDate : dayDate) + '.'
|
return (dayDate < 10 ? '0' + dayDate : dayDate) + '.'
|
||||||
+ isoDate.slice(5, 7) + '.' + isoDate.slice(2, 4);
|
+ isoDate.slice(5, 7) + '.' + isoDate.slice(2, 4);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ export class ChartUtils {
|
||||||
obj.push({
|
obj.push({
|
||||||
'name': arg,
|
'name': arg,
|
||||||
'series': []
|
'series': []
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
export class PlayerUtils {
|
export class PlayerUtils {
|
||||||
|
|
||||||
public static isSteamUUID(input: string): boolean {
|
public static isSteamUUID(input: string): boolean {
|
||||||
const steamUIDPattern = new RegExp("[0-9]{17}");
|
const steamUIDPattern = new RegExp('[0-9]{17}');
|
||||||
return steamUIDPattern.test(input)
|
return steamUIDPattern.test(input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,6 +109,7 @@
|
||||||
"component-selector": [
|
"component-selector": [
|
||||||
true,
|
true,
|
||||||
"element",
|
"element",
|
||||||
|
"cc",
|
||||||
"kebab-case"
|
"kebab-case"
|
||||||
],
|
],
|
||||||
"use-input-property-decorator": true,
|
"use-input-property-decorator": true,
|
||||||
|
|
Loading…
Reference in New Issue