Feature player detail - v1.5.0 #10

Merged
hardi merged 1 commits from task/stats-player-detail into master 2017-10-02 20:04:13 +02:00
8 changed files with 20 additions and 23 deletions

View File

@ -62,10 +62,10 @@ export const appRoutes: Routes = [
path: '404', path: '404',
component: NotFoundComponent component: NotFoundComponent
}, },
// { {
// path: '**', path: '**',
// redirectTo: '/404' redirectTo: '/404'
// } // always configure this last - first matching route gets processed } // always configure this last - first matching route gets processed
]; ];
export const appRouting = RouterModule.forRoot(appRoutes); export const appRouting = RouterModule.forRoot(appRoutes);

View File

@ -23,7 +23,7 @@
[scheme]="colorScheme" [scheme]="colorScheme"
[value]="respawnDeathRatio" [value]="respawnDeathRatio"
[previousValue]="0.5" [previousValue]="0.5"
[max]="1" [max]="maxRespawnDeathRatio"
[min]="0" [min]="0"
[units]="'Respawn/Death'"> [units]="'Respawn/Death'">
</ngx-charts-linear-gauge> </ngx-charts-linear-gauge>
@ -54,7 +54,6 @@
[xAxis]="xAxis" [xAxis]="xAxis"
[yAxis]="yAxis" [yAxis]="yAxis"
[legend]="legend" [legend]="legend"
[legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="yAxisKill" [yAxisLabel]="yAxisKill"
@ -75,7 +74,6 @@
[xAxis]="xAxis" [xAxis]="xAxis"
[yAxis]="yAxis" [yAxis]="yAxis"
[legend]="legend" [legend]="legend"
[legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="yAxisFriendlyFire" [yAxisLabel]="yAxisFriendlyFire"
@ -96,7 +94,6 @@
[xAxis]="xAxis" [xAxis]="xAxis"
[yAxis]="yAxis" [yAxis]="yAxis"
[legend]="legend" [legend]="legend"
[legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="yAxisDeath" [yAxisLabel]="yAxisDeath"
@ -117,7 +114,6 @@
[xAxis]="xAxis" [xAxis]="xAxis"
[yAxis]="yAxis" [yAxis]="yAxis"
[legend]="legend" [legend]="legend"
[legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="yAxisRespawn" [yAxisLabel]="yAxisRespawn"
@ -138,7 +134,6 @@
[xAxis]="xAxis" [xAxis]="xAxis"
[yAxis]="yAxis" [yAxis]="yAxis"
[legend]="legend" [legend]="legend"
[legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="yAxisRevive" [yAxisLabel]="yAxisRevive"
@ -159,7 +154,6 @@
[xAxis]="xAxis" [xAxis]="xAxis"
[yAxis]="yAxis" [yAxis]="yAxis"
[legend]="legend" [legend]="legend"
[legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="yAxisCapture" [yAxisLabel]="yAxisCapture"

View File

@ -52,7 +52,6 @@ export class CampaignPlayerDetailComponent {
xAxis = true; xAxis = true;
yAxis = true; yAxis = true;
legend = false; legend = false;
legendTitle = '';
showXAxisLabel = true; showXAxisLabel = true;
showYAxisLabel = true; showYAxisLabel = true;
autoscale = false; autoscale = false;
@ -68,7 +67,9 @@ export class CampaignPlayerDetailComponent {
kdRatio = 0; kdRatio = 0;
maxKd = 1.7; maxKd = 1.7;
respawnDeathRatio = 0; respawnDeathRatio = 0;
maxRespawnDeathRatio = 1;
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,

View File

@ -10,8 +10,6 @@
(click)="goToSlide(1)">Spielerzahlen (click)="goToSlide(1)">Spielerzahlen
</div> </div>
<carousel class="fade-in" [(activeSlide)]="activeSlideIndex"> <carousel class="fade-in" [(activeSlide)]="activeSlideIndex">
<slide *ngIf="id != 'all'"> <slide *ngIf="id != 'all'">
<div class="slide-chart-container"> <div class="slide-chart-container">

View File

@ -3,7 +3,7 @@ import {CommonModule} from "@angular/common";
import {SharedModule} from "../shared.module"; import {SharedModule} from "../shared.module";
import {statsRouterModule, statsRoutingComponents} from "./stats.routing"; import {statsRouterModule, statsRoutingComponents} from "./stats.routing";
import {WarService} from "../services/war-service/war.service"; import {WarService} from "../services/war-service/war.service";
import {GaugeModule, LineChartModule, NgxChartsModule, PieChartModule} from "@swimlane/ngx-charts"; import {NgxChartsModule} from "@swimlane/ngx-charts";
import {AccordionModule, CarouselModule} from "ngx-bootstrap"; import {AccordionModule, CarouselModule} from "ngx-bootstrap";
import {CampaignService} from "../services/campaign-service/campaign.service"; import {CampaignService} from "../services/campaign-service/campaign.service";
import {NgxDatatableModule} from "@swimlane/ngx-datatable"; import {NgxDatatableModule} from "@swimlane/ngx-datatable";

View File

@ -13,7 +13,6 @@
.player-name { .player-name {
font-weight: bold; font-weight: bold;
cursor: pointer;
} }
.text-opfor { .text-opfor {
@ -52,6 +51,7 @@
:host /deep/ .datatable-body-row { :host /deep/ .datatable-body-row {
color: #222222; color: #222222;
border-bottom: 1px solid grey; border-bottom: 1px solid grey;
cursor: pointer;
} }
:host /deep/ .datatable-body-row:hover { :host /deep/ .datatable-body-row:hover {

View File

@ -57,10 +57,12 @@
[messages]="{emptyMessage: 'Loading...'}" [messages]="{emptyMessage: 'Loading...'}"
[headerHeight]="cellHeight" [headerHeight]="cellHeight"
[rowHeight]="cellHeight" [rowHeight]="cellHeight"
[cssClasses]='customClasses'> [cssClasses]='customClasses'
[selectionType]="'single'"
(select)="selectPlayerDetail($event)">
<ngx-datatable-column name="Spieler" prop="name" [width]="210" style="padding-left:10px"> <ngx-datatable-column name="Spieler" prop="name" [width]="210" style="padding-left:10px">
<ng-template ngx-datatable-cell-template let-row="row" let-value="value"> <ng-template ngx-datatable-cell-template let-row="row" let-value="value">
<span class="player-name" (click)="selectPlayerDetail(value)" <span class="player-name"
[ngClass]="row['fraction'] === 'BLUFOR' ? 'text-blufor' : 'text-opfor'"> [ngClass]="row['fraction'] === 'BLUFOR' ? 'text-blufor' : 'text-opfor'">
{{value}} {{value}}
</span> </span>

View File

@ -55,11 +55,6 @@ export class WarDetailComponent {
}); });
} }
selectPlayerDetail(playerName) {
this.router.navigate(['../../campaign-player/' + this.war.campaign + '/' + playerName],
{relativeTo: this.route});
}
filterPlayersByFraction(fraction: string) { filterPlayersByFraction(fraction: string) {
if (fraction) { if (fraction) {
this.rows = this.war.players.filter((player) => { this.rows = this.war.players.filter((player) => {
@ -70,4 +65,11 @@ export class WarDetailComponent {
} }
} }
selectPlayerDetail(player) {
if (player && player.selected && player.selected.length > 0) {
this.router.navigate(['../../campaign-player/' + this.war.campaign + '/' + player.selected[0].name],
{relativeTo: this.route});
}
}
} }