Skip to content

Commit

Permalink
v3.21.1 (#193)
Browse files Browse the repository at this point in the history
* Fix titling in admin, link game in Players to game center, fix display bugs with Admin -> Players

* UPdate admin titling for readability
  • Loading branch information
sei-bstein authored Sep 24, 2024
1 parent bbb59a9 commit 21a510e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 34 deletions.
24 changes: 11 additions & 13 deletions projects/gameboard-ui/src/app/admin/admin.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -155,7 +154,6 @@ import { GameIdResolver } from './resolvers/game-id.resolver';
],
imports: [
CommonModule,
FormsModule,
EventHorizonModule,
RouterModule.forChild([
{
Expand Down Expand Up @@ -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" }
]
},
]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ <h4>Players</h4>
<div>
<div class="player-info">
<span class="mx-2">{{player.approvedName}}</span>
<span class="text-muted">{{player.pendingName}}</span><br />
<span class="text-muted" *ngIf="player.name && player.name !== player.approvedName">{{player.name}}</span><br />
<small class="text-muted">
<span>{{player.gameName}}</span> &mdash;
<a [routerLink]="'/admin/game/' + player.gameId">
<span>{{player.gameName}}</span> &mdash;
</a>
<span>user: </span>&nbsp;
<app-clipspan class="mr-2">{{ player.userId | slice:0:8 }}</app-clipspan>
<span>player: </span>&nbsp;
Expand All @@ -55,21 +57,26 @@ <h4>Players</h4>
</small>
</div>
</div>
<button *ngIf="player.name!==player.approvedName" class="btn btn-outline-info btn-sm mx-1"
(click)="approveName(player)">
<fa-icon [icon]="faCheck"></fa-icon>
<span>Approve</span>
</button>
<button *ngIf="player.name!==player.approvedName" class="btn btn-outline-info btn-sm mx-1"
(click)="resetName(player)">
<fa-icon [icon]="faUndo"></fa-icon>
<span>Reset</span>
</button>
<button *ngIf="player.name!==player.approvedName" class="btn btn-outline-info btn-sm mx-1" (click)="view(player)">
<fa-icon [icon]="faTimes"></fa-icon>
<span>Disapprove</span>
</button>

<ng-container *ngIf="player.name && player.name !== player.approvedName">
<button *ngIf="player.name!==player.approvedName" class="btn btn-outline-info btn-sm mx-1"
(click)="approveName(player)">
<fa-icon [icon]="faCheck"></fa-icon>
<span>Approve</span>
</button>
<button *ngIf="player.name && player.name!==player.approvedName" class="btn btn-outline-info btn-sm mx-1"
(click)="resetName(player)">
<fa-icon [icon]="faUndo"></fa-icon>
<span>Reset</span>
</button>
<button *ngIf="player.name!==player.approvedName" class="btn btn-outline-info btn-sm mx-1" (click)="view(player)">
<fa-icon [icon]="faTimes"></fa-icon>
<span>Disapprove</span>
</button>
</ng-container>

<div class="spacer"></div>

<div *ngIf="viewed === player" class="col-12">
<div class="form-group">
<label class="mb-0" for="name-input">Approved Name</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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$,
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion projects/gameboard-ui/src/app/api/player.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export class AdminSystemNotificationsComponent implements OnInit {
}

ngOnInit(): void {
this.appTitleService.set("System Notifications | Admin");
this._forceLoad$.next(true);
}

Expand Down

0 comments on commit 21a510e

Please sign in to comment.