-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
0f8d590
commit 766c9d6
Showing
63 changed files
with
422 additions
and
237 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.