Fix config variable not being JSON

This commit is contained in:
Kristóf Tóth 2018-04-20 14:10:57 +02:00
parent 46b750432e
commit 77e18f43e3
2 changed files with 5 additions and 6 deletions

View File

@ -2,7 +2,7 @@ export const config = {
dashboard: {
route: 'dashboard',
currentLayout: 'terminal-ide-web',
enabledLayouts: new Set([
enabledLayouts: [
'terminal-ide-web',
'terminal-ide-vertical',
'terminal-ide-horizontal',
@ -11,8 +11,8 @@ export const config = {
'ide-web-vertical',
'ide-only',
'web-only'
]),
allLayouts: new Set([
],
allLayouts: [
'terminal-ide-web',
'terminal-ide-vertical',
'terminal-ide-horizontal',
@ -21,7 +21,7 @@ export const config = {
'ide-web-vertical',
'ide-only',
'web-only'
]),
],
hide_messages: false
},
ide: {

View File

@ -14,7 +14,6 @@ import { SidebarComponent } from '../sidebar/sidebar.component';
export class DashboardComponent implements OnInit, OnDestroy {
deploying = false;
deploymentNotificationSubscription: Subscription;
enabledLayouts: Set<string> = config.dashboard.enabledLayouts;
layout: string = config.dashboard.currentLayout;
hide_messages: boolean = config.dashboard.hide_messages;
command_handlers = {'layout': this.layoutHandler.bind(this)};
@ -35,7 +34,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
}
layoutHandler(data: LayoutCommand) {
if (this.enabledLayouts.has(data.layout)) {
if (config.dashboard.enabledLayouts.includes(data.layout)) {
this.setLayout(data.layout);
}
else {