diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 237978d0..9a41aa8f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -38,7 +38,7 @@ export class AppComponent implements OnDestroy, OnInit { ) { } ngOnInit(): void { - this.configService.isManaged().pipe(first()).subscribe((v) => ConfigManager.initConfigManager(this.http, this.configService, v)); + this.initalRequests(); NotificationService.subscribeToNotification(this, { whitelist: ['notification_created', 'project_deleted', 'config_updated'], func: this.handleWebsocketNotification @@ -46,6 +46,15 @@ export class AppComponent implements OnDestroy, OnInit { this.initializeNotificationService(); this.initWithConfigManager(); } + + initalRequests() { + this.configService.isManaged().pipe(first()).subscribe((v) => ConfigManager.initConfigManager(this.http, this.configService, v)); + this.configService.isDemo().pipe(first()).subscribe((v) => ConfigManager.setIsDemo(v)); + this.configService.isAdmin().pipe(first()).subscribe((v) => ConfigManager.setIsAdmin(v)); + this.configService.getBlackWhiteDemo().pipe(first()).subscribe((v) => ConfigManager.setBlackWhiteListDemo(v)); + } + + initWithConfigManager() { if (!ConfigManager.isInit()) { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9a00f549..87573ec5 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,10 +1,11 @@ import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; -import { NgModule } from '@angular/core'; +import { ErrorHandler, NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { BaseModule } from './base/base.module'; import { ExceptionInterceptor } from './base/interceptors/exception.interceptor'; +import { GlobalErrorHandler } from './base/interceptors/global-exception.interceptor'; import { NotificationService } from './base/services/notification.service'; import { DataModule } from './data/data.module'; import { ProjectsModule } from './projects/projects.module'; @@ -50,6 +51,7 @@ import { RecordIDEModule } from './record-ide/record-ide.module'; ], providers: [ { provide: HTTP_INTERCEPTORS, useClass: ExceptionInterceptor, multi: true }, + { provide: ErrorHandler, useClass: GlobalErrorHandler }, NotificationService, ], bootstrap: [AppComponent], diff --git a/src/app/base/components/header/header.component.html b/src/app/base/components/header/header.component.html index cca0133f..b9b7ffdb 100644 --- a/src/app/base/components/header/header.component.html +++ b/src/app/base/components/header/header.component.html @@ -1,6 +1,22 @@
+
+ + + + + + + + + Demo Playground - Everything will be reset on the hour + + +
@@ -58,8 +74,22 @@
+
-