68067: Add menu sections through route data

This commit is contained in:
Kristof De Langhe
2020-05-19 14:37:17 +02:00
parent 172d0d986b
commit ff0750d053
6 changed files with 93 additions and 18 deletions

View File

@@ -18,6 +18,7 @@ import { TextMenuItemModel } from '../../shared/menu/menu-item/models/text.model
import { MenuComponent } from '../../shared/menu/menu.component';
import { MenuService } from '../../shared/menu/menu.service';
import { CSSVariableService } from '../../shared/sass-helper/sass-helper.service';
import { ActivatedRoute, Router } from '@angular/router';
/**
* Component representing the admin sidebar
@@ -59,18 +60,19 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
constructor(protected menuService: MenuService,
protected injector: Injector,
protected route: ActivatedRoute,
protected router: Router,
private variableService: CSSVariableService,
private authService: AuthService,
private modalService: NgbModal
) {
super(menuService, injector);
super(menuService, injector, route, router);
}
/**
* Set and calculate all initial values of the instance variables
*/
ngOnInit(): void {
this.createMenu();
super.ngOnInit();
this.sidebarWidth = this.variableService.getVariable('sidebarItemsWidth');
this.authService.isAuthenticated()
@@ -93,7 +95,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
/**
* Initialize all menu sections and items for this menu
*/
private createMenu() {
createMenu() {
const menuList = [
/* News */
{