Skip to content

Commit

Permalink
v3.23.5 (#200)
Browse files Browse the repository at this point in the history
* Improvements to OIDC experience and support for auto log in/out.

* 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
  • Loading branch information
sei-bstein authored Oct 31, 2024
1 parent 0f8d590 commit 766c9d6
Show file tree
Hide file tree
Showing 63 changed files with 422 additions and 237 deletions.
28 changes: 16 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"ng2-charts": "^4.1.1",
"ngx-bootstrap": "^10.3.0",
"ngx-markdown": "^15.1.2",
"oidc-client-ts": "^2.2.2",
"oidc-client-ts": "^3.1.0",
"rxjs": "^7.8.0",
"toastify-js": "^1.12.0",
"tslib": "^2.1.0",
Expand Down
20 changes: 12 additions & 8 deletions projects/gameboard-mks/src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$primary: #181866;
$primary-hover: #131398;
$danger: #A41E25;
$danger: #a41e25;
$success: #41ad57;
$light: #f8f9fa;
$gray-200: #333;
Expand All @@ -11,7 +11,8 @@ $bg-tools: #444;
body {
background-color: $dark;
color: $light;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 18px;
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
Expand Down Expand Up @@ -75,9 +76,11 @@ button {
border: none;
cursor: default;
}

button:hover {
background-color: $primary-hover
background-color: $primary-hover;
}

.btn-lg {
margin: 8px;
padding: 32px;
Expand All @@ -96,7 +99,8 @@ button:hover {
}
}
app-spinner {
svg path, svg rect {
svg path,
svg rect {
fill: $primary;
}
}
Expand All @@ -109,12 +113,12 @@ app-spinner {
color: $light;
}
textarea {
background-color: $gray-200;
color: $gray-800;
background-color: $gray-200;
color: $gray-800;
}
textarea:focus {
background-color: $gray-200;
color: $gray-800;
background-color: $gray-200;
color: $gray-800;
}
input.form-check-input {
background-color: $gray-200;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h4 class="mt-4">Challenge</h4>

<ng-template #gameEngineAuditNotLoaded>
<div *ngIf="selected && !selected.archived && !isLoadingAuditFromGameEngine"
class="btn btn-link text-info cursor-pointer py-0 px-0" (click)="auditFromGameEngine(selected.id)">
class="btn btn-link text-success cursor-pointer py-0 px-0" (click)="auditFromGameEngine(selected.id)">
Audit from game engine?
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ <h5 class="overflow-ellipsis">
</div>

<ng-template #noChallenges>
<div class="text-center gray-text fs-11">There aren't any active challenges of this type right now.</div>
<div class="text-center text-muted fs-11">There aren't any active challenges of this type right now.</div>
</ng-template>

<ng-template #noMatchingChallenges>
<div class="text-center gray-text fs-11">None of the active challenges match your search.</div>
<div class="text-center text-muted fs-11">None of the active challenges match your search.</div>
</ng-template>

<ng-template #loading>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ <h6 class="game-link m-0">
</div>

<ng-template #noTeams>
<div class="text-center gray-text fs-11">There aren't any active teams right now.</div>
<div class="text-center text-muted fs-11">There aren't any active teams right now.</div>
</ng-template>

<ng-template #noMatchingTeams>
<div class="text-center gray-text fs-11">There aren't any active teams which match your search.</div>
<div class="text-center text-muted fs-11">There aren't any active teams which match your search.</div>
</ng-template>

<ng-template #loading>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<ng-template #noResults class="text-center">
<div class="text-center my-3">
<em class="gray-text">Use the box above to search for the user(s) you want to enroll in this game.</em>
<em class="text-muted">Use the box above to search for the user(s) you want to enroll in this game.</em>
</div>
</ng-template>

Expand All @@ -46,7 +46,7 @@
size="tiny"></app-avatar>
<div class="user-info">
<div>{{ user.name }}</div>
<em class="gray-text fs-08">{{ user.id | slice:0:8}}</em>
<em class="text-muted fs-08">{{ user.id | slice:0:8}}</em>
</div>
</div>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="pb-0 pt-1 my-0 py-0">
<div class="text-white float-right auto-h d-flex align-items-center my-0 py-0">
<label class="py-0 my-0">Cards</label>
<label class="btn text-info my-0 py-0" btnCheckbox id="isPublished-input" name="isPublished"
<label class="btn text-success my-0 py-0" btnCheckbox id="isPublished-input" name="isPublished"
(click)="toggleViewMode()">
<fa-icon *ngIf="!tableView" [icon]="faToggleOff" size="lg"></fa-icon>
<fa-icon *ngIf="tableView" [icon]="faToggleOn" size="lg"></fa-icon>
Expand All @@ -44,14 +44,14 @@
<ng-container *ngIf="!tableView">
<div *appIfHasPermission="'Games_CreateEditDelete'"
class="new-game-controls card col-3 my-3 bg-transparent d-flex flex-column align-items-center">
<button class="btn btn-info flex-grow-1 w-100" (click)="create()">
<button class="btn btn-success flex-grow-1 w-100" (click)="create()">
<fa-icon [icon]="faPlus"></fa-icon>
<span>New Game</span>
</button>

<p class="mt-2">OR</p>

<button class="btn btn-info flex-grow-1 w-100" (click)="handleImportYamlClick()">
<button class="btn btn-success flex-grow-1 w-100" (click)="handleImportYamlClick()">
<fa-icon [icon]="fa.barsStaggered"></fa-icon>
<span>Import From YAML</span>
</button>
Expand All @@ -62,7 +62,7 @@
<div class="dropzone-target h-100 d-flex flex-column align-items-center justify-content-center">
<div class="text-center">
Upload or drop a YAML file
<em class="d-block fs-09 gray-text">(must be an array of games)</em>
<em class="d-block fs-09 text-muted">(must be an array of games)</em>
</div>
</div>
</app-dropzone>
Expand Down
8 changes: 4 additions & 4 deletions projects/gameboard-ui/src/app/api/toc.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ export class TocService {
private log: LogService
) {
const tag = `?t=${new Date().valueOf()}`;
const tocUrl = `${config.tochost}/${config.settings.tocfile + ''}${tag}`;
const tocUrl = `${config.tochost}/${config.environment.settings.tocfile + ''}${tag}`;
let url = config.tochost;

// include toc folder
const i = config.settings.tocfile?.lastIndexOf('/') || 0;
const i = config.environment.settings.tocfile?.lastIndexOf('/') || 0;
if (i > 0) {
url += `/${config.settings.tocfile?.substring(0, i)}`;
url += `/${config.environment.settings.tocfile?.substring(0, i)}`;
}

if (!!config.settings.tocfile) {
if (!!config.environment.settings.tocfile) {
this.toc$ = http.get<string[]>(tocUrl).pipe(
catchError(err => {
// don't report error here - ops will know what the 404 means
Expand Down
33 changes: 23 additions & 10 deletions projects/gameboard-ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,48 @@
// Copyright 2021 Carnegie Mellon University. All Rights Reserved.
// Released under a MIT (SEI)-style license. See LICENSE.md in the project root for license information.

import { Component, Inject, OnInit } from '@angular/core';
import { DOCUMENT } from '@angular/common';
import { Component, inject, Inject, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { Observable } from 'rxjs';
import { LayoutService } from './utility/layout.service';
import { ConfigService } from './utility/config.service';
import { DOCUMENT } from '@angular/common';
import { Title } from '@angular/platform-browser';
import { AuthService } from './utility/auth.service';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
protected customBackground = "";
private auth = inject(AuthService);
private config = inject(ConfigService);
private autoLogin: {
enabled: boolean;
tried: boolean;
};

protected customBackground = "custom-bg-black";
stickyMenu$: Observable<boolean>;

constructor(
layoutService: LayoutService,
private config: ConfigService,
private title: Title,
@Inject(DOCUMENT) private document: Document) {
this.autoLogin = { enabled: this.config.environment.settings.oidc.autoLogin, tried: false };
this.stickyMenu$ = layoutService.stickyMenu$;
}

ngOnInit(): void {
this.title.setTitle(this.config.settings.appname || 'Gameboard');
if (this.config.settings.custom_background) {
this.document.body.classList.add(this.config.settings.custom_background);
this.customBackground = this.config.settings.custom_background || 'custom-bg-black';
async ngOnInit() {
this.title.setTitle(this.config.environment.settings.appname || 'Gameboard');
if (this.config.environment.settings.custom_background) {
this.document.body.classList.add(this.config.environment.settings.custom_background);
this.customBackground = this.config.environment.settings.custom_background || this.customBackground;
}

if (this.autoLogin.enabled && !this.autoLogin.tried && !await this.auth.isLoggedIn()) {
this.autoLogin.tried = true;
await this.auth.login();
}
}
}
4 changes: 4 additions & 0 deletions projects/gameboard-ui/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { GameboardSignalRHubsComponent } from './components/gameboard-signalr-hu
import { SignalRService } from './services/signalR/signalr.service';
import { LogService } from './services/log.service';
import { SystemNotificationsModule } from './system-notifications/system-notifications.module';
import { UserNavItemComponent } from './standalone/user/components/user-nav-item/user-nav-item.component';

@NgModule({
declarations: [
Expand All @@ -59,6 +60,9 @@ import { SystemNotificationsModule } from './system-notifications/system-notific
ModalModule.forRoot(),
BsDropdownModule.forRoot(),
ProgressbarModule.forRoot(),

// standalones
UserNavItemComponent
],
providers: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ng-container *ngIf="(user$ | async)?.id">
<a *appIfHasPermission="'Admin_View'" class="btn btn-link text-success mx-1"
routerLinkActive="text-info" [routerLink]="['/admin']">Admin</a>
<a class="btn btn-link text-success mx-1" (click)="logout()">Log out</a>
<a class="btn btn-link text-success mx-1" (click)="handleLogOut()">Log out</a>
</ng-container>
</ng-container>
</div>
Expand Down Expand Up @@ -71,13 +71,13 @@
</a>
</li>
<li *ngIf="user?.id">
<a (click)="logout()">Log out</a>
<a (click)="handleLogOut()">Log out</a>
</li>
</ng-container>
</ul>
</div>
</nav>

<ng-template #unauthed>
<a class="btn btn-link text-success mx-1" routerLinkActive="text-info" [routerLink]="profileUrl">Log in</a>
<div role="button" class="btn btn-link text-success mx-1" (click)="handleLogIn()">Log in</div>
</ng-template>
12 changes: 10 additions & 2 deletions projects/gameboard-ui/src/app/components/nav/nav.component.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
@import "../../../scss/variables";

@media (max-width: 800px) {
.nav-sm {
display: flex;

.badge {
display: inline-block;
font-size: 0.5rem !important;
// margin-right: 12px;
}

li {
Expand All @@ -27,9 +28,16 @@
display: block;

.nav-items {
a {
a,
div[role="button"] {
display: block;
font-size: 1.5rem;

&.active {
color: $body-color !important;
font-weight: bolder;
text-decoration: underline;
}
}
}

Expand Down
Loading

0 comments on commit 766c9d6

Please sign in to comment.