-
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.
* Fixed an issue that caused active system notifications to make certificates print weirdly. * Make default sys notification modal bigger. Relabel certificate dropdown default option. * Fix cert display on game page * Fix Game Center -> Challenges -> Map not rendering the map correctly. * Restored orphaned team advance feature
- Loading branch information
1 parent
308c300
commit c83c3bc
Showing
15 changed files
with
149 additions
and
29 deletions.
There are no files selected for viewing
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
23 changes: 23 additions & 0 deletions
23
...eboard-ui/src/app/admin/components/advance-teams-modal/advance-teams-modal.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,23 @@ | ||
<app-modal-content *ngIf="game" title="Advance Teams" [subtitle]="game.name" (confirm)="handleConfirm()" | ||
[confirmDisabled]="!selectedGame" confirmButtonText="Advance"> | ||
<p> | ||
You've selected <strong>{{ teams.length }}</strong> teams for advancement. Choose a <strong>game</strong> | ||
to which they'll advance, and specify whether you want their starting score to be migrated from the current | ||
game. | ||
</p> | ||
|
||
<div class="my-2"> | ||
<label class="form-label">Select a game</label> | ||
<select class="form-control" [(ngModel)]="selectedGame"> | ||
<option [ngValue]="undefined">[Choose a game]</option> | ||
<option *ngFor="let game of targetGames" [ngValue]="game">{{ game.name }}</option> | ||
</select> | ||
</div> | ||
|
||
<div class="my-2"> | ||
<label class="form-label"> | ||
<input type="checkbox" [(ngModel)]="includeScores"> | ||
Include scores during advancement? | ||
</label> | ||
</div> | ||
</app-modal-content> |
Empty file.
48 changes: 48 additions & 0 deletions
48
...ameboard-ui/src/app/admin/components/advance-teams-modal/advance-teams-modal.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,48 @@ | ||
import { Component, inject, OnInit } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { CoreModule } from "../../../core/core.module"; | ||
import { SimpleEntity } from '@/api/models'; | ||
import { Game } from '@/api/game-models'; | ||
import { GameService } from '@/api/game.service'; | ||
import { firstValueFrom } from 'rxjs'; | ||
import { TeamService } from '@/api/team.service'; | ||
|
||
@Component({ | ||
selector: 'app-advance-teams-modal', | ||
standalone: true, | ||
imports: [CommonModule, CoreModule], | ||
templateUrl: './advance-teams-modal.component.html', | ||
styleUrls: ['./advance-teams-modal.component.scss'] | ||
}) | ||
export class AdvanceTeamsModalComponent implements OnInit { | ||
private gameService = inject(GameService); | ||
private teamService = inject(TeamService); | ||
|
||
game?: SimpleEntity; | ||
onConfirm?: (targetGame: SimpleEntity) => Promise<void> | ||
teams: SimpleEntity[] = []; | ||
|
||
protected includeScores = false; | ||
protected selectedGame?: Game; | ||
protected targetGames: Game[] = []; | ||
|
||
async ngOnInit(): Promise<void> { | ||
this.targetGames = await firstValueFrom(this.gameService.list({ filter: ['advanceable'] })); | ||
} | ||
|
||
protected async handleConfirm() { | ||
if (!this.selectedGame) { | ||
return; | ||
} | ||
|
||
await this.teamService.advance({ | ||
gameId: this.selectedGame.id, | ||
includeScores: this.includeScores, | ||
teamIds: this.teams.map(t => t.id) | ||
}); | ||
|
||
if (this.onConfirm) { | ||
await this.onConfirm(this.selectedGame); | ||
} | ||
} | ||
} |
10 changes: 5 additions & 5 deletions
10
...min/components/game-center/game-center-team-detail/game-center-team-detail.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
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
12 changes: 8 additions & 4 deletions
12
projects/gameboard-ui/src/app/core/pipes/game-map-image-url.pipe.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 |
---|---|---|
@@ -1,13 +1,17 @@ | ||
import { ConfigService } from '@/utility/config.service'; | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
import { DOCUMENT } from '@angular/common'; | ||
import { inject, Pipe, PipeTransform } from '@angular/core'; | ||
|
||
@Pipe({ name: 'gameMapImageUrl' }) | ||
export class GameMapImageUrlPipe implements PipeTransform { | ||
private document = inject(DOCUMENT); | ||
constructor(private config: ConfigService) { } | ||
|
||
transform(value?: string): string { | ||
return value ? | ||
`${this.config.imagehost}/${value}` | ||
: `${this.config.basehref}assets/map.png`; | ||
if (!value) { | ||
return `${this.config.basehref}assets/map.png`; | ||
} | ||
const isAbsolute = new URL(this.document.baseURI).origin !== new URL(value, this.document.baseURI).origin; | ||
return isAbsolute ? value : `${this.config.imagehost}/${value}`; | ||
} | ||
} |
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