Skip to content

Commit

Permalink
v3.24.1 (#204)
Browse files Browse the repository at this point in the history
* Fix tracking of active prac challenge

* Minor cleanup and improved console logging

* Bug fixes and challenge report tags filter.

* Fix event horizon, game center teams, enrollment report stat summary, progress widget

* Fix issue with past games not showing ongoing ones

* WIP question sets

* More question set stuff

* Improvements to OIDC experience and support for auto log in/out.

* merge from next

* Add favicon defaults. Update theme

* Fix settings link bug, more thing

* Theme stuff

* Add settings link to user menu

* Theme stuff

* Revert "Theme stuff"

This reverts commit a26c715.

* Revert "Add settings link to user menu"

This reverts commit d640ee8.

* Revert "Theme stuff"

This reverts commit c3e3b69.

* Revert "Fix settings link bug, more thing"

This reverts commit f96dc59.

* Revert "Add favicon defaults. Update theme"

This reverts commit 1b2e5a7.

* Rollback and reimplement oauth changes

* Update oidc settings to match topo

* Cleanup

* Update dev env settings

* Improvements to OIDC experience and support for auto log in/out.

* Restore ux improvements

* More retheme

* Retheming and initial work on name improvements.

* Update gh action versions

* Retheming and name mgmt

* Styling stuff

* Styling stuff

* Move challenge markdown

* Un 'fix' start practice button

* minor name fixes

* Name cleanup

* Finish merge from main

* More theming and fix to GBAPI#502

* More theming and markdown fix

* More style fixes

* Partially address GBAPI#254

* Return question example answers

* Auto-select first available uncompleted tab

* Standard challenge panel sticky enhancements

* Styling

* Roll back login experience changes

* Settings bug fix and hide rename cert

* Minor theme stuff

* Theming

* Add additional sticky panel toggle button

* Theming and console stuff

* Fix deploy UI issue
  • Loading branch information
sei-bstein authored Nov 11, 2024
1 parent bd3321c commit 3046ee0
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 56 deletions.
2 changes: 1 addition & 1 deletion projects/gameboard-mks/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
</ng-container>

<ng-template #loading>
<!-- <app-spinner></app-spinner> -->
<app-spinner></app-spinner>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
(userAction)="handleUserActivity($event)"></app-user-activity-listener>

<div class="console-wrapper">
<div #consoleCanvas id="console-canvas-" [class.canvas]="!viewOnly" [class.embedded]="viewOnly"
<div #consoleCanvas id="console-canvas-" [class.canvas]="!isReadOnly" [class.embedded]="isReadOnly"
[class.mock-console-connected]="isMock && state==='connected'">

<button *ngIf="isConnected && showCog && !viewOnly" class="btn overlay overlay-tl cog"
<button *ngIf="isConnected && showCog && !isReadOnly" class="btn overlay overlay-tl cog"
(click)="showUtilities()">&#x2699;</button>

<div #audienceDiv class="audience overlay overlay-tr">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ import { LogService } from '@/services/log.service';
})
export class ConsoleComponent implements AfterViewInit, OnDestroy {
@Input() index = 0;
@Input() viewOnly = false;
@Input() request!: ConsoleRequest;
@ViewChild('consoleCanvas') consoleCanvas!: ElementRef;
@ViewChild('audienceDiv') audienceDiv!: ElementRef;
canvasId = '';
vmId = '';
console!: ConsoleService;

protected isReadOnly = false;

state = 'loading';
shadowstate = 'loading';
shadowTimer: any;
Expand Down Expand Up @@ -93,19 +94,7 @@ export class ConsoleComponent implements AfterViewInit, OnDestroy {
this.canvasId = el.id + this.index;
el.id += this.index;

let teamNameBit = "";
if (this.request.teamName)
teamNameBit = `${this.request.teamName} on`

let onConsoleBit = "console";
if (this.request?.name)
onConsoleBit = this.request.name;

let challengeNameBit = "";
if (this.request.challengeName)
challengeNameBit = ` :: ${this.request.challengeName}`;

this.titleSvc.setTitle(teamNameBit + onConsoleBit + challengeNameBit);
this.titleSvc.setTitle(this.buildTitle());

if (!!this.request.observer) {
this.showCog = false;
Expand All @@ -121,6 +110,8 @@ export class ConsoleComponent implements AfterViewInit, OnDestroy {
e.preventDefault();
this.audiencePos = e;
};

this.isReadOnly = (this.request.observer || "false").toString() === "1";
}

ngOnDestroy(): void {
Expand Down Expand Up @@ -219,7 +210,7 @@ export class ConsoleComponent implements AfterViewInit, OnDestroy {

this.console.connect(info.url, (state: string) => this.changeState(state), {
canvasId: this.canvasId,
viewOnly: this.viewOnly,
viewOnly: this.isReadOnly,
changeResolution: !!this.request.fullbleed,
ticket: info.ticket,
});
Expand Down Expand Up @@ -373,4 +364,20 @@ export class ConsoleComponent implements AfterViewInit, OnDestroy {
this.audiencePos = e;
}
}

private buildTitle() {
let teamNameBit = "";
if (this.request.teamName)
teamNameBit = `${this.request.teamName} on`

let onConsoleBit = "console";
if (this.request?.name)
onConsoleBit = this.request.name;

let challengeNameBit = "";
if (this.request.challengeName)
challengeNameBit = ` :: ${this.request.challengeName}`;

return `${teamNameBit}${onConsoleBit}${challengeNameBit}`
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2021 Carnegie Mellon University.
// Released under a MIT (SEI)-style license. See LICENSE.md in the project root.


export interface ConsoleService {
connect(url: string, stateCallback: (state: string) => void, options: any): void;
disconnect(): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,50 @@ export class WmksConsoleService implements ConsoleService {
};
stateChanged!: (state: string) => void;

constructor() { }

connect(url: string, stateCallback: (state: string) => void, options: any = {} ): void {
connect(url: string, stateCallback: (state: string) => void, options: any = {}): void {

if (stateCallback) { this.stateChanged = stateCallback; }
this.options = {...this.options, ...options};
this.options = { ...this.options, ...options };

if (this.wmks) {
this.wmks.destroy();
this.wmks = null;
}

let wmks = WMKS.createWMKS(options.canvasId, this.options)
.register(WMKS.CONST.Events.CONNECTION_STATE_CHANGE, (event: any, data: any) => {

switch (data.state) {
case WMKS.CONST.ConnectionState.CONNECTED:
stateCallback('connected');
break;

case WMKS.CONST.ConnectionState.DISCONNECTED:
stateCallback('disconnected');
wmks.destroy();
wmks = null;
break;
}
})
.register(WMKS.CONST.Events.REMOTE_SCREEN_SIZE_CHANGE, (e: any, data: any) => {
// console.log('wmks remote_screen_size_change: ' + data.width + 'x' + data.height);
// TODO: if embedded, pass along dimension to canvas wrapper element
})
.register(WMKS.CONST.Events.HEARTBEAT, (e: any, data: any) => {
let wmks = WMKS
.createWMKS(options.canvasId, this.options)
.register(WMKS.CONST.Events.CONNECTION_STATE_CHANGE, (event: any, data: any) => {
switch (data.state) {
case WMKS.CONST.ConnectionState.CONNECTED:
stateCallback('connected');
break;

case WMKS.CONST.ConnectionState.DISCONNECTED:
stateCallback('disconnected');
wmks.destroy();
wmks = null;
break;
}
})
.register(WMKS.CONST.Events.REMOTE_SCREEN_SIZE_CHANGE, (e: any, data: any) => {
// console.log('wmks remote_screen_size_change: ' + data.width + 'x' + data.height);
// TODO: if embedded, pass along dimension to canvas wrapper element
})
.register(WMKS.CONST.Events.HEARTBEAT, (e: any, data: any) => {
// debug('wmks heartbeat: ' + data);
// console.log('wmks heartbeat: ' + data);
})
.register(WMKS.CONST.Events.COPY, (e: any, data: any) => {
})
.register(WMKS.CONST.Events.COPY, (e: any, data: any) => {
// console.log('wmks copy: ' + data);
stateCallback('clip:' + data);
})
.register(WMKS.CONST.Events.ERROR, (e: any, data: any) => {
})
.register(WMKS.CONST.Events.ERROR, (e: any, data: any) => {
// debug('wmks error: ' + data.errorType);

})
.register(WMKS.CONST.Events.FULL_SCREEN_CHANGE, (e: any, data: any) => {
})
.register(WMKS.CONST.Events.FULL_SCREEN_CHANGE, (e: any, data: any) => {
// debug('wmks full_screen_change: ' + data.isFullScreen);
});
});

this.wmks = wmks;

Expand All @@ -77,7 +75,7 @@ export class WmksConsoleService implements ConsoleService {
if (this.wmks) {
this.wmks.disconnect();
this.stateChanged('disconnected');
if (this.options.hideDisconnectedScreen ) {
if (this.options.hideDisconnectedScreen) {
this.dispose();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h3><strong>Game Connection Error</strong></h3>
</ng-container>
</ng-container>

<app-confirm-button btnClass="btn btn-lg btn-info" *ngIf="!ctx.game.requireSynchronizedStart"
<app-confirm-button btnClass="btn btn-lg btn-success" *ngIf="!ctx.game.requireSynchronizedStart"
(confirm)="handleDoubleCheckRequest(true)" (cancel)="handleDoubleCheckRequest(false)">
<fa-icon [icon]="fa.bolt"></fa-icon>
<span>Start Session</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export class GameboardPageComponent {
this.unsub.add(
this.selecting$.pipe(
// If s.instance does not exist, fetch; otherwise, preview
tap(() => this.deploying = false),
switchMap(s => !!s.instance && !!s.instance.state
? of(s)
: (!!s.instance
Expand Down Expand Up @@ -143,7 +144,7 @@ export class GameboardPageComponent {
}
}

syncOne = (c: Challenge): BoardSpec => {
syncOne(c: Challenge): BoardSpec {
this.deploying = false;

if (!c) {
Expand All @@ -164,7 +165,7 @@ export class GameboardPageComponent {
}

return s || {} as BoardSpec;
};
}

select(spec: BoardSpec): void {
if (!spec.disabled && !spec.locked && (!this.selected?.id || this.selected.id !== spec.id)) {
Expand Down Expand Up @@ -241,7 +242,7 @@ export class GameboardPageComponent {
try {
new URL(vm.id);
isUrl = true;
} catch (_) {
} catch {
isUrl = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<app-confirm-button
*ngIf="(ctx.game.allowReset || (canIgnoreSessionResetSettings$ | async)) && !isResetting" class="mx-2"
btnClass="btn btn-sm pop-warning" (confirm)="handleReset(ctx.player)">
btnClass="btn btn-sm btn-danger" (confirm)="handleReset(ctx.player)">
<fa-icon [icon]="fa.trash"></fa-icon>
<span>Reset Session</span>
</app-confirm-button>
Expand Down

0 comments on commit 3046ee0

Please sign in to comment.