From a5b990b854634d9dec8902e16a23a3a5425ed953 Mon Sep 17 00:00:00 2001 From: Ben Stein <115497763+sei-bstein@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:19:09 -0500 Subject: [PATCH] v3.27.0 (#214) * Certificates revamp MVP * Light revamp of name approvals --- .../src/app/admin/admin.module.ts | 5 + .../game-center-settings.component.html | 49 ++----- .../game-center-settings.component.ts | 19 +++ .../game-center-team-detail.component.html | 86 ++++++----- .../game-center-team-detail.component.ts | 24 +++- .../player-names/player-names.component.ts | 5 +- .../practice-settings.component.html | 13 +- .../practice-settings.component.ts | 29 ++-- .../gameboard-ui/src/app/api/admin.models.ts | 11 +- .../gameboard-ui/src/app/api/admin.service.ts | 4 +- .../src/app/api/certificates.service.ts | 38 ++++- .../gameboard-ui/src/app/api/game-models.ts | 4 +- .../app/certificates/certificates.models.ts | 65 +++++++++ .../certificate-previewer.component.html | 20 +++ .../certificate-previewer.component.scss | 8 ++ .../certificate-previewer.component.ts | 46 ++++++ ...certificate-template-picker.component.html | 127 ++++++++++++++++ ...certificate-template-picker.component.scss | 3 + .../certificate-template-picker.component.ts | 136 ++++++++++++++++++ ...meboard-performance-summary.component.html | 2 +- .../feedback-template-picker.component.html | 3 +- .../pages/game-page/game-page.component.html | 2 +- ...tice-challenge-solved-modal.component.html | 10 +- ...actice-challenge-solved-modal.component.ts | 30 ++-- .../practice-session.component.ts | 1 + .../gameboard-ui/src/app/prac/prac.module.ts | 5 +- .../src/app/prac/practice.models.ts | 2 +- .../report-stat-summary.component.html | 8 +- .../enrollment-report.component.ts | 8 +- .../enrollment-report.models.ts | 14 +- .../games/components/play/play.component.html | 2 +- .../certificate-printer.component.ts | 6 +- .../certificate-publish-controls.component.ts | 2 +- .../certificates/certificates.component.ts | 8 +- .../competitive-certificates.component.html | 29 ++-- .../competitive-certificates.component.ts | 54 +++---- .../practice-certificates.component.html | 5 +- .../practice-certificates.component.scss | 4 +- .../practice-certificates.component.ts | 2 +- .../gameboard-ui/src/app/users/functions.ts | 10 +- .../src/app/users/users.models.ts | 34 ----- .../src/app/users/users.module.ts | 2 - .../certificate-template.sample.html | 0 .../practice-certificate.template.html | 47 ------ projects/gameboard-ui/src/styles.scss | 12 +- 45 files changed, 670 insertions(+), 324 deletions(-) create mode 100644 projects/gameboard-ui/src/app/certificates/certificates.models.ts create mode 100644 projects/gameboard-ui/src/app/certificates/components/certificate-previewer/certificate-previewer.component.html create mode 100644 projects/gameboard-ui/src/app/certificates/components/certificate-previewer/certificate-previewer.component.scss create mode 100644 projects/gameboard-ui/src/app/certificates/components/certificate-previewer/certificate-previewer.component.ts create mode 100644 projects/gameboard-ui/src/app/certificates/components/certificate-template-picker/certificate-template-picker.component.html create mode 100644 projects/gameboard-ui/src/app/certificates/components/certificate-template-picker/certificate-template-picker.component.scss create mode 100644 projects/gameboard-ui/src/app/certificates/components/certificate-template-picker/certificate-template-picker.component.ts create mode 100644 projects/gameboard-ui/src/assets/templates/certificate-template.sample.html delete mode 100644 projects/gameboard-ui/src/assets/templates/practice-certificate.template.html diff --git a/projects/gameboard-ui/src/app/admin/admin.module.ts b/projects/gameboard-ui/src/app/admin/admin.module.ts index 912dbcba3..63b187a08 100644 --- a/projects/gameboard-ui/src/app/admin/admin.module.ts +++ b/projects/gameboard-ui/src/app/admin/admin.module.ts @@ -88,6 +88,8 @@ import { ToSupportCodePipe } from '@/standalone/core/pipes/to-support-code.pipe' import { IfHasPermissionDirective } from '@/standalone/directives/if-has-permission.directive'; import { FeedbackTemplatePickerComponent } from "../feedback/components/feedback-template-picker/feedback-template-picker.component"; import { UserPickerComponent } from '@/standalone/users/user-picker/user-picker.component'; +import { CertificateTemplatePickerComponent } from '@/certificates/components/certificate-template-picker/certificate-template-picker.component'; +import { CertificatePreviewerComponent } from '@/certificates/components/certificate-previewer/certificate-previewer.component'; @NgModule({ declarations: [ @@ -160,6 +162,7 @@ import { UserPickerComponent } from '@/standalone/users/user-picker/user-picker. RouterModule.forChild([ { path: '', component: AdminPageComponent, title: "Admin", children: [ + { path: "certificates/templates/:templateId/preview", component: CertificatePreviewerComponent, title: "Certificate Template Preview" }, { path: '', pathMatch: 'full', redirectTo: 'dashboard' }, { path: 'dashboard', component: DashboardComponent }, { @@ -225,6 +228,8 @@ import { UserPickerComponent } from '@/standalone/users/user-picker/user-picker. SafeUrlPipe, SpinnerComponent, ToSupportCodePipe, + CertificatePreviewerComponent, + CertificateTemplatePickerComponent, FeedbackTemplatePickerComponent, UserPickerComponent, ] diff --git a/projects/gameboard-ui/src/app/admin/components/game-center/game-center-settings/game-center-settings.component.html b/projects/gameboard-ui/src/app/admin/components/game-center/game-center-settings/game-center-settings.component.html index 5589c676b..7b2a05580 100644 --- a/projects/gameboard-ui/src/app/admin/components/game-center/game-center-settings/game-center-settings.component.html +++ b/projects/gameboard-ui/src/app/admin/components/game-center/game-center-settings/game-center-settings.component.html @@ -147,6 +147,7 @@
+

Player Feedback

@@ -157,46 +158,14 @@
-
- - - design with HTML and inline/internal CSS; use a 11:8.5 aspect ratio - -
-

- Insert dynamic content by referring to a property with double-curly syntax - {{"\{\{game_name\}\}"}}. For example, - <h1>{{"\{\{leaderboard_name\}\}"}}</h1>.
- The following properties will get replaced when a player certificate renders: -

-
-      game_name — Name of this game
-      competition — Competition type of this game
-      season — Season of this game
-      round — Round of this game
-      track — Track of this game
-      user_name — Individual user's approved name
-      score — Total player score for this game
-      rank — Final leaderboard ranking of the player
-      leaderboard_name — Approved name for either team or individual
-      date — Date player's session ended for this game
-      player_count — Number of players who participated in this game
-      team_count — Number of teams who participated in this game
-

- Tip: Create an outer div with fixed height and width and position: relative. - Create inner - divs with position: absolute; text-align: center; and set textbox width and X/Y - position with - top: __px; left: __px; width: __px;. - To add a background image, use - background-size: 100% 100%; background-image: url('URL_HERE'); -

-
-
+

Completion Certificates

+ +
diff --git a/projects/gameboard-ui/src/app/admin/components/game-center/game-center-settings/game-center-settings.component.ts b/projects/gameboard-ui/src/app/admin/components/game-center/game-center-settings/game-center-settings.component.ts index e7e51f939..243ca0ac5 100644 --- a/projects/gameboard-ui/src/app/admin/components/game-center/game-center-settings/game-center-settings.component.ts +++ b/projects/gameboard-ui/src/app/admin/components/game-center/game-center-settings/game-center-settings.component.ts @@ -10,6 +10,7 @@ import { UnsubscriberService } from '@/services/unsubscriber.service'; import { ToastService } from '@/utility/services/toast.service'; import { ActivatedRoute } from '@angular/router'; import { FeedbackTemplateView } from '@/feedback/feedback.models'; +import { CertificateTemplateView } from '@/certificates/certificates.models'; export type SelectedSubTab = "settings" | "modes" | "registration"; @@ -86,6 +87,24 @@ export class GameCenterSettingsComponent implements AfterViewInit { } } + protected async handleCertificateTemplateChanged(template?: CertificateTemplateView) { + if (!this.game) { + throw new Error("Game is required"); + } + + this.game.certificateTemplateId = template?.id; + await firstValueFrom(this.gameService.update(this.game)); + } + + protected async handlePracticeCertificateTemplateChanged(template?: CertificateTemplateView) { + if (!this.game) { + throw new Error("Game is required"); + } + + this.game.practiceCertificateTemplateId = template?.id; + await firstValueFrom(this.gameService.update(this.game)); + } + protected async handleChallengesFeedbackTemplateChanged(template?: FeedbackTemplateView) { if (!this.game) { throw new Error("Game is required"); diff --git a/projects/gameboard-ui/src/app/admin/components/game-center/game-center-team-detail/game-center-team-detail.component.html b/projects/gameboard-ui/src/app/admin/components/game-center/game-center-team-detail/game-center-team-detail.component.html index 54dad34b0..f5abcbf41 100644 --- a/projects/gameboard-ui/src/app/admin/components/game-center/game-center-team-detail/game-center-team-detail.component.html +++ b/projects/gameboard-ui/src/app/admin/components/game-center/game-center-team-detail/game-center-team-detail.component.html @@ -15,48 +15,49 @@
Score
-

Team Management

-
-