Commit 1f0fff58 authored by Chris Hines's avatar Chris Hines
Browse files

allow the multi-app warning to be supressed. Some other cleanup

parent a0d21294
......@@ -15,8 +15,6 @@ import {Health} from '../computesite';
export class AccountinfoComponent implements OnInit {
@Input() identity$: BehaviorSubject<Identity>;
private subscriptions: Subscription[];
private aa: Health[];
private sa: Health[];
@Input() app$: BehaviorSubject<Strudelapp>;
constructor(
......@@ -24,13 +22,10 @@ export class AccountinfoComponent implements OnInit {
public tesService: TesService,
) {
this.subscriptions = [];
this.aa = [];
this.sa = [];
}
ngOnInit() {
this.identity$.subscribe((i) => this.updateSubs(i));
}
cssClass(h) {
......@@ -41,17 +36,6 @@ export class AccountinfoComponent implements OnInit {
return 'health-ok';
}
updateSubs(i: Identity) {
var s: Subscription;
for (s of this.subscriptions) {
s.unsubscribe();
}
if (i === null) {
return
}
this.subscriptions.push(i.accountalerts.subscribe((v) => {this.aa = v; }));
this.subscriptions.push(i.systemalerts.subscribe((v) => {this.sa = v; }));
}
calculateCols(data) {
return data.map(function(r) { return r.key });
......
......@@ -153,7 +153,9 @@ export class BrowserWindowService {
public finishAppWindow(windowloc: any, job:Job, action: AppAction) {
let appwindow = window.open(windowloc);
this.warnref = this.dialog.open(WarndialogComponent, {width: '600px', data: job})
if (action.name == "Connect" && this.settingsService.warndialog) {
this.warnref = this.dialog.open(WarndialogComponent, {width: '600px', data: job})
}
if (appwindow == null) {
this.notifications.notify('It looks like a window failed to open. Please check your popup blocker settings (Strudel 2 needs to be able to open a window to your application');
return;
......
......@@ -16,8 +16,8 @@ export class Identity {
this.username = username;
this.site = site;
this.keyCerts = [];
this.systemalerts = new BehaviorSubject<Health[]>([]);
this.accountalerts = new BehaviorSubject<Health[]>([]);
this.systemalerts = new BehaviorSubject<Health[]>(null);
this.accountalerts = new BehaviorSubject<Health[]>(null);
this.joblist = new BehaviorSubject<Job[]>([]);
this.quotas = [];
}
......
......@@ -10,6 +10,7 @@ export class SettingsService {
public useMenu$: BehaviorSubject<boolean>;
public appdesc: boolean;
public logging: boolean;
public warndialog: boolean;
constructor() {
this.menuToggle$ = new BehaviorSubject<boolean>(true);
......@@ -17,8 +18,10 @@ export class SettingsService {
this.useMenu$ = new BehaviorSubject<boolean>(true);
this.logging = true;
this.appdesc = true;
this.warndialog = true;
this.getTheme();
this.getAppDesc();
this.getWarnDialog();
this.getLogging();
}
......@@ -46,6 +49,18 @@ export class SettingsService {
localStorage.setItem('strudel-app-desc',JSON.stringify(this.appdesc));
}
getWarnDialog() {
let storedvalue = JSON.parse(localStorage.getItem('strudel-warn-dialog'));
if (storedvalue !== null) {
this.warndialog = storedvalue;
}
}
setWarnDialog(event) {
this.warndialog = event.checked;
localStorage.setItem('strudel-warn-dialog',JSON.stringify(this.warndialog));
}
getTheme() {
var theme: string;
theme = localStorage.getItem('strudel-theme');
......
......@@ -20,6 +20,9 @@
<div>
<mat-slide-toggle color=primary [checked]="settingsService.logging" (change)="settingsService.setLogging($event)">Allow usage logs to be collected</mat-slide-toggle>
</div>
<div>
<mat-slide-toggle color=primary [checked]="settingsService.warndialog" (change)="settingsService.setWarnDialog($event)">Warn every time you go to open a second app</mat-slide-toggle>
</div>
<div class="heading"><h2>Advanced</h2></div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment