Skip to content

Commit

Permalink
Add 'view cert' button for admins in Teams view
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Jan 22, 2025
1 parent 0a2be1d commit a5fb4d5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
Manual Bonuses
</button>
</li>
<li role="menuitem" *ngIf="hasEndedSession">
<a class="dropdown-item btn" target="_blank" [href]="certificateUrl">
View Certificate
</a>
</li>

<ng-container *ngIf="!hasStartedSession">
<li class="divider dropdown-divider"></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { GameSessionService } from '@/services/game-session.service';
import { ExtendTeamsModalComponent } from '../../extend-teams-modal/extend-teams-modal.component';
import { ApiUser } from '@/api/user-models';
import { RouterService } from '@/services/router.service';
import { NowService } from '@/services/now.service';
import { PlayerMode } from '@/api/player-models';

export interface TeamSessionResetRequest {
teamId: string;
Expand All @@ -35,6 +35,7 @@ export class GameCenterTeamContextMenuComponent {
@Output() error = new EventEmitter<string[]>();
@Output() teamUpdated = new EventEmitter<SimpleEntity>();

protected certificateUrl?: string;
protected fa = fa;
protected hasStartedSession = false;
protected hasEndedSession = false;
Expand All @@ -47,7 +48,6 @@ export class GameCenterTeamContextMenuComponent {
private gameService: GameService,
private gameSessionService: GameSessionService,
private modalService: ModalConfirmService,
private nowService: NowService,
private playerService: PlayerService,
private routerService: RouterService,
private syncStartService: SyncStartService,
Expand All @@ -65,6 +65,8 @@ export class GameCenterTeamContextMenuComponent {
if (this.hasStartedSession && !this.hasEndedSession) {
this.observeTeamUrl = this.routerService.getObserveTeamsUrl(this.game.id, this.team.id);
}

this.certificateUrl = this.routerService.getCertificatePrintableUrl(PlayerMode.competition, this.game.id);
}

protected confirmReset(request: TeamSessionResetRequest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ <h4 class="fs-10" *ngIf="ctx.executionWindow.start && ctx.executionWindow.end">
[label]="(ctx.isTeamGame ? 'Teams' : 'Players') + ' not started'"></app-big-stat>
<app-big-stat [value]="ctx.stats.playerCountActive" label="Active players"></app-big-stat>
<app-big-stat *ngIf="ctx.isTeamGame" [value]="ctx.stats.teamCountActive" label="Active teams"></app-big-stat>
<app-big-stat [value]="ctx.stats.playerCountTotal" label="Total players"></app-big-stat>
<app-big-stat [value]="ctx.stats.teamCountComplete"
label="{{ ctx.isTeamGame ? 'Teams' : 'Players' }} complete"></app-big-stat>
<app-big-stat [value]="ctx.stats.playerCountTotal" label="Total players"></app-big-stat>
<app-big-stat *ngIf="ctx.isTeamGame" [value]="ctx.stats.teamCountTotal" label="Total teams"></app-big-stat>
<app-big-stat *ngIf="ctx.stats.topScore" [value]="ctx.stats.topScore" label="Top Performance"
[subLabel]="ctx.stats.topScoreTeamName"></app-big-stat>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReportMetaData } from '@/reports/reports-models';
import { ActiveReportService } from '@/reports/services/active-report.service';
import { Component, EventEmitter, Output } from '@angular/core';
import { Observable, Subscription } from 'rxjs';
import { Observable } from 'rxjs';

@Component({
selector: 'app-report-parameters-container',
Expand All @@ -19,9 +19,6 @@ import { Observable, Subscription } from 'rxjs';
styleUrls: ['./report-parameters-container.component.scss']
})
export class ReportParametersContainerComponent {
@Output() cleanChange = new EventEmitter<boolean>();

protected metaData$: Observable<ReportMetaData | null> = this.activeReportService.metaData$;

constructor(private activeReportService: ActiveReportService) { }
}

0 comments on commit a5fb4d5

Please sign in to comment.