-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial draft of enrollment report by game tab.
- Loading branch information
1 parent
707bdde
commit 6b5dce4
Showing
10 changed files
with
121 additions
and
12 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
...ollment-report-by-game/enrollment-report-by-game/enrollment-report-by-game.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<ng-container *ngIf="results; else loading"> | ||
<div *ngIf="results && results.records.length; else noRecords" class="results"> | ||
<table class="report-table table-hover gameboard-report"> | ||
<col> | ||
<colgroup span="3"></colgroup> | ||
|
||
<thead class="thead-light"> | ||
<tr class="headers super-headers-row"> | ||
<th scope="col" class="group-header game-column">Game</th> | ||
<th scope="col" colSpan="3" class="group-header">Enrollment</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<tr class="headers headers-row"> | ||
<td>Game</td> | ||
<td>Total Players</td> | ||
<td>Total Sponsors</td> | ||
<td>Top Sponsor</td> | ||
</tr> | ||
|
||
<tr class="data-row" *ngFor="let record of results.records"> | ||
<td> | ||
<app-challenge-or-game-field [game]="record.game"></app-challenge-or-game-field> | ||
</td> | ||
|
||
<!--ENROLLMENT--> | ||
<td class="report-field numerical"> | ||
{{record.playerCount}} | ||
</td> | ||
<td class="report-field numerical"> | ||
<p>{{record.sponsors.length}}</p> | ||
</td> | ||
<td class="report-field numerical"> | ||
<app-parameter-change-link *ngIf="record.topSponsor" | ||
[config]="{ parameterChange: { sponsors: record.topSponsor.id} }"> | ||
<app-player-avatar-legacy class="d-block mr-2" | ||
[avatarUri]="record.topSponsor.logoFileName | relativeImage" | ||
[tooltip]="record.topSponsor.name" size="small"></app-player-avatar-legacy> | ||
</app-parameter-change-link> | ||
<small class="subtle-info">{{record.topSponsorPlayerCount}} {{ "player" | | ||
pluralizer:record.topSponsorPlayerCount | ||
}}</small> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</ng-container> | ||
|
||
<ng-template #loading> | ||
<div class="page-height d-flex flex-column align-items-center justify-content-center"> | ||
<app-spinner>Loading the report...</app-spinner> | ||
</div> | ||
</ng-template> | ||
|
||
<ng-template #noRecords> | ||
<app-no-report-records></app-no-report-records> | ||
</ng-template> |
3 changes: 3 additions & 0 deletions
3
...ollment-report-by-game/enrollment-report-by-game/enrollment-report-by-game.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.game-column { | ||
width: 35%; | ||
} |
30 changes: 30 additions & 0 deletions
30
...nrollment-report-by-game/enrollment-report-by-game/enrollment-report-by-game.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; | ||
import { EnrollmentReportByGameRecord, EnrollmentReportFlatParameters } from '@/reports/components/reports/enrollment-report/enrollment-report.models'; | ||
import { ReportResults } from '@/reports/reports-models'; | ||
import { EnrollmentReportService } from '../../enrollment-report.service'; | ||
import { firstValueFrom } from 'rxjs'; | ||
import { PagingArgs } from '@/api/models'; | ||
import { RouterService } from '@/services/router.service'; | ||
|
||
@Component({ | ||
selector: 'app-enrollment-report-by-game', | ||
templateUrl: './enrollment-report-by-game.component.html', | ||
styleUrls: ['./enrollment-report-by-game.component.scss'] | ||
}) | ||
export class EnrollmentReportByGameComponent implements OnChanges { | ||
@Input() parameters!: EnrollmentReportFlatParameters | null; | ||
|
||
protected results: ReportResults<EnrollmentReportByGameRecord> | null = null; | ||
|
||
constructor( | ||
private enrollmentReportService: EnrollmentReportService, | ||
private routerService: RouterService) { } | ||
|
||
async ngOnChanges(changes: SimpleChanges): Promise<void> { | ||
await this.loadData(this.parameters); | ||
} | ||
|
||
private async loadData(parameters: EnrollmentReportFlatParameters | null) { | ||
this.results = await firstValueFrom(this.enrollmentReportService.getByGameData(this.parameters)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters