diff --git a/dashboard/sharedComponents/sidebar/layout.service.ts b/dashboard/sharedComponents/sidebar/layout.service.ts index 4d753d0a..e814083f 100644 --- a/dashboard/sharedComponents/sidebar/layout.service.ts +++ b/dashboard/sharedComponents/sidebar/layout.service.ts @@ -26,11 +26,14 @@ export class LayoutService { * Add hasAdminMenu: true on data of route config, if global sidebar should be used. */ private _hasAdminMenuSubject: BehaviorSubject = new BehaviorSubject(false); + private _hasMiniMenuSubject: BehaviorSubject = new BehaviorSubject(false); + private _isFrontPageSubject: BehaviorSubject = new BehaviorSubject(false); constructor(private router: Router) { this.router.events.subscribe(event => { if (event instanceof ActivationStart) { let data = event.snapshot.data; + console.debug(data) if (data['hasSidebar'] !== undefined && data['hasSidebar'] === false) { this.setHasSidebar(false); @@ -49,6 +52,18 @@ export class LayoutService { } else { this.setHasAdminMenu(false); } + if (data['hasMiniMenu'] !== undefined && + data['hasMiniMenu'] === true) { + this.setHasMiniMenu(true); + } else { + this.setHasMiniMenu(false); + } + if (data['isFrontPage'] !== undefined && + data['isFrontPage'] === true) { + this.setFrontPage(true); + } else { + this.setFrontPage(false); + } } }); } @@ -85,4 +100,19 @@ export class LayoutService { setHasAdminMenu(value: boolean) { this._hasAdminMenuSubject.next(value); } + + get hasMiniMenu(): Observable { + return this._hasMiniMenuSubject.asObservable(); + } + + setHasMiniMenu(value: boolean) { + this._hasMiniMenuSubject.next(value); + } + get isFrontPage(): Observable { + return this._isFrontPageSubject.asObservable(); + } + + setFrontPage(value: boolean) { + this._isFrontPageSubject.next(value); + } } diff --git a/dashboard/sharedComponents/sidebar/sideBar.component.html b/dashboard/sharedComponents/sidebar/sideBar.component.html index 6f8797b4..e19b3e38 100644 --- a/dashboard/sharedComponents/sidebar/sideBar.component.html +++ b/dashboard/sharedComponents/sidebar/sideBar.component.html @@ -1,16 +1,12 @@ diff --git a/dashboard/sharedComponents/sidebar/sideBar.component.ts b/dashboard/sharedComponents/sidebar/sideBar.component.ts index aea9b634..086e4c2f 100644 --- a/dashboard/sharedComponents/sidebar/sideBar.component.ts +++ b/dashboard/sharedComponents/sidebar/sideBar.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, OnInit} from '@angular/core'; +import { Component, Input, OnInit} from '@angular/core'; import {MenuItem} from "../../../sharedComponents/menu"; import {Router} from "@angular/router"; @@ -14,6 +14,7 @@ export class SideBarComponent implements OnInit { @Input() showHeader: boolean = true; @Input() activeItem: string = ''; @Input() activeSubItem: string = ''; + @Input() showSearch = false; constructor(private router: Router) {} diff --git a/sharedComponents/menu.ts b/sharedComponents/menu.ts index d47d3923..26678a71 100644 --- a/sharedComponents/menu.ts +++ b/sharedComponents/menu.ts @@ -12,7 +12,7 @@ export class MenuItem { icon: string; open: boolean; - constructor(id: string, title: string, url: string, route: string, needsAuthorization: boolean, entitiesRequired: string[], routeRequired: string[], params) { + constructor(id: string, title: string, url: string, route: string, needsAuthorization: boolean, entitiesRequired: string[], routeRequired: string[], params, icon=null) { this.id = id; this.title = title; this.url = url; @@ -23,6 +23,7 @@ export class MenuItem { this.params = params; this.markAsActive = true; this.items = []; + this.icon = icon; } public setMarkAsActive(showActive: boolean) {