-
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.
* Fix base href bugs in active teams/challenges modals. * Refactor of a weird pipe. * Fixed an issue that prevented some avatars from loading correctly * Allow removal of members to add to team * Minor styling * The player list now correctly shows the game from which they advanced (if applicable). * Rename 'deployment' admin to 'external game'. Removed a stray pipe. * Add yaml pasting option for game import.
- Loading branch information
1 parent
ead873d
commit a84634d
Showing
25 changed files
with
208 additions
and
71 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
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
2 changes: 1 addition & 1 deletion
2
...nt-admin-team-context-menu.component.html → ...me-admin-team-context-menu.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
17 changes: 17 additions & 0 deletions
17
...-ui/src/app/admin/components/game-yaml-import-modal/game-yaml-import-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,17 @@ | ||
<div class="game-yaml-import-modal-component"> | ||
<div class="modal-header"> | ||
<div class="headers modal-title pull-left"> | ||
<h2>Import Game YAML</h2> | ||
</div> | ||
<button type="button" class="btn-close close pull-right" aria-label="Close" (click)="handleClose()"> | ||
<span aria-hidden="true" class="visually-hidden">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
<textarea #yamlIn class="form-control font-fixed-width" rows="12" appAutofocus | ||
placeholder="Paste your game's YAML configuration here. If you want to use another game's configuration as a starting point, you can copy it from its game card."></textarea> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-success" (click)="handleImportClick(yamlIn.value)">Import</button> | ||
</div> | ||
</div> |
File renamed without changes.
42 changes: 42 additions & 0 deletions
42
...rd-ui/src/app/admin/components/game-yaml-import-modal/game-yaml-import-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,42 @@ | ||
import { NewGame } from '@/api/game-models'; | ||
import { GameService } from '@/api/game.service'; | ||
import { ModalConfirmService } from '@/services/modal-confirm.service'; | ||
import { YamlService } from '@/services/yaml.service'; | ||
import { Component } from '@angular/core'; | ||
import { firstValueFrom } from 'rxjs'; | ||
|
||
@Component({ | ||
selector: 'app-game-yaml-import-modal', | ||
templateUrl: './game-yaml-import-modal.component.html', | ||
styleUrls: ['./game-yaml-import-modal.component.scss'] | ||
}) | ||
export class GameYamlImportModalComponent { | ||
onCreate?: (game: NewGame) => void | Promise<void>; | ||
protected errors: any[] = []; | ||
|
||
constructor( | ||
private gameService: GameService, | ||
private modalService: ModalConfirmService, | ||
private yamlService: YamlService) { } | ||
|
||
protected handleClose() { | ||
this.modalService.hide(); | ||
} | ||
|
||
protected async handleImportClick(yamlIn: string) { | ||
this.errors = []; | ||
try { | ||
const game = this.yamlService.parse<NewGame>(yamlIn); | ||
await firstValueFrom(this.gameService.create(game)); | ||
|
||
if (this.onCreate) { | ||
await this.onCreate(game); | ||
} | ||
} | ||
catch (err) { | ||
this.errors.push(err); | ||
} | ||
|
||
this.modalService.hide(); | ||
} | ||
} |
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
Oops, something went wrong.