Commit 7dbd34c3 authored by Alex ORLUC's avatar Alex ORLUC

FEAT #13405 TIME 4:30 admin home refactoring + panel left refactoring (portal method)

parent 48b6b253
......@@ -17,22 +17,23 @@
"license": "GPL-3.0",
"dependencies": {
"@fortawesome/fontawesome-free": "^5.11.2",
"@swimlane/ngx-charts": "^13.0.2",
"@tinymce/tinymce-angular": "^3.4.0",
"bootstrap": "^3.4.1",
"chart.js": "1.1.1",
"chosen-js": "^1.8.7",
"core-js": "^2.6.9",
"jquery": "^3.4.1",
"jquery-typeahead": "^2.11.0",
"jquery.nicescroll": "~3.6.8",
"jquery": "^3.4.1",
"jstree-bootstrap-theme": "^1.0.1",
"ng2-pdf-viewer": "^5.3.4",
"ngx-cookie-service": "^2.4.0",
"ngx-pipes": "^2.7.3",
"pdfjs-dist": "2.2.228",
"photoswipe": "^4.1.3",
"tinymce-i18n": "^19.9.17",
"tinymce": "^5.1.6",
"tinymce-i18n": "^19.9.17",
"tooltipster": "^4.2.7",
"uglify-es": "3.2.2",
"uglifyjs-webpack-plugin": "2.1.1",
......
<mat-sidenav-container autosize class="maarch-container">
<mat-sidenav #snav [mode]="appService.getViewMode() ? 'over' : 'side'" [fixedInViewport]="appService.getViewMode()"
[opened]="!appService.getViewMode()" [ngStyle]="{'width': appService.getViewMode() ? '80%' : '350px'}">
<header-panel [snavLeft]="snav"></header-panel>
<menu-shortcut></menu-shortcut>
<menu-nav></menu-nav>
</mat-sidenav>
<mat-sidenav-content>
<div class="bg-head">
<div class="bg-head-title" [class.customContainerRight]="appService.getViewMode()">
<div class="bg-head-title-label">
<header-left [snavLeft]="snav"></header-left>
<header-left></header-left>
</div>
<div class="bg-head-title-tool">
<header-right></header-right>
......
......@@ -4,7 +4,7 @@ import { Router, ActivatedRoute } from '@angular/router';
import { LANG } from '../../translate.component';
import { NotificationService } from '../../notification.service';
import { MatSidenav } from '@angular/material/sidenav';
import { HeaderService } from '../../../service/header.service';
import { HeaderService } from '../../../service/header.service';
import { AppService } from '../../../service/app.service';
import { tap, catchError } from 'rxjs/operators';
import { of } from 'rxjs';
......@@ -19,9 +19,7 @@ declare function $j(selector: any): any;
})
export class ActionAdministrationComponent implements OnInit {
/*HEADER*/
@ViewChild('snav', { static: true }) public sidenavLeft : MatSidenav;
@ViewChild('snav2', { static: true }) public sidenavRight : MatSidenav;
@ViewChild('snav2', { static: true }) public sidenavRight: MatSidenav;
lang: any = LANG;
creationMode: boolean;
......@@ -43,10 +41,10 @@ export class ActionAdministrationComponent implements OnInit {
selectStatusId = new FormControl();
constructor(
public http: HttpClient,
private route: ActivatedRoute,
private router: Router,
private notify: NotificationService,
public http: HttpClient,
private route: ActivatedRoute,
private router: Router,
private notify: NotificationService,
private headerService: HeaderService,
public appService: AppService,
public functions: FunctionsService) { }
......@@ -55,10 +53,9 @@ export class ActionAdministrationComponent implements OnInit {
this.loading = true;
this.route.params.subscribe(params => {
this.headerService.sideNavLeft = this.sidenavLeft;
if (typeof params['id'] == "undefined") {
this.creationMode = true;
this.http.get('../../rest/initAction')
......@@ -69,7 +66,7 @@ export class ActionAdministrationComponent implements OnInit {
this.categoriesList = data.categoriesList;
this.statuses = data.statuses.map((status: any) => {
return {
id : status.id,
id: status.id,
label: status.label_status
}
});
......@@ -81,7 +78,7 @@ export class ActionAdministrationComponent implements OnInit {
});
}
else {
this.creationMode = false;
this.http.get('../../rest/actions/' + params['id'])
......@@ -92,7 +89,7 @@ export class ActionAdministrationComponent implements OnInit {
this.categoriesList = data.categoriesList;
this.statuses = data.statuses.map((status: any) => {
return {
id : status.id,
id: status.id,
label: status.label_status
}
});
......@@ -101,7 +98,7 @@ export class ActionAdministrationComponent implements OnInit {
this.headerService.setHeader(this.lang.actionCreation, data.action.label_action);
await this.getCustomFields();
this.loading = false;
if (this.action.actionPageId=='close_mail') {
if (this.action.actionPageId == 'close_mail') {
this.customFieldsFormControl = new FormControl({ value: this.action.parameters.requiredFields, disabled: false });
this.selectedFieldsId = this.action.parameters.requiredFields;
this.selectedFieldsId.forEach((element: any) => {
......@@ -111,7 +108,7 @@ export class ActionAdministrationComponent implements OnInit {
}
});
});
} else if (this.action.actionPageId=='create_acknowledgement_receipt') {
} else if (this.action.actionPageId == 'create_acknowledgement_receipt') {
this.arMode = this.action.parameters.mode;
}
});
......@@ -122,11 +119,11 @@ export class ActionAdministrationComponent implements OnInit {
getCustomFields() {
this.action.actionPageId = this.selectActionPageId.value;
return new Promise((resolve, reject) => {
if (this.action.actionPageId=='close_mail' && this.functions.empty(this.availableCustomFields)) {
if (this.action.actionPageId == 'close_mail' && this.functions.empty(this.availableCustomFields)) {
this.http.get('../../rest/customFields').pipe(
tap((data: any) => {
this.availableCustomFields = data.customFields.map((info: any) => {
info.id = 'indexingCustomField_' + info.id;
info.id = 'indexingCustomField_' + info.id;
return info;
});
return resolve(true);
......@@ -161,10 +158,10 @@ export class ActionAdministrationComponent implements OnInit {
}
onSubmit() {
if (this.action.actionPageId=='close_mail') {
this.action.parameters = { requiredFields: this.selectedFieldsId};
} else if (this.action.actionPageId=='create_acknowledgement_receipt') {
this.action.parameters = { mode: this.arMode};
if (this.action.actionPageId == 'close_mail') {
this.action.parameters = { requiredFields: this.selectedFieldsId };
} else if (this.action.actionPageId == 'create_acknowledgement_receipt') {
this.action.parameters = { mode: this.arMode };
}
if (this.creationMode) {
this.http.post('../../rest/actions', this.action)
......
<mat-sidenav-container autosize class="maarch-container">
<mat-sidenav #snav [mode]="appService.getViewMode() ? 'over' : 'side'" [fixedInViewport]="appService.getViewMode()"
[opened]="!appService.getViewMode()" [ngStyle]="{'width': appService.getViewMode() ? '80%' : '350px'}">
<header-panel [snavLeft]="snav"></header-panel>
<menu-shortcut></menu-shortcut>
<menu-nav></menu-nav>
<ng-template #adminMenuTemplate>
<mat-nav-list>
<h3 mat-subheader>{{lang.actions}}</h3>
<a mat-list-item routerLink="/administration/actions/new">
......@@ -13,13 +9,12 @@
</p>
</a>
</mat-nav-list>
<mat-divider></mat-divider>
</mat-sidenav>
</ng-template>
<mat-sidenav-content>
<div class="bg-head">
<div class="bg-head-title" [class.customContainerRight]="appService.getViewMode()">
<div class="bg-head-title-label">
<header-left [snavLeft]="snav"></header-left>
<header-left></header-left>
</div>
<div class="bg-head-title-tool">
<header-right></header-right>
......@@ -37,7 +32,8 @@
<div class="row">
<div class="col-md-6 col-xs-6">
<mat-form-field>
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="{{lang.filterBy}}">
<input matInput (keyup)="applyFilter($event.target.value)"
placeholder="{{lang.filterBy}}">
</mat-form-field>
</div>
<div class="col-md-6 col-xs-6">
......@@ -47,15 +43,19 @@
</div>
<mat-table #table [dataSource]="dataSource" matSort matSortActive="id" matSortDirection="asc">
<ng-container matColumnDef="id">
<mat-header-cell *matHeaderCellDef mat-sort-header [class.hide-for-mobile]="appService.getViewMode()">{{lang.id}}</mat-header-cell>
<mat-cell *matCellDef="let element" [class.hide-for-mobile]="appService.getViewMode()"> {{element.id}} </mat-cell>
<mat-header-cell *matHeaderCellDef mat-sort-header
[class.hide-for-mobile]="appService.getViewMode()">{{lang.id}}</mat-header-cell>
<mat-cell *matCellDef="let element" [class.hide-for-mobile]="appService.getViewMode()">
{{element.id}} </mat-cell>
</ng-container>
<ng-container matColumnDef="label_action">
<mat-header-cell *matHeaderCellDef mat-sort-header>{{lang.actionName}}</mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.label_action}} </mat-cell>
</ng-container>
<ng-container matColumnDef="history">
<mat-header-cell *matHeaderCellDef mat-sort-header [class.hide-for-mobile]="appService.getViewMode()">{{lang.actionHistory}}</mat-header-cell>
<mat-header-cell *matHeaderCellDef mat-sort-header
[class.hide-for-mobile]="appService.getViewMode()">{{lang.actionHistory}}
</mat-header-cell>
<mat-cell *matCellDef="let element" [class.hide-for-mobile]="appService.getViewMode()">
<span *ngIf="element.history == 'N'"> {{lang.no}} </span>
<span *ngIf="element.history == 'Y'"> {{lang.yes}} </span>
......@@ -64,17 +64,23 @@
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let element" style="justify-content: flex-end;">
<button mat-icon-button color="warn" [disabled]="element.is_system == 'Y'" matTooltip="{{lang.delete}}" (click)="$event.stopPropagation();deleteAction(element)">
<button mat-icon-button color="warn" [disabled]="element.is_system == 'Y'"
matTooltip="{{lang.delete}}"
(click)="$event.stopPropagation();deleteAction(element)">
<mat-icon class="fa fa-trash-alt fa-2x" aria-hidden="true"></mat-icon>
</button>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;" routerLink="/administration/actions/{{row.id}}" style="cursor:pointer;" matTooltip="{{lang.view}}"></mat-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"
routerLink="/administration/actions/{{row.id}}" style="cursor:pointer;"
matTooltip="{{lang.view}}"></mat-row>
</mat-table>
<div class="mat-paginator" style="min-height:48px;min-height: 48px;display: flex;justify-content: end;align-items: center;padding-right: 20px;">{{actions.length}} {{lang.actions}}</div>
<div class="mat-paginator"
style="min-height:48px;min-height: 48px;display: flex;justify-content: end;align-items: center;padding-right: 20px;">
{{actions.length}} {{lang.actions}}</div>
</mat-card>
</div>
</div>
</mat-sidenav-content>
</mat-sidenav-container>
</mat-sidenav-container>
\ No newline at end of file
import { Component, ViewChild, OnInit } from '@angular/core';
import { Component, ViewChild, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { LANG } from '../../translate.component';
import { NotificationService } from '../../notification.service';
......@@ -14,13 +14,13 @@ declare function $j(selector: any): any;
@Component({
templateUrl: "actions-administration.component.html",
providers: [NotificationService, AppService]
providers: [AppService]
})
export class ActionsAdministrationComponent implements OnInit {
@ViewChild('snav', { static: true }) public sidenavLeft : MatSidenav;
@ViewChild('snav2', { static: true }) public sidenavRight : MatSidenav;
@ViewChild('adminMenuTemplate', { static: true }) adminMenuTemplate: TemplateRef<any>;
lang: any = LANG;
search: string = null;
......@@ -42,20 +42,21 @@ export class ActionsAdministrationComponent implements OnInit {
return this.functions.filterUnSensitive(template, filter, ['id', 'label_action']);
};
}
constructor(
public http: HttpClient,
private notify: NotificationService,
private headerService: HeaderService,
public appService: AppService,
public functions: FunctionsService
public functions: FunctionsService,
private viewContainerRef: ViewContainerRef
) {
$j("link[href='merged_css.php']").remove();
}
ngOnInit(): void {
this.headerService.sideNavLeft = this.sidenavLeft;
this.headerService.injectInSideBarLeft(this.adminMenuTemplate, this.viewContainerRef, 'adminMenu');
this.loading = true;
......
......@@ -3,6 +3,7 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../app-common.module';
import { AdministrationRoutingModule } from './administration-routing.module';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { AdministrationComponent } from './home/administration.component';
import { UsersAdministrationComponent, UsersAdministrationRedirectModalComponent } from './user/users-administration.component';
......@@ -56,6 +57,7 @@ import { TagAdministrationComponent } from './tag/tag-administratio
@NgModule({
imports: [
SharedModule,
NgxChartsModule,
AdministrationRoutingModule
],
declarations: [
......
import { Component, OnInit, Inject, ViewChild, ElementRef } from '@angular/core';
import { Component, OnInit, Inject, ViewChild, ElementRef, TemplateRef, ViewContainerRef } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Router, ActivatedRoute } from '@angular/router';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
......@@ -9,7 +9,6 @@ import { MatTableDataSource } from '@angular/material/table';
import { LANG } from '../../translate.component';
import { NotificationService } from '../../notification.service';
import { HeaderService } from '../../../service/header.service';
import { FormControl } from '@angular/forms';
import { AppService } from '../../../service/app.service';
declare function $j(selector: any): any;
......@@ -17,12 +16,12 @@ declare function $j(selector: any): any;
@Component({
templateUrl: "basket-administration.component.html",
styleUrls: ['basket-administration.component.scss'],
providers: [NotificationService, AppService]
providers: [AppService]
})
export class BasketAdministrationComponent implements OnInit {
@ViewChild('snav', { static: true }) public sidenavLeft: MatSidenav;
@ViewChild('snav2', { static: true }) public sidenavRight: MatSidenav;
@ViewChild('adminMenuTemplate', { static: true }) adminMenuTemplate: TemplateRef<any>;
dialogRef: MatDialogRef<any>;
......@@ -66,14 +65,14 @@ export class BasketAdministrationComponent implements OnInit {
private notify: NotificationService,
public dialog: MatDialog,
private headerService: HeaderService,
public appService: AppService) {
public appService: AppService,
private viewContainerRef: ViewContainerRef) {
$j("link[href='merged_css.php']").remove();
}
ngOnInit(): void {
this.loading = true;
this.headerService.sideNavLeft = this.sidenavLeft;
this.headerService.injectInSideBarLeft(this.adminMenuTemplate, this.viewContainerRef, 'adminMenu');
this.route.params.subscribe((params: any) => {
if (typeof params['id'] == "undefined") {
......
<mat-sidenav-container autosize class="maarch-container">
<mat-sidenav #snav [mode]="appService.getViewMode() ? 'over' : 'side'" [fixedInViewport]="appService.getViewMode()"
[opened]="!appService.getViewMode()" [ngStyle]="{'width': appService.getViewMode() ? '80%' : '350px'}">
<header-panel [snavLeft]="snav"></header-panel>
<menu-shortcut></menu-shortcut>
<menu-nav></menu-nav>
<ng-template #adminMenuTemplate>
<mat-nav-list>
<h3 mat-subheader>{{lang.actions}}</h3>
<a mat-list-item routerLink="/administration/baskets/new">
......@@ -19,13 +15,12 @@
</p>
</a>
</mat-nav-list>
<mat-divider></mat-divider>
</mat-sidenav>
</ng-template>
<mat-sidenav-content>
<div class="bg-head">
<div class="bg-head-title" [class.customContainerRight]="appService.getViewMode()">
<div class="bg-head-title-label">
<header-left [snavLeft]="snav"></header-left>
<header-left></header-left>
</div>
<div class="bg-head-title-tool">
<header-right></header-right>
......@@ -43,7 +38,8 @@
<div class="row">
<div class="col-md-6 col-xs-6">
<mat-form-field>
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="{{lang.filterBy}}">
<input matInput (keyup)="applyFilter($event.target.value)"
placeholder="{{lang.filterBy}}">
</mat-form-field>
</div>
<div class="col-md-6 col-xs-6">
......@@ -51,47 +47,58 @@
</mat-paginator>
</div>
</div>
<mat-table #table [dataSource]="dataSource" matSort matSortActive="basket_id" matSortDirection="asc">
<mat-table #table [dataSource]="dataSource" matSort matSortActive="basket_id"
matSortDirection="asc">
<ng-container matColumnDef="basket_id">
<mat-header-cell *matHeaderCellDef mat-sort-header [class.hide-for-mobile]="appService.getViewMode()">{{lang.id}}</mat-header-cell>
<mat-cell *matCellDef="let element" [class.hide-for-mobile]="appService.getViewMode()"> {{element.basket_id}} </mat-cell>
<mat-header-cell *matHeaderCellDef mat-sort-header
[class.hide-for-mobile]="appService.getViewMode()">{{lang.id}}</mat-header-cell>
<mat-cell *matCellDef="let element" [class.hide-for-mobile]="appService.getViewMode()">
{{element.basket_id}} </mat-cell>
</ng-container>
<ng-container matColumnDef="basket_name">
<mat-header-cell *matHeaderCellDef mat-sort-header>{{lang.label}}</mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.basket_name}} </mat-cell>
</ng-container>
<ng-container matColumnDef="basket_desc">
<mat-header-cell *matHeaderCellDef mat-sort-header [class.hide-for-mobile]="appService.getViewMode()">{{lang.description}}</mat-header-cell>
<mat-cell *matCellDef="let element" [class.hide-for-mobile]="appService.getViewMode()"> {{element.basket_desc}} </mat-cell>
<mat-header-cell *matHeaderCellDef mat-sort-header
[class.hide-for-mobile]="appService.getViewMode()">{{lang.description}}
</mat-header-cell>
<mat-cell *matCellDef="let element" [class.hide-for-mobile]="appService.getViewMode()">
{{element.basket_desc}} </mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let element" style="justify-content: flex-end;">
<button mat-icon-button color="warn" matTooltip="{{lang.delete}}" (click)="$event.stopPropagation();delete(element)">
<button mat-icon-button color="warn" matTooltip="{{lang.delete}}"
(click)="$event.stopPropagation();delete(element)">
<mat-icon class="fa fa-trash-alt fa-2x" aria-hidden="true"></mat-icon>
</button>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;" routerLink="/administration/baskets/{{row.basket_id}}" style="cursor:pointer;" matTooltip="{{lang.view}}"></mat-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"
routerLink="/administration/baskets/{{row.basket_id}}" style="cursor:pointer;"
matTooltip="{{lang.view}}"></mat-row>
</mat-table>
<div class="mat-paginator" style="min-height:48px;min-height: 48px;display: flex;justify-content: end;align-items: center;padding-right: 20px;">{{baskets.length}} {{lang.baskets}}</div>
<div class="mat-paginator"
style="min-height:48px;min-height: 48px;display: flex;justify-content: end;align-items: center;padding-right: 20px;">
{{baskets.length}} {{lang.baskets}}</div>
</mat-card>
</div>
</div>
</mat-sidenav-content>
<mat-sidenav #snav2 [mode]="appService.getViewMode() ? 'over' : 'side'" [fixedInViewport]="appService.getViewMode()" fixedTopGap="56"
position='end' [opened]="appService.getViewMode() ? false : false">
<mat-sidenav #snav2 [mode]="appService.getViewMode() ? 'over' : 'side'" [fixedInViewport]="appService.getViewMode()"
fixedTopGap="56" position='end' [opened]="appService.getViewMode() ? false : false">
<p style="font-size:15px;padding:10px"> {{lang.basketHelpDesc}} </p>
<mat-list>
<span dnd-sortable-container [dropZones]="['boxers-zone']" [sortableData]="basketsOrder">
<mat-list-item disableRipple="true" *ngFor="let basket of basketsOrder;let i = index" title="{{lang.move}}" dnd-sortable
[sortableIndex]="i" (onDropSuccess)="updateBasketOrder(basket)">
<mat-icon color="primary" mat-list-icon class="fa fa-inbox"></mat-icon>
<p mat-line>{{i+1}} - {{basket.basket_name}}</p>
</mat-list-item>
</span>
<span dnd-sortable-container [dropZones]="['boxers-zone']" [sortableData]="basketsOrder">
<mat-list-item disableRipple="true" *ngFor="let basket of basketsOrder;let i = index"
title="{{lang.move}}" dnd-sortable [sortableIndex]="i" (onDropSuccess)="updateBasketOrder(basket)">
<mat-icon color="primary" mat-list-icon class="fa fa-inbox"></mat-icon>
<p mat-line>{{i+1}} - {{basket.basket_name}}</p>
</mat-list-item>
</span>
</mat-list>
</mat-sidenav>
</mat-sidenav-container>
</mat-sidenav-container>
\ No newline at end of file
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, OnInit, ViewChild, ViewContainerRef, TemplateRef } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { LANG } from '../../translate.component';
import { MatPaginator } from '@angular/material/paginator';
......@@ -6,29 +6,29 @@ import { MatSidenav } from '@angular/material/sidenav';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { NotificationService } from '../../notification.service';
import { HeaderService } from '../../../service/header.service';
import { HeaderService } from '../../../service/header.service';
import { AppService } from '../../../service/app.service';
import {FunctionsService} from "../../../service/functions.service";
import { FunctionsService } from "../../../service/functions.service";
declare function $j(selector: any): any;
@Component({
templateUrl: "baskets-administration.component.html",
providers: [NotificationService, AppService]
providers: [AppService]
})
export class BasketsAdministrationComponent implements OnInit {
@ViewChild('snav', { static: true }) public sidenavLeft : MatSidenav;
@ViewChild('snav2', { static: true }) public sidenavRight : MatSidenav;
@ViewChild('snav2', { static: true }) public sidenavRight: MatSidenav;
@ViewChild('adminMenuTemplate', { static: true }) adminMenuTemplate: TemplateRef<any>;
lang : any = LANG;
loading : boolean = false;
lang: any = LANG;
loading: boolean = false;
baskets : any[] = [];
basketsOrder : any[] = [];
baskets: any[] = [];
basketsOrder: any[] = [];
displayedColumns = ['basket_id', 'basket_name', 'basket_desc', 'actions'];
dataSource : any;
displayedColumns = ['basket_id', 'basket_name', 'basket_desc', 'actions'];
dataSource: any;
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator;
@ViewChild(MatSort, { static: false }) sort: MatSort;
......@@ -42,18 +42,19 @@ export class BasketsAdministrationComponent implements OnInit {
}
constructor(
public http: HttpClient,
private notify: NotificationService,
public http: HttpClient,
private notify: NotificationService,
private headerService: HeaderService,
public appService: AppService,
public functions: FunctionsService
) {
$j("link[href='merged_css.php']").remove();
public functions: FunctionsService,
private viewContainerRef: ViewContainerRef
) {
$j("link[href='merged_css.php']").remove();
}
ngOnInit(): void {
this.headerService.injectInSideBarLeft(this.adminMenuTemplate, this.viewContainerRef, 'adminMenu');
this.headerService.setHeader(this.lang.administration + ' ' + this.lang.baskets);
this.headerService.sideNavLeft = this.sidenavLeft;
this.loading = true;
......
<mat-sidenav-container autosize class="maarch-container">
<mat-sidenav #snav [mode]="appService.getViewMode() ? 'over' : 'side'" [fixedInViewport]="appService.getViewMode()"
[opened]="appService.getViewMode() ? false : true" [ngStyle]="{'width': appService.getViewMode() ? '80%' : '350px'}">
<header-panel [snavLeft]="snav"></header-panel>
<menu-shortcut></menu-shortcut>
<menu-nav></menu-nav>
<ng-template #adminMenuTemplate>
<mat-nav-list>
<a mat-list-item *ngFor="let menu of subMenus" [class.active]="menu.current" [routerLink]="menu.route">
<mat-icon color="primary" mat-list-icon [class]="menu.icon"></mat-icon>
......@@ -12,13 +8,12 @@
</p>
</a>
</mat-nav-list>
<mat-divider></mat-divider>
</mat-sidenav>
</ng-template>
<mat-sidenav-content>
<div class="bg-head">
<div class="bg-head-title" [class.customContainerRight]="appService.getViewMode()">
<div class="bg-head-title-label">
<header-left [snavLeft]="snav"></header-left>
<header-left></header-left>
</div>
<div class="bg-head-title-tool">
<header-right></header-right>
......@@ -171,4 +166,4 @@
</mat-tab>
</mat-tab-group>
</mat-sidenav>
</mat-sidenav-container>
</mat-sidenav-container>
\ No newline at end of file
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, OnInit, ViewChild, TemplateRef, ViewContainerRef } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { LANG } from '../../../translate.component';
import { NotificationService } from '../../../notification.service';
......@@ -22,8 +22,8 @@ import { SortPipe } from '../../../../plugins/sorting.pipe';
export class ContactsCustomFieldsAdministrationComponent implements OnInit {
@ViewChild('snav', { static: true }) public sidenavLeft: MatSidenav;
@ViewChild('snav2', { static: true }) public sidenavRight: MatSidenav;
@ViewChild('adminMenuTemplate', { static: true }) adminMenuTemplate: TemplateRef<any>;
lang: any = LANG;
......@@ -98,7 +98,8 @@ export class ContactsCustomFieldsAdministrationComponent implements OnInit {
public dialog: MatDialog,
private headerService: HeaderService,
public appService: AppService,
private sortPipe: SortPipe
private sortPipe: SortPipe,
private viewContainerRef: ViewContainerRef
) {
}
......@@ -106,7 +107,7 @@ export class ContactsCustomFieldsAdministrationComponent implements OnInit {
ngOnInit(): void {
this.headerService.setHeader(this.lang.administration + ' ' + this.lang.customFields + ' ' + this.lang.contacts);
this.headerService.sideNavLeft = this.sidenavLeft;