Skip to content

Commit

Permalink
v3.19.4 (#187)
Browse files Browse the repository at this point in the history
* Add validation to game editor.

* Don't serve host API key in external host responses.

* Initial work on game center

* Finish batch user create

* Add observe links to support tickets. Fix enroll bugs (Admin enroll and loading indicator on error)

* Allow VM console urls to be built without a name, since they get a default one now.

* Add work for 3.19.3

* Fix decimal precision for questionw eight

* Fixed an issue that prevented the challenge observe link in Support Tools from working. Observe links now only appears when the session is live.
  • Loading branch information
sei-bstein authored Jun 13, 2024
1 parent a97b3cf commit 6f81311
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<div class="card-body">
<div class="d-flex">
<div class="d-flex flex-grow-1">
<div *ngIf="team.rank" class="fs-20 mr-4">
{{team.rank}}
</div>

<app-avatar *ngIf="team.players.length == 1" [tooltip]="team.captain.sponsor.name"
[imageUrl]="team.captain.sponsor | sponsorToLogoUri" size="small"
class="mr-2"></app-avatar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class GameCenterPlayersComponent implements OnInit {

private async load() {
this.isLoading = true;
this.results = await this.adminService.getGameCenterTeams(this.gameId!);
this.results = await this.adminService.getGameCenterTeams(this.gameId!, { sort: "rank" });
this.isLoading = false;
}
}
4 changes: 4 additions & 0 deletions projects/gameboard-ui/src/app/api/admin.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ export interface GameCenterContext {
pointsAvailable: number;
}

export interface GameCenterTeamsRequestArgs {
sort: "name" | "rank" | "timeRemaining" | "timeSinceStart";
}

export interface GameCenterTeamsResults {
teams: PagedArray<GameCenterTeamsResultsTeam>;
}
Expand Down
6 changes: 3 additions & 3 deletions projects/gameboard-ui/src/app/api/admin.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, firstValueFrom, map, tap } from 'rxjs';
import { ApiUrlService } from '@/services/api-url.service';
import { GameCenterContext, GameCenterTeamsResults, GetAppActiveChallengesResponse, GetAppActiveTeamsResponse, GetSiteOverviewStatsResponse, SendAnnouncement } from './admin.models';
import { GameCenterContext, GameCenterTeamsRequestArgs, GameCenterTeamsResults, GetAppActiveChallengesResponse, GetAppActiveTeamsResponse, GetSiteOverviewStatsResponse, SendAnnouncement } from './admin.models';
import { PlayerMode } from './player-models';
import { DateTime } from 'luxon';

Expand Down Expand Up @@ -48,8 +48,8 @@ export class AdminService {
));
}

async getGameCenterTeams(gameId: string): Promise<GameCenterTeamsResults> {
return firstValueFrom(this.http.get<GameCenterTeamsResults>(this.apiUrl.build(`admin/games/${gameId}/game-center/teams`)).pipe(
async getGameCenterTeams(gameId: string, args: GameCenterTeamsRequestArgs): Promise<GameCenterTeamsResults> {
return firstValueFrom(this.http.get<GameCenterTeamsResults>(this.apiUrl.build(`admin/games/${gameId}/game-center/teams`, args)).pipe(
tap(results => {
for (const team of results.teams.items) {
if (team.registeredOn)
Expand Down
1 change: 1 addition & 0 deletions projects/gameboard-ui/src/app/api/support-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface Ticket {
label: string;
selfCreated: boolean;
staffCreated: boolean;
timeTilSessionEndMs?: number;

created: Date;
lastUpdated: Date;
Expand Down
2 changes: 1 addition & 1 deletion projects/gameboard-ui/src/app/services/router.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class RouterService implements OnDestroy {
}

public getObserveChallengeUrl(gameId: string, challengeId: string) {
return `/admin/observer/challenges/${gameId}?search=${challengeId}`;
return `admin/observer/challenges/${gameId}?search=${challengeId}`;
}

public getObserveTeamsUrl(gameId: string, teamId: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface TicketSupportToolsContext {
challenge?: SimpleEntity;
player?: SimpleEntity;
game?: SimpleEntity;
timeTilSessionEndMs?: number;
team: {
id: string,
name: string,
Expand All @@ -20,7 +21,7 @@ export interface TicketSupportToolsContext {
styleUrls: ['./ticket-support-tools.component.scss'],
template: `
<ul *ngIf="hasGameContext; else noGameContext">
<li *ngIf="observeChallengeUrl || observeTeamUrl">
<li *ngIf="isActiveSession && (observeChallengeUrl || observeTeamUrl)">
Observe
<ul>
<li>
Expand Down Expand Up @@ -72,6 +73,7 @@ export class TicketSupportToolsComponent implements OnInit {
protected hasGameContext = false;
protected challengeStateUrl?: string;
protected gameboardUrl?: string;
protected isActiveSession = false;
protected observeChallengeUrl?: string;
protected observeTeamUrl?: string;
protected playerAdminUrl?: string;
Expand Down Expand Up @@ -100,6 +102,7 @@ export class TicketSupportToolsComponent implements OnInit {
}
}

this.isActiveSession = !!this.context?.timeTilSessionEndMs && this.context.timeTilSessionEndMs > 0;
this.hasGameContext = hasGame || !!this.challengeStateUrl || !!this.gameboardUrl || !!this.playerAdminUrl;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export class TicketDetailsComponent implements AfterViewInit, OnDestroy {
challenge: t.challenge ? { id: t.challengeId, name: t.challenge?.name } : undefined,
game: hasGame ? { id: t.player!.gameId, name: t.player!.gameName } : undefined,
player: hasPlayer ? { id: t.playerId, name: t.player!.approvedName } : undefined,
timeTilSessionEndMs: t.timeTilSessionEndMs,
team: {
id: t.teamId,
name: t.teamName,
Expand Down

0 comments on commit 6f81311

Please sign in to comment.