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