From 7e26017885b30c1b16a055aea9d81c9c304848dd Mon Sep 17 00:00:00 2001 From: Ben Stein <115497763+sei-bstein@users.noreply.github.com> Date: Thu, 30 Jan 2025 16:19:48 -0500 Subject: [PATCH] v3.29.0 (#227) * Fix broken practicea area url builder (base href) * Add team challenge management modal * Move context menu item down and mark it danger --- ...me-center-team-context-menu.component.html | 16 ++- ...game-center-team-context-menu.component.ts | 11 ++ .../game-center-team-detail.component.html | 12 +- .../game-center-team-detail.component.ts | 17 --- .../team-challenges-modal.component.html | 105 ++++++++++++++++++ .../team-challenges-modal.component.scss | 0 .../team-challenges-modal.component.ts | 99 +++++++++++++++++ .../gameboard-ui/src/app/api/board.service.ts | 6 +- .../src/app/api/challenges.service.ts | 14 ++- .../src/app/api/player.service.ts | 3 - .../gameboard-ui/src/app/api/team.service.ts | 6 +- .../gameboard-ui/src/app/api/teams.models.ts | 18 ++- .../app/api/user-role-permissions.models.ts | 1 + .../src/app/core/pipes/can.pipe.ts | 14 ++- .../session-start-controls.component.html | 2 +- .../pages/game-page/game-page.component.html | 2 +- .../gameboard-page.component.ts | 4 +- .../player-enroll.component.html | 2 +- .../src/app/services/font-awesome.service.ts | 10 +- .../src/app/services/router.service.ts | 5 +- .../components/spinner/spinner.component.ts | 3 +- .../src/app/stores/active-challenges.store.ts | 5 + .../user-page/user-page.component.html | 2 +- 23 files changed, 299 insertions(+), 58 deletions(-) create mode 100644 projects/gameboard-ui/src/app/admin/components/team-challenges-modal/team-challenges-modal.component.html create mode 100644 projects/gameboard-ui/src/app/admin/components/team-challenges-modal/team-challenges-modal.component.scss create mode 100644 projects/gameboard-ui/src/app/admin/components/team-challenges-modal/team-challenges-modal.component.ts diff --git a/projects/gameboard-ui/src/app/admin/components/game-center/game-center-team-context-menu/game-center-team-context-menu.component.html b/projects/gameboard-ui/src/app/admin/components/game-center/game-center-team-context-menu/game-center-team-context-menu.component.html index 303971e2d..ee1836ef5 100644 --- a/projects/gameboard-ui/src/app/admin/components/game-center/game-center-team-context-menu/game-center-team-context-menu.component.html +++ b/projects/gameboard-ui/src/app/admin/components/game-center/game-center-team-context-menu/game-center-team-context-menu.component.html @@ -23,22 +23,23 @@
-+ Be very careful with these tools. Starting a challenge on a player or + team's behalf will affect their cumulative time, and undeploying or purging it will erase all + progress they've made on it. Use with caution! +
+ ++ Enter the team's admin code ({{ unlockAdminCode }}) below to unlock challenge + management tools. +
+Challenge | +Available | +Manage | +
---|---|---|
+ {{ challenge.spec.name }}
+
+
+ {{ challenge.score || 0 }} / {{ challenge.scoreMax }} points ·
+
+ |
+
+
+ {{ challenge.availabilityRange.start | friendlyDateAndTime }}
+ ‐
+ {{ challenge.availabilityRange.end | friendlyDateAndTime }}
+
+ |
+
+
+
+
+ |
+
+
This game is now in Practice mode. If you want to try your hand at its challenges, head over to the Practice Area. diff --git a/projects/gameboard-ui/src/app/game/pages/gameboard-page/gameboard-page.component.ts b/projects/gameboard-ui/src/app/game/pages/gameboard-page/gameboard-page.component.ts index 8e8fb9399..7eb77f50c 100644 --- a/projects/gameboard-ui/src/app/game/pages/gameboard-page/gameboard-page.component.ts +++ b/projects/gameboard-ui/src/app/game/pages/gameboard-page/gameboard-page.component.ts @@ -204,7 +204,7 @@ export class GameboardPageComponent { // stop gamespace this.deploying = true; if (!model.instance) { return; } - this.api.stop({ id: model.instance.id }).subscribe( + this.api.undeployResources({ id: model.instance.id }).subscribe( c => this.syncOne(c) ); } @@ -215,7 +215,7 @@ export class GameboardPageComponent { // otherwise, start gamespace this.deploying = true; - this.api.start({ id: model.instance.id }).pipe( + this.api.deployResources({ id: model.instance.id }).pipe( catchError(e => { this.renderLaunchError(e); return of({} as Challenge); diff --git a/projects/gameboard-ui/src/app/game/player-enroll/player-enroll.component.html b/projects/gameboard-ui/src/app/game/player-enroll/player-enroll.component.html index 42d2ba920..1cf3e1ef2 100644 --- a/projects/gameboard-ui/src/app/game/player-enroll/player-enroll.component.html +++ b/projects/gameboard-ui/src/app/game/player-enroll/player-enroll.component.html @@ -160,7 +160,7 @@