-
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.
* Add tooltip to support code copy button * Dependabot alert * Merge from next * Correct support tools links * More support url bugs and make player registrar view searched player * Remove logging * Initial work on feedback yaml changes. * More feedback YAML work * Clean up use of support code in Support views. * Finish yaml feedback helper * Add submissions to challenge browser * Finish including submissions in admin -> challenges. * Comments * Add summary card for support report. * Resolve GBAPI#195 * Add new date filters and clarify existing time filters for support report. * Enable session extension by duration. * Finish batch extension. Make team event horizon not accidentally closeable. * Correct event horizon modal dismiss change. * Light restyling of event horizon component. * Make event horizon 'start' events clickable. * Improve bonus yaml editing experience * Fixed width style for bonus config * Fix potential spamming external game admin endpoint * Fix RXJS endpoint-spamming bug. * Add success notification/error handling to the sync spects button in the game editor. * Minor cleanup * Loading/error handling for extend session. * Fix tooltip for new scoreboard. Also misc. cleanup * Fix bugs with batch extend. Reenable game engine sync from challenge browser. * Improve usability of batch session extend. * Funnel extensions by iso date into the same functionality as duration-based extensions. * Style challenge browser * Initial work on 383 * Fix error display bug with extend. * Iteration on 383 * Progress on 383. * Minor cleanup * Progress on 383 * Finish 383
- Loading branch information
1 parent
005930b
commit e0f5f88
Showing
24 changed files
with
532 additions
and
50 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
90 changes: 90 additions & 0 deletions
90
...i/src/app/admin/components/active-challenges-modal/active-challenges-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,90 @@ | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h2 class="modal-title">Active Challenges: {{ playerMode | titlecase }}</h2> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" (click)="close()"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
<app-error-div [errors]="errors"></app-error-div> | ||
</div> | ||
|
||
<div class="modal-body" *ngIf="!isWorking; else loading"> | ||
<ng-container *ngIf="specs?.length; else noChallenges"> | ||
<div *ngFor="let spec of specs" class="spec-container"> | ||
<h3>{{ spec.name }}</h3> | ||
<h4 class="game-link"> | ||
<a target="_blank" [routerLink]="['game/' + spec.game.id]"> | ||
{{ spec.game.name }} | ||
</a> | ||
</h4> | ||
|
||
<ul class="d-flex"> | ||
<li *ngFor="let challenge of spec.challenges" class="card challenge-card my-3 mr-3"> | ||
<div class="card-body"> | ||
<h5 class="overflow-ellipsis"> | ||
{{ challenge.team.name }} | ||
</h5> | ||
<button type="button" class="btn btn-link text-info" appCopyOnClick | ||
tooltip="Copy this support code" placement="bottom"> | ||
{{ {id: challenge.id, tag: spec.tag } | toSupportCode }} | ||
</button> | ||
<div class="challenge-times mt-2"> | ||
<div class="start-time"> | ||
<span class="font-bold">Launched: </span> | ||
<span>{{ challenge.startedAt | datetimeToDate | friendlyDateAndTime }}</span> | ||
</div> | ||
<div class="end-time"> | ||
<span class="font-bold">Session End: </span> | ||
<span>{{ challenge.team.session.end | datetimeToDate | friendlyDateAndTime }}</span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="card-footer d-flex align-items-center px-3"> | ||
<div class="flex-grow-1"> | ||
<a [href]="'/support/tickets?search=' + challenge.id" target="_blank" | ||
*ngIf="challenge.hasTickets" class="btn btn-warning" | ||
tooltip="View open tickets for this challenge" placement="bottom"> | ||
<fa-icon [icon]="fa.ticket" size="lg"></fa-icon> | ||
</a> | ||
</div> | ||
<a [href]="'/admin/support?search=' + challenge.id | relativeToAbsoluteHref" target="_blank" | ||
class="btn btn-info mr-2" tooltip="View this challenge's state" placement="bottom"> | ||
<fa-icon [icon]="fa.barsStaggered" size="lg"></fa-icon> | ||
</a> | ||
|
||
<a [href]="'/admin/registrar/' + spec.game.id + '?term=' + challenge.team.id" | ||
target="_blank" class="btn btn-info mr-2" | ||
[tooltip]="'View this ' + (spec.game.isTeamGame | thisOrThat:'team':'player') + '\'s session'" | ||
placement="bottom"> | ||
<fa-icon [icon]="spec.game.isTeamGame | thisOrThat:fa.peopleGroup:fa.person" | ||
size="lg"></fa-icon> | ||
</a> | ||
|
||
<a [href]="'/admin/observer/challenges/' + spec.game.id + '?search=' + challenge.id" | ||
target="_blank" class="btn btn-info mr-2" tooltip="Observe this challenge" | ||
placement="bottom"> | ||
<fa-icon [icon]="fa.eye" size="lg"></fa-icon> | ||
</a> | ||
|
||
<a [href]="'/game/' + spec.game.id" target="_blank" class="btn btn-info" | ||
tooltip="View this game" placement="bottom"> | ||
<fa-icon [icon]="fa.chessBoard" size="lg"></fa-icon> | ||
</a> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
</ng-container> | ||
</div> | ||
|
||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-info" (click)="close()">OK</button> | ||
</div> | ||
</div> | ||
|
||
<ng-template #noChallenges> | ||
<div class="text-center gray-text fs-11">There aren't any active challenges of this type right now.</div> | ||
</ng-template> | ||
|
||
<ng-template #loading> | ||
<app-spinner></app-spinner> | ||
</ng-template> |
43 changes: 43 additions & 0 deletions
43
...i/src/app/admin/components/active-challenges-modal/active-challenges-modal.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,43 @@ | ||
h3 { | ||
margin-bottom: 0; | ||
} | ||
|
||
h5 { | ||
margin-bottom: 0; | ||
padding-bottom: 0; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
li { | ||
flex-basis: 32%; | ||
min-width: 250px; | ||
} | ||
|
||
// bootstrap overrides (yuck) | ||
.card-footer { | ||
background-color: unset !important; | ||
} | ||
|
||
.spec-container:not(:nth-of-type(1)) { | ||
margin-top: 2rem; | ||
} | ||
|
||
.btn-link { | ||
padding: 0; | ||
} | ||
|
||
.game-link { | ||
font-size: 0.9rem; | ||
font-weight: bold; | ||
margin: 0; | ||
text-transform: uppercase; | ||
} | ||
|
||
.card-footer { | ||
border-top: dashed 1px gray; | ||
|
||
button { | ||
padding-left: 8px; | ||
padding-right: 8px; | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...-ui/src/app/admin/components/active-challenges-modal/active-challenges-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,54 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { fa } from "@/services/font-awesome.service"; | ||
import { firstValueFrom } from 'rxjs'; | ||
import { PlayerMode } from '@/api/player-models'; | ||
import { AppActiveChallengeSpec } from '@/api/admin.models'; | ||
import { AdminService } from '@/api/admin.service'; | ||
import { ModalConfirmService } from '@/services/modal-confirm.service'; | ||
import { RouterService } from '@/services/router.service'; | ||
|
||
@Component({ | ||
selector: 'app-active-challenges-modal', | ||
templateUrl: './active-challenges-modal.component.html', | ||
styleUrls: ['./active-challenges-modal.component.scss'] | ||
}) | ||
export class ActiveChallengesModalComponent implements OnInit { | ||
playerMode?: PlayerMode; | ||
|
||
protected errors: any[] = []; | ||
protected fa = fa; | ||
protected isPracticeMode = false; | ||
protected isWorking = false; | ||
protected specs: AppActiveChallengeSpec[] = []; | ||
|
||
constructor( | ||
private adminService: AdminService, | ||
private modalService: ModalConfirmService, | ||
private routerService: RouterService) { } | ||
|
||
async ngOnInit(): Promise<void> { | ||
if (!this.playerMode) | ||
throw new Error("Player mode not passed to active challenges modal."); | ||
|
||
await this.load(this.playerMode); | ||
} | ||
|
||
protected close() { | ||
this.modalService.hide(); | ||
} | ||
|
||
private async load(playerMode: PlayerMode): Promise<void> { | ||
this.errors = []; | ||
this.isPracticeMode = playerMode === PlayerMode.practice; | ||
|
||
try { | ||
this.isWorking = true; | ||
const response = await firstValueFrom(this.adminService.getActiveChallenges(playerMode)); | ||
this.specs = response.specs; | ||
this.isWorking = false; | ||
} | ||
catch (err: any) { | ||
this.errors.push(err); | ||
} | ||
} | ||
} |
Oops, something went wrong.