Skip to content
Snippets Groups Projects
Commit 3850dfaf authored by Alex ORLUC's avatar Alex ORLUC
Browse files

fix build prod

parent 1482dca0
No related branches found
No related tags found
No related merge requests found
......@@ -10,10 +10,10 @@
<mat-icon mat-list-icon class="fa fa-th" style="font-size:20px;color:white;height:auto;"></mat-icon>
</button>
<mat-menu #applications="matMenu" class="headerMaarchShortcut">
<ng-container *ngFor="let shortcut of headerService.menu">
<ng-container *ngFor="let shortcut of menus">
<button (click)="gotToMenu(shortcut);" style="white-space:inherit;height: 100px;line-height:20px;" class="col-md-4 col-xs-6" mat-button color="primary" matTooltip="{{shortcut.comment}}">
<i class="{{shortcut.style}} fa-2x"></i>
<br/>{{shortcut.name}}
<br/>{{shortcut.label}}
</button>
</ng-container>
</mat-menu>
......
......@@ -7,6 +7,7 @@ import { Router } from '@angular/router';
import { IndexingGroupModalComponent } from './menu-shortcut.component';
import { HeaderService } from '../../service/header.service';
import { AppService } from '../../service/app.service';
import { PrivilegeService } from '../../service/privileges.service';
declare function $j(selector: any) : any;
......@@ -23,6 +24,7 @@ export class MainHeaderComponent implements OnInit {
config : any = {};
titleHeader : string;
router : any;
menus: any = [];
snav : MatSidenav;
snav2 : MatSidenav;
......@@ -34,7 +36,8 @@ export class MainHeaderComponent implements OnInit {
private _router: Router,
public headerService: HeaderService,
public dialog: MatDialog,
public appService: AppService
public appService: AppService,
private privilegeService: PrivilegeService
) {
this.router = _router;
window['MainHeaderComponent'] = {
......@@ -44,7 +47,9 @@ export class MainHeaderComponent implements OnInit {
};
}
ngOnInit(): void { }
ngOnInit(): void {
this.menus = this.privilegeService.getCurrentUserMenus();
}
setTitle(title: string) {
this.zone.run(() => this.titleHeader = title);
......@@ -64,13 +69,13 @@ export class MainHeaderComponent implements OnInit {
}
gotToMenu(shortcut:any) {
if (shortcut.id == 'index_mlb' && this.headerService.user.indexingGroups.length > 1) {
this.config = { data: { indexingGroups:this.headerService.user.indexingGroups, link:shortcut.servicepage } };
if (shortcut.id == 'indexing' && shortcut.groups.length > 1) {
this.config = { data: { indexingGroups: shortcut.groups, link:shortcut.route } };
this.dialogRef = this.dialog.open(IndexingGroupModalComponent, this.config);
} else if (shortcut.angular == 'true') {
this.router.navigate([shortcut.servicepage]);
} else if (shortcut.angular === true) {
this.router.navigate([shortcut.route]);
} else {
location.href = shortcut.servicepage;
location.href = shortcut.route;
}
}
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment