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

FEAT #12003 TIME 0:20 fix menu v1.5

parent 155387ca
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,7 @@ import { DragDropDirective } from '../app/viewer/upload-f
import { DiffusionsListComponent } from './diffusions/diffusions-list.component';
import { DocumentViewerComponent } from './viewer/document-viewer.component';
import { HeaderService } from '../service/header.service';
......@@ -157,6 +158,7 @@ export class MyHammerConfig extends HammerGestureConfig {
DragDropDirective
],
providers: [
HeaderService,
LatinisePipe,
CookieService,
{
......
......@@ -4,7 +4,6 @@ import { SharedModule } from './app-common.module';
import { CustomSnackbarComponent, NotificationService } from './notification.service';
import { ConfirmModalComponent } from './confirmModal.component';
import { HeaderService } from '../service/header.service';
import { FiltersListService } from '../service/filtersList.service';
import { AppComponent } from './app.component';
......@@ -171,7 +170,7 @@ import { PrivilegeService } from '../service/privileges.service';
AddPrivateIndexingModelModalComponent,
AttachmentShowModalComponent
],
providers: [ HeaderService, FiltersListService, FoldersService, NotificationService, PrivilegeService ],
providers: [ FiltersListService, FoldersService, NotificationService, PrivilegeService ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
......@@ -10,7 +10,7 @@
<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 menus">
<ng-container *ngFor="let shortcut of menus | sortBy: 'label'">
<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.label}}
......
......@@ -48,7 +48,9 @@ export class MainHeaderComponent implements OnInit {
}
ngOnInit(): void {
this.menus = this.privilegeService.getCurrentUserMenus();
setTimeout(() => {
this.menus = this.privilegeService.getCurrentUserMenus();
}, 200);
}
setTitle(title: string) {
......
......@@ -21,6 +21,7 @@ export class AppGuard implements CanActivate {
localStorage.setItem('PreviousV2Route', state.url);
if (this.headerService.user.id === undefined) {
console.log('toto');
return this.http.get('../../rest/currentUser/profile')
.pipe(
map((data: any) => {
......
......@@ -482,6 +482,7 @@ export class PrivilegeService {
}
getCurrentUserMenus() {
console.log(this.headerService.user);
let menus = this.menus.filter(elem => this.headerService.user.privileges.indexOf(elem.id) > -1);
if (this.headerService.user.groups.filter((group: any) => group.can_index === true).length > 0) {
......
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