Skip to content

Commit

Permalink
Merge branch 'next' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Dec 5, 2023
2 parents f9ee06b + 0e9855d commit b72a07e
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 20 deletions.
4 changes: 2 additions & 2 deletions projects/gameboard-ui/src/app/api/game.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export class GameService {
);
}

public getGamePlayState(gameId: string, teamId: string): Observable<GamePlayState> {
return this.http.get<GamePlayState>(`${this.url}/game/${gameId}/play-state/${teamId}`);
public getGamePlayState(gameId: string): Observable<GamePlayState> {
return this.http.get<GamePlayState>(`${this.url}/game/${gameId}/play-state}`);
}

public getSyncStartState(gameId: string): Observable<SyncStartGameState> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ export class ContinueToGameboardButtonComponent implements OnChanges {
private routerService: RouterService) { }

async ngOnChanges(changes: SimpleChanges): Promise<void> {
// then we need to manually check if they've already started and redirect if so
// const gameStartPhase = await firstValueFrom(this.apiGame.getStartPhase(ctx.game.id, ctx.player.teamId));
// this.logService.logInfo(`Game ${ctx.game.id} (player ${ctx.player.id}) is at start phase "${gameStartPhase}".`);

// if (gameStartPhase == GameStartPhase.Started || gameStartPhase == GameStartPhase.Starting) {
// this.redirectToExternalGameLoadingPage(ctx);
// }

if (changes.context && !!this.context) {
switch (this.context.gameMode) {
case "vm":
Expand Down Expand Up @@ -69,7 +61,7 @@ export class ContinueToGameboardButtonComponent implements OnChanges {
.toString();

// this is only enabled if the game is started or starting
const playState = await firstValueFrom(this.gameService.getGamePlayState(context.gameId, context.player.teamId));
const playState = await firstValueFrom(this.gameService.getGamePlayState(context.gameId));
this.isEnabled = playState == GamePlayState.Started || playState == GamePlayState.Starting;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class ExternalGameLinkBannerComponent implements OnInit {

this.isExternalGameReady$ = combineLatest([
this.gameService.retrieve(this.gameId),
this.gameService.getGamePlayState(this.gameId, this.teamId)
this.gameService.getGamePlayState(this.gameId)
]).pipe(
map(([game, playState]) => ({ mode: game.mode, playState })),
map(modeAndPlayState => modeAndPlayState.mode == GameEngineMode.External && modeAndPlayState.playState == GamePlayState.Started)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class ExternalGameLoadingPageComponent implements OnInit {
this.log.logInfo("Launching game with context", ctx);

// if the player already has a session for the game and it's happening right now, move them along
const playState = await firstValueFrom(this.gameApi.getGamePlayState(ctx.game.id, ctx.player.teamId));
const playState = await firstValueFrom(this.gameApi.getGamePlayState(ctx.game.id));
if (playState == GamePlayState.Started) {
this.log.logInfo("The game is already started - move them to the game page", ctx.player);
this.handleGameReady(ctx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class ExternalSyncGameGuard implements CanActivate, CanActivateChild {
return false;
}

const playState = await firstValueFrom(this.gameService.getGamePlayState(gameId, teamId));
const playState = await firstValueFrom(this.gameService.getGamePlayState(gameId));
return playState == GamePlayState.Started;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ export class GameIsStarted implements CanActivate, CanActivateChild {
}
this.log.logInfo("Resolved gameId for GameIsStartedGuard", gameId);

return await firstValueFrom(this.gameService.getGamePlayState(resolvedGameId, player.teamId).pipe(map(phase => phase == GamePlayState.Started)));
return await firstValueFrom(this.gameService.getGamePlayState(resolvedGameId).pipe(map(phase => phase == GamePlayState.Started)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1 class="mt-3">Notifications</h1>
<hr class="light" />
</div>

<table class="mt-5">
<table class="mt-5 w-100" *ngIf="(notifications$ | async)?.length; else noNotifications">
<col> <!--notification text-->
<col> <!--type-->
<col> <!--dates-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
.notification-content-cell {
width: 35%;
}

.notification-content {
color: #bababa;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 35vw;
max-width: 25vw;
}

td, th {
Expand Down

0 comments on commit b72a07e

Please sign in to comment.