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 {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 implements OnInit { | export class AdminComponent { | ||||||
| 
 | 
 | ||||||
|   users$: Observable<AppUser[]>; |   users$: Observable<AppUser[]>; | ||||||
| 
 | 
 | ||||||
|  | @ -45,7 +45,7 @@ export class AdminComponent implements OnInit { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     this.appUserService.updateUser(updateObject) |     this.appUserService.updateUser(updateObject) | ||||||
|         .subscribe(resUser => { |         .subscribe(user => { | ||||||
|           this.showSuccessLabel = true; |           this.showSuccessLabel = true; | ||||||
|           setTimeout(() => { |           setTimeout(() => { | ||||||
|             this.showSuccessLabel = false; |             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 {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 implements OnInit { | export class AppComponent { | ||||||
| 
 | 
 | ||||||
|   config = RouteConfig; |   config = RouteConfig; | ||||||
| 
 | 
 | ||||||
|   loading = false; |   loading: boolean = false; | ||||||
| 
 | 
 | ||||||
|   version = 'v' + require('./../../../package.json').version; |   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 {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 implements OnInit, OnDestroy { | export class ArmyMemberComponent { | ||||||
| 
 | 
 | ||||||
|   subscription: Subscription; |   subscription: Subscription; | ||||||
| 
 | 
 | ||||||
|  | @ -42,7 +42,7 @@ export class ArmyMemberComponent implements OnInit, OnDestroy { | ||||||
| 
 | 
 | ||||||
|     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, OnDestroy, OnInit} from '@angular/core'; | import {Component, Inject} 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 implements OnInit, OnDestroy { | export class ArmyComponent { | ||||||
| 
 | 
 | ||||||
|   army: Army = {BLUFOR: {squads: [], memberCount: 0}, OPFOR: {squads: [], memberCount: 0}}; |   army: Army = {BLUFOR: {squads: [], memberCount: 0}, OPFOR: {squads: [], memberCount: 0}}; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -13,7 +13,6 @@ 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, Input, OnInit, Output} from '@angular/core'; | import {ChangeDetectionStrategy, Component, EventEmitter} 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,22 +6,20 @@ 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 implements OnInit { | export class DecorationItemComponent { | ||||||
| 
 |  | ||||||
|   @Input() selected: boolean; |  | ||||||
| 
 |  | ||||||
|   @Input() decoration: Decoration; |  | ||||||
| 
 |  | ||||||
|   @Output() decorationSelected = new EventEmitter(); |  | ||||||
| 
 |  | ||||||
|   @Output() decorationDelete = new EventEmitter(); |  | ||||||
| 
 | 
 | ||||||
|  |   selected: boolean; | ||||||
|  |   decoration: Decoration; | ||||||
|   imageSrc; |   imageSrc; | ||||||
| 
 |  | ||||||
|   imgStyle = {width: '', height: '', marginTop: ''}; |   imgStyle = {width: '', height: '', marginTop: ''}; | ||||||
| 
 | 
 | ||||||
|  |   decorationSelected = new EventEmitter(); | ||||||
|  |   decorationDelete = new EventEmitter(); | ||||||
|  | 
 | ||||||
|   readonly fraction = Fraction; |   readonly fraction = Fraction; | ||||||
| 
 | 
 | ||||||
|   constructor() { |   constructor() { | ||||||
|  |  | ||||||
|  | @ -60,16 +60,13 @@ export class DecorationListComponent implements OnInit { | ||||||
| 
 | 
 | ||||||
|   deleteDecoration(decoration) { |   deleteDecoration(decoration) { | ||||||
|     let fraction = 'Global'; |     let fraction = 'Global'; | ||||||
|     if (decoration.fraction === 'BLUFOR') { |     if (decoration.fraction === 'BLUFOR') fraction = Fraction.BLUFOR; | ||||||
|       fraction = Fraction.BLUFOR; |     else if (decoration.fraction === 'OPFOR') fraction = Fraction.OPFOR; | ||||||
|     } 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,6 +27,5 @@ export const decorationsRoutes: Routes = [{ | ||||||
| 
 | 
 | ||||||
| export const decorationRoutesModule: ModuleWithProviders = RouterModule.forChild(decorationsRoutes); | export const decorationRoutesModule: ModuleWithProviders = RouterModule.forChild(decorationsRoutes); | ||||||
| 
 | 
 | ||||||
| export const decorationsRoutingComponents = [DecorationItemComponent, DecorationComponent, DecorationListComponent, | export const decorationsRoutingComponents = [DecorationItemComponent, DecorationComponent, DecorationListComponent, EditDecorationComponent]; | ||||||
|   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 {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 implements OnInit, OnDestroy { | export class EditDecorationComponent { | ||||||
| 
 | 
 | ||||||
|   subscription: Subscription; |   subscription: Subscription; | ||||||
| 
 | 
 | ||||||
|  | @ -36,7 +36,7 @@ export class EditDecorationComponent implements OnInit, OnDestroy { | ||||||
|   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,2 +1,2 @@ | ||||||
| export * from './login.component'; | 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 {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 implements OnInit, OnDestroy { | export class EditRankComponent { | ||||||
| 
 | 
 | ||||||
|   subscription: Subscription; |   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 {Rank} from '../../models/model-interfaces'; | ||||||
| import {Fraction} from '../../utils/fraction.enum'; | import {Fraction} from '../../utils/fraction.enum'; | ||||||
| 
 | 
 | ||||||
|  | @ -6,20 +6,19 @@ 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 implements OnInit { | export class RankItemComponent { | ||||||
| 
 |  | ||||||
|   @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, OnInit, ViewChild} from '@angular/core'; | import {Component, 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 implements OnInit { | export class RequestAwardComponent { | ||||||
| 
 | 
 | ||||||
|   @ViewChild(NgForm) form: NgForm; |   @ViewChild(NgForm) form: NgForm; | ||||||
| 
 | 
 | ||||||
|  | @ -24,7 +24,7 @@ export class RequestAwardComponent implements OnInit { | ||||||
| 
 | 
 | ||||||
|   decoration: Decoration = {_id: '0'}; |   decoration: Decoration = {_id: '0'}; | ||||||
| 
 | 
 | ||||||
|   reason = ''; |   reason: string = ''; | ||||||
| 
 | 
 | ||||||
|   decorations: Decoration[]; |   decorations: Decoration[]; | ||||||
| 
 | 
 | ||||||
|  | @ -96,9 +96,9 @@ export class RequestAwardComponent implements OnInit { | ||||||
|               this.showSuccessLabel = true; |               this.showSuccessLabel = true; | ||||||
|               setTimeout(() => { |               setTimeout(() => { | ||||||
|                 this.showSuccessLabel = false; |                 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 {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 implements OnInit { | export class ConfirmAwardComponent { | ||||||
| 
 | 
 | ||||||
|   awards: Award[]; |   awards: Award[]; | ||||||
| 
 | 
 | ||||||
|  | @ -19,7 +19,7 @@ export class ConfirmAwardComponent implements OnInit { | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   ngOnInit() { |   ngOnInit() { | ||||||
|     const currentUser = this.loginService.getCurrentUser(); |     let 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 implements OnInit { | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     this.awardingService.updateAward(updateObject).subscribe(res => { |     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.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, OnInit} from '@angular/core'; | import {Component} 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 implements OnInit { | export class ConfirmPromotionComponent { | ||||||
| 
 | 
 | ||||||
|   showSuccessLabel = false; |   showSuccessLabel = false; | ||||||
| 
 | 
 | ||||||
|  | @ -23,14 +23,15 @@ export class ConfirmPromotionComponent implements OnInit { | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   ngOnInit() { |   ngOnInit() { | ||||||
|     const currentUser = this.loginService.getCurrentUser(); |     let 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) { | ||||||
|  | @ -40,7 +41,7 @@ export class ConfirmPromotionComponent implements OnInit { | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     this.promotionService.updatePromotion(updateObject).subscribe(res => { |     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.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, OnInit, ViewChild} from '@angular/core'; | import {Component, 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 implements OnInit { | export class RequestPromotionComponent { | ||||||
| 
 | 
 | ||||||
|   @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) => { | ||||||
|           const headerCount = parseInt(res.headers.get('x-total-count'), 10); |           let headerCount = parseInt(res.headers.get('x-total-count')); | ||||||
|           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 => { | ||||||
|           const editedTask = action.data; |           var 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, OnDestroy, OnInit, ViewChild} from '@angular/core'; | import {Component, 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 implements OnInit, OnDestroy { | export class EditSquadComponent { | ||||||
| 
 | 
 | ||||||
|   subscription: Subscription; |   subscription: Subscription; | ||||||
| 
 | 
 | ||||||
|  | @ -88,8 +88,8 @@ export class EditSquadComponent implements OnInit, OnDestroy { | ||||||
|             this.showSuccessLabel = true; |             this.showSuccessLabel = true; | ||||||
|             setTimeout(() => { |             setTimeout(() => { | ||||||
|               this.showSuccessLabel = false; |               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 {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 implements OnInit { | export class SquadItemComponent { | ||||||
| 
 | 
 | ||||||
|   @Input() selected: boolean; |   selected: boolean; | ||||||
|  |   squad: Squad; | ||||||
| 
 | 
 | ||||||
|   @Input() squad: Squad; |   squadSelected = new EventEmitter(); | ||||||
| 
 |   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, OnInit, Output} from '@angular/core'; | import {Component, EventEmitter, Input, 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 implements OnInit { | export class CampaignPlayerDetailComponent { | ||||||
| 
 | 
 | ||||||
|   @Input() campaignId: string; |   @Input() campaignId: string; | ||||||
| 
 | 
 | ||||||
|  | @ -132,8 +132,7 @@ export class CampaignPlayerDetailComponent implements OnInit { | ||||||
|             } |             } | ||||||
|           ]; |           ]; | ||||||
| 
 | 
 | ||||||
|           Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.vehicleKillData, |           Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.vehicleKillData, this.deathData, this.respawnData, this.reviveData, this.captureData]); | ||||||
|             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 {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,11 +11,10 @@ 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 implements OnInit { | export class StatisticHighScoreComponent { | ||||||
| 
 |  | ||||||
|   @Input() campaigns; |  | ||||||
| 
 | 
 | ||||||
|   id = ''; |   id = ''; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| import {Component, Input, OnInit} from '@angular/core'; | import {Component, Input} 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 implements OnInit { | export class StatisticOverviewComponent { | ||||||
| 
 | 
 | ||||||
|   @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, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core'; | import {Component, ElementRef, Input, 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 implements OnInit, OnChanges { | export class FractionStatsComponent { | ||||||
| 
 | 
 | ||||||
|   readonly fraction = Fraction; |   readonly fraction = Fraction; | ||||||
| 
 | 
 | ||||||
|  | @ -161,7 +161,7 @@ export class FractionStatsComponent implements OnInit, OnChanges { | ||||||
|       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 (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[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 implements OnInit, OnChanges { | ||||||
|     } |     } | ||||||
|     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((entry, pos) => ({entry, pos}))) { |     for (const {killEntry, index} of this.logData.kill.map((killEntry, index) => ({killEntry, index}))) { | ||||||
|       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 implements OnInit, OnChanges { | ||||||
|         if (killEntry.fraction === 'OPFOR') { |         if (killEntry.fraction === 'OPFOR') { | ||||||
|           killCountOpfor++; |           killCountOpfor++; | ||||||
|         } |         } | ||||||
|         if (this.isTwoMinutesAhead(killEntryDate, this.tmpKillData)) { |         if (FractionStatsComponent.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 implements OnInit, OnChanges { | ||||||
|         if (killEntry.fraction === 'OPFOR') { |         if (killEntry.fraction === 'OPFOR') { | ||||||
|           ffKillCountOpfor++; |           ffKillCountOpfor++; | ||||||
|         } |         } | ||||||
|         if (this.isTwoMinutesAhead(killEntryDate, this.tmpFrienlyFireData)) { |         if (FractionStatsComponent.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 implements OnInit, OnChanges { | ||||||
|       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((entry, pos) => ({entry, pos}))) { |     for (const {reviveEntry, index} of this.logData.revive.map((reviveEntry, index) => ({reviveEntry, index}))) { | ||||||
|       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 implements OnInit, OnChanges { | ||||||
|         } else { |         } else { | ||||||
|           reviveCountOpfor++; |           reviveCountOpfor++; | ||||||
|         } |         } | ||||||
|         if (this.isTwoMinutesAhead(reviveEntryDate, this.tmpReviveData)) { |         if (FractionStatsComponent.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 implements OnInit, OnChanges { | ||||||
|         } else { |         } else { | ||||||
|           stabilizeCountOpfor++; |           stabilizeCountOpfor++; | ||||||
|         } |         } | ||||||
|         if (this.isTwoMinutesAhead(reviveEntryDate, this.tmpStabilizeData)) { |         if (FractionStatsComponent.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 implements OnInit, OnChanges { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|     let vehicleKillCountBlufor = 0, vehicleKillCountOpfor = 0; |     let vehicleKillCountBlufor = 0, vehicleKillCountOpfor = 0; | ||||||
|     for (const {transportEntry: vehicleEntry, index} of this.logData.vehicle.map((entry, pos) => ({ |     for (const {transportEntry: vehicleEntry, index} of this.logData.vehicle.map((transportEntry, index) => ({ | ||||||
|       pos, |       transportEntry, | ||||||
|       index |       index | ||||||
|     }))) { |     }))) { | ||||||
|       const vehicleEntryDate = new Date(vehicleEntry.time); |       const vehicleEntryDate = new Date(vehicleEntry.time); | ||||||
|  | @ -270,7 +270,7 @@ export class FractionStatsComponent implements OnInit, OnChanges { | ||||||
|       } else { |       } else { | ||||||
|         vehicleKillCountOpfor++; |         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[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 implements OnInit, OnChanges { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|     let transportCountBlufor = 0, transportCountOpfor = 0; |     let transportCountBlufor = 0, transportCountOpfor = 0; | ||||||
|     for (const {transportEntry, index} of this.logData.transport.map((entry, pos) => ({ |     for (const {transportEntry, index} of this.logData.transport.map((transportEntry, index) => ({ | ||||||
|       entry, |       transportEntry, | ||||||
|       pos |       index | ||||||
|     }))) { |     }))) { | ||||||
|       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 implements OnInit, OnChanges { | ||||||
|       } else { |       } else { | ||||||
|         transportCountOpfor++; |         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[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 implements OnInit, OnChanges { | ||||||
|     this.initialized.flag = true; |     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); |     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.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.tmpKillData, this.tmpFrienlyFireData, this.tmpVehicleData, this.tmpReviveData, this.tmpStabilizeData, this.tmpTransportData].forEach(tmp => { | ||||||
|       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)); | ||||||
|       }); |       }); | ||||||
|  | @ -360,8 +359,7 @@ export class FractionStatsComponent implements OnInit, OnChanges { | ||||||
|     } 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] |           tmpCollection[j].series.push(ChartUtils.getSeriesEntry(endDate, tmpCollection[j].series[tmpCollection[j].series.length - 1].value)); | ||||||
|             .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 {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 implements OnChanges { | export class ScoreboardComponent { | ||||||
| 
 | 
 | ||||||
|   readonly fraction = Fraction; |   readonly fraction = Fraction; | ||||||
| 
 | 
 | ||||||
|  | @ -24,7 +24,7 @@ export class ScoreboardComponent implements OnChanges { | ||||||
| 
 | 
 | ||||||
|   rows = []; |   rows = []; | ||||||
| 
 | 
 | ||||||
|   reorderable = false; |   reorderable: boolean = false; | ||||||
| 
 | 
 | ||||||
|   customClasses = { |   customClasses = { | ||||||
|     sortAscending: 'glyphicon glyphicon-triangle-top', |     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 {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 implements OnInit { | export class WarDetailComponent { | ||||||
| 
 | 
 | ||||||
|   readonly fraction = Fraction; |   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 {War} from '../../models/model-interfaces'; | ||||||
| import {LoginService} from '../../services/app-user-service/login-service'; | 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', |   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 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) { |   constructor(public loginService: LoginService) { | ||||||
|   } |   } | ||||||
|  | @ -25,7 +27,7 @@ export class WarItemComponent implements OnInit { | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   select() { |   select() { | ||||||
|     this.warSelected.emit(this.war._id); |     this.warSelected.emit(this.war._id) | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   delete() { |   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 {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 implements OnInit { | export class AwardUserComponent { | ||||||
| 
 | 
 | ||||||
|   @ViewChild(NgForm) form: NgForm; |   @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 {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/Subscription'; | import {Subscription} from 'rxjs'; | ||||||
| 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 implements OnInit { | export class EditUserComponent { | ||||||
| 
 | 
 | ||||||
|   @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), 10); |     const dayDate = parseInt(isoDate.slice(8, 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,7 +109,7 @@ | ||||||
|     "component-selector": [ |     "component-selector": [ | ||||||
|       true, |       true, | ||||||
|       "element", |       "element", | ||||||
|       "cc", |       "app", | ||||||
|       "kebab-case" |       "kebab-case" | ||||||
|     ], |     ], | ||||||
|     "use-input-property-decorator": true, |     "use-input-property-decorator": true, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue