Fix army member click area & sort campaign all overview sorting
parent
51a203861b
commit
436f6585c2
|
@ -55,7 +55,6 @@ img {
|
||||||
|
|
||||||
.member-link {
|
.member-link {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: block;
|
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,14 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row middle-row">
|
<div class="row middle-row">
|
||||||
<div class="squad-cell name-cell">
|
<div class="squad-cell name-cell">
|
||||||
<span class="member-link text-blufor"
|
<span class="text-blufor"
|
||||||
*ngFor="let member of squad.members"
|
style="display: block"
|
||||||
|
*ngFor="let member of squad.members">
|
||||||
|
<span class="member-link"
|
||||||
(click)="select(member._id)">
|
(click)="select(member._id)">
|
||||||
{{member.rank}} {{member.username}}
|
{{member.rank}} {{member.username}}
|
||||||
</span>
|
</span>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row colored-row footer-row">
|
<div class="row colored-row footer-row">
|
||||||
|
@ -37,11 +40,14 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row middle-row">
|
<div class="row middle-row">
|
||||||
<div class="squad-cell name-cell">
|
<div class="squad-cell name-cell">
|
||||||
<span class="member-link text-opfor"
|
<span class="text-opfor"
|
||||||
*ngFor="let member of squad.members"
|
style="display: block"
|
||||||
|
*ngFor="let member of squad.members">
|
||||||
|
<span class="member-link"
|
||||||
(click)="select(member._id)">
|
(click)="select(member._id)">
|
||||||
{{member.rank}} {{member.username}}
|
{{member.rank}} {{member.username}}
|
||||||
</span>
|
</span>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row colored-row footer-row">
|
<div class="row colored-row footer-row">
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
[showYAxisLabel]="showYAxisLabel"
|
[showYAxisLabel]="showYAxisLabel"
|
||||||
[yAxisLabel]="yAxisLabel"
|
[yAxisLabel]="yAxisLabel"
|
||||||
[autoScale]="autoscale"
|
[autoScale]="autoscale"
|
||||||
[timeline]="timeline">
|
[timeline]="timeline"
|
||||||
|
[roundDomains]="roundDomains">
|
||||||
</ngx-charts-line-chart>
|
</ngx-charts-line-chart>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -38,7 +38,6 @@ export class StatisticOverviewComponent {
|
||||||
autoscale = true;
|
autoscale = true;
|
||||||
timeline = false;
|
timeline = false;
|
||||||
|
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private campaignService: CampaignService) {
|
private campaignService: CampaignService) {
|
||||||
}
|
}
|
||||||
|
@ -63,14 +62,20 @@ export class StatisticOverviewComponent {
|
||||||
let itemsProcessed = 0;
|
let itemsProcessed = 0;
|
||||||
campaigns = campaigns.filter(campaign => this.id === 'all' || campaign._id === this.id);
|
campaigns = campaigns.filter(campaign => this.id === 'all' || campaign._id === this.id);
|
||||||
campaigns.forEach(campaign => {
|
campaigns.forEach(campaign => {
|
||||||
if (this.id === 'all') {
|
|
||||||
this.title = "Gesamtübersicht";
|
|
||||||
} else {
|
|
||||||
this.title = campaign.title;
|
|
||||||
}
|
|
||||||
wars = wars.concat(campaign.wars);
|
wars = wars.concat(campaign.wars);
|
||||||
itemsProcessed++;
|
itemsProcessed++;
|
||||||
if (itemsProcessed === campaigns.length) {
|
if (itemsProcessed === campaigns.length) {
|
||||||
|
if (this.id === 'all') {
|
||||||
|
this.title = "Gesamtübersicht";
|
||||||
|
wars.sort((a, b) => {
|
||||||
|
// sort by dates, because older campaign can contain newer war
|
||||||
|
if (a['date'] > (b['date'])) return -1;
|
||||||
|
if (a['date'] < (b['date'])) return 1;
|
||||||
|
return 0;
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.title = campaign.title;
|
||||||
|
}
|
||||||
this.initChart(wars);
|
this.initChart(wars);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue