diff --git a/projects/gameboard-ui/src/app/admin/admin.module.ts b/projects/gameboard-ui/src/app/admin/admin.module.ts index 90c573e8..95a5497a 100644 --- a/projects/gameboard-ui/src/app/admin/admin.module.ts +++ b/projects/gameboard-ui/src/app/admin/admin.module.ts @@ -2,9 +2,8 @@ // Released under a MIT (SEI)-style license. See LICENSE.md in the project root for license information. import { CommonModule } from '@angular/common'; -import { inject, NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { ActivatedRoute, RouterModule } from '@angular/router'; +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; import { ScoreboardModule } from '@/scoreboard/scoreboard.module'; import { SponsorsModule } from '@/sponsors/sponsors.module'; @@ -155,7 +154,6 @@ import { GameIdResolver } from './resolvers/game-id.resolver'; ], imports: [ CommonModule, - FormsModule, EventHorizonModule, RouterModule.forChild([ { @@ -192,22 +190,22 @@ import { GameIdResolver } from './resolvers/game-id.resolver'; { path: "settings", component: PracticeSettingsComponent }, ] }, - { path: 'registrar/sponsors', component: SponsorBrowserComponent, title: "Admin | Sponsors" }, - { path: 'registrar/users', component: UserRegistrarComponent, title: "Admin | Users" }, - { path: 'registrar/players', component: PlayerNamesComponent }, - { path: 'observer/challenges/:id', component: ChallengeObserverComponent, title: "Admin | Observe" }, + { path: 'registrar/sponsors', component: SponsorBrowserComponent, title: "Sponsors | Admin" }, + { path: 'registrar/users', component: UserRegistrarComponent, title: "Users | Admin" }, + { path: 'registrar/players', component: PlayerNamesComponent, title: "Players | Admin" }, + { path: 'observer/challenges/:id', component: ChallengeObserverComponent, title: "Observe | Admin" }, { path: 'observer/teams/:id', component: TeamObserverComponent }, - { path: 'overview', component: AdminOverviewComponent, title: "Admin | Overview" }, - { path: "permissions", component: AdminRolesComponent }, + { path: 'overview', component: AdminOverviewComponent, title: "Live | Admin " }, + { path: "permissions", component: AdminRolesComponent, title: "Permissions | Admin" }, { path: 'report/users', component: UserReportComponent }, { path: 'report/sponsors', component: PlayerSponsorReportComponent }, { path: 'report/challenges', component: ChallengeReportComponent }, { path: 'report/feedback', component: FeedbackReportComponent }, { path: 'report/support', component: SupportReportLegacyComponent }, { path: 'report/participation', component: ParticipationReportComponent }, - { path: "notifications", component: AdminSystemNotificationsComponent }, - { path: "support/settings", component: SupportSettingsComponent, title: "Admin | Support" }, - { path: 'support', component: ChallengeBrowserComponent } + { path: "notifications", component: AdminSystemNotificationsComponent, title: "System Notifications | Admin" }, + { path: "support/settings", component: SupportSettingsComponent, title: "Support | Admin" }, + { path: 'support', component: ChallengeBrowserComponent, title: "Challenges | Admin" } ] }, ]), diff --git a/projects/gameboard-ui/src/app/admin/player-names/player-names.component.html b/projects/gameboard-ui/src/app/admin/player-names/player-names.component.html index f650cb0a..062d2de0 100644 --- a/projects/gameboard-ui/src/app/admin/player-names/player-names.component.html +++ b/projects/gameboard-ui/src/app/admin/player-names/player-names.component.html @@ -41,9 +41,11 @@

Players

{{player.approvedName}} - {{player.pendingName}}
+ {{player.name}}
- {{player.gameName}} — + + {{player.gameName}} — + user:   {{ player.userId | slice:0:8 }} player:   @@ -55,21 +57,26 @@

Players

- - - + + + + + + +
+
diff --git a/projects/gameboard-ui/src/app/admin/player-names/player-names.component.ts b/projects/gameboard-ui/src/app/admin/player-names/player-names.component.ts index d6b5c5ca..cd964e3e 100644 --- a/projects/gameboard-ui/src/app/admin/player-names/player-names.component.ts +++ b/projects/gameboard-ui/src/app/admin/player-names/player-names.component.ts @@ -7,6 +7,7 @@ import { BehaviorSubject, combineLatest, firstValueFrom, Observable, timer } fro import { debounceTime, switchMap, tap } from 'rxjs/operators'; import { Player, PlayerSearch } from '../../api/player-models'; import { PlayerService } from '../../api/player.service'; +import { AdminService } from '@/api/admin.service'; @Component({ selector: 'app-player-names', @@ -37,7 +38,9 @@ export class PlayerNamesComponent { faTimes = faTimes; faUndo = faUndo; - constructor(private api: PlayerService) { + constructor( + private adminService: AdminService, + private api: PlayerService) { this.players$ = combineLatest([ this.refresh$, @@ -74,11 +77,11 @@ export class PlayerNamesComponent { })); } - approveName(model: Player): void { + async approveName(model: Player) { model.approvedName = model.name; model.nameStatus = ""; model.pendingName = ""; - this.update(model); + await this.adminService.approvePlayerName(model.id, { name: model.name }); } resetName(model: Player): void { diff --git a/projects/gameboard-ui/src/app/api/player.service.ts b/projects/gameboard-ui/src/app/api/player.service.ts index 25d41a2d..0d2e2d94 100644 --- a/projects/gameboard-ui/src/app/api/player.service.ts +++ b/projects/gameboard-ui/src/app/api/player.service.ts @@ -7,7 +7,7 @@ import { Observable, Subject } from 'rxjs'; import { map, tap } from 'rxjs/operators'; import { GameSessionService } from '@/services/game-session.service'; import { ConfigService } from '../utility/config.service'; -import { ChangedPlayer, NewPlayer, Player, PlayerCertificate, PlayerEnlistment, Standing, Team, TeamAdvancement, TeamChallenge, TeamInvitation, TeamSummary, TimeWindow } from './player-models'; +import { ChangedPlayer, NewPlayer, Player, PlayerCertificate, PlayerEnlistment, Standing, Team, TeamChallenge, TeamInvitation, TimeWindow } from './player-models'; @Injectable({ providedIn: 'root' }) export class PlayerService { diff --git a/projects/gameboard-ui/src/app/system-notifications/components/admin-system-notifications/admin-system-notifications.component.ts b/projects/gameboard-ui/src/app/system-notifications/components/admin-system-notifications/admin-system-notifications.component.ts index 2a5ac9b7..7f980bd8 100644 --- a/projects/gameboard-ui/src/app/system-notifications/components/admin-system-notifications/admin-system-notifications.component.ts +++ b/projects/gameboard-ui/src/app/system-notifications/components/admin-system-notifications/admin-system-notifications.component.ts @@ -34,7 +34,6 @@ export class AdminSystemNotificationsComponent implements OnInit { } ngOnInit(): void { - this.appTitleService.set("System Notifications | Admin"); this._forceLoad$.next(true); }