Make whole frontend dynamically configurable to avoid rebuilds
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<div class="tfw-ide-pin" *ngFor="let layoutIter of enabledLayouts">
|
||||
|
||||
<div class="tfw-ide-pin" *ngFor="let layoutIter of (enabledLayouts | async)">
|
||||
<div>
|
||||
<button [class.active]="layout === layoutIter"
|
||||
(active)="layout === layoutIter"
|
||||
@@ -7,5 +6,4 @@
|
||||
(click)="setLayout(layoutIter)"
|
||||
class="btn"><img src="images/{{layoutIter}}.svg"></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { config } from '../config';
|
||||
import { DashboardConfigService } from '../services/config.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-sidebar',
|
||||
templateUrl: './sidebar.component.html',
|
||||
styleUrls: ['./sidebar.component.scss']
|
||||
})
|
||||
|
||||
export class SidebarComponent {
|
||||
@Input() layout: string;
|
||||
@Output() layoutChanged = new EventEmitter<string>();
|
||||
enabledLayouts: string[] = config.dashboard.enabledLayouts;
|
||||
enabledLayouts = this.configService.enabledLayouts;
|
||||
|
||||
constructor() {}
|
||||
constructor(private configService: DashboardConfigService) {}
|
||||
|
||||
setLayout(layout: string) {
|
||||
this.layout = layout;
|
||||
|
||||
Reference in New Issue
Block a user