Skip to content

Commit

Permalink
Tweaks to deploy controls on external team admin.
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Nov 17, 2023
1 parent 1ef3931 commit d3e08c0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ <h1>{{context.game.name}}</h1>

<div *ngIf="context.teams.length
" class="global-controls-container my-2 d-flex align-items-center justify-content-end">
<app-confirm-button btnClass="btn btn-lg btn-info" [disabled]="context.isPreDeploying"
<app-confirm-button btnClass="btn btn-lg btn-info" [disabled]="canDeploy"
(confirm)="handlePreDeployAllClick(context.game.id)"
[tooltip]="context.isPreDeploying ? 'Resources are being deployed for this game. Hang tight...' : ''">
[tooltip]="context.overallDeployStatus == 'deploying' ? 'Resources are being deployed for this game. Hang tight...' : ''">
Predeploy all
</app-confirm-button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface ExternalGameAdminChallenge {

export interface ExternalGameAdminContext {
game: SimpleEntity;
isPreDeploying: boolean;
overallDeployStatus: DeployStatus;
specs: SimpleEntity[];
hasNonStandardSessionWindow: boolean;
startTime?: DateTime;
Expand All @@ -53,9 +53,12 @@ export interface ExternalGameAdminContext {
export class ExternalGameAdminComponent implements OnInit {
private gameId: string | null = null;
private autoUpdateInterval = 30000;

protected ctx$?: Observable<ExternalGameAdminContext>;
protected context?: ExternalGameAdminContext;
protected errors: any[] = [];
protected canDeploy = false;
protected deployAllTooltip = "";

constructor(
private route: ActivatedRoute,
Expand All @@ -76,7 +79,17 @@ export class ExternalGameAdminComponent implements OnInit {
this.errors.push(err);
return caught;
}),
tap(ctx => this.appTitleService.set(`${ctx.game.name} : External Game`))
tap(ctx => {
this.appTitleService.set(`${ctx.game.name} : External Game`);
this.canDeploy = ctx.overallDeployStatus == 'notStarted';

if (ctx.overallDeployStatus == "deploying") {
this.deployAllTooltip = "Resources are being deployed for this game. Hang tight...";
}
else if (ctx.overallDeployStatus == "deployed") {
this.deployAllTooltip = "All of this game's resources have been deployed.";
}
})
);
}
})
Expand Down

0 comments on commit d3e08c0

Please sign in to comment.