Merged PR 1649: #4340 Expand Dropdown on Click if menu is on assigned Section

#4340 Expand Dropdown on Click if menu is on assigned Section
This commit is contained in:
Nino Righi
2023-10-19 08:19:28 +00:00
committed by Lorenz Hilpert
parent a687b1771f
commit e9f16f72cb
2 changed files with 19 additions and 8 deletions

View File

@@ -19,7 +19,7 @@
<a
*ngIf="customerSearchRoute$ | async; let customerSearchRoute"
class="side-menu-group-item"
(click)="closeSideMenu(); focusSearchBox()"
(click)="expandCustomer(); closeSideMenu(); focusSearchBox()"
[routerLink]="customerSearchRoute.path"
[queryParams]="customerSearchRoute.queryParams"
routerLinkActive="active"
@@ -140,7 +140,7 @@
<div class="side-menu-group-sub-item-wrapper">
<a
class="side-menu-group-item"
(click)="closeSideMenu(); focusSearchBox()"
(click)="expandShelf(); closeSideMenu(); focusSearchBox()"
*ngIf="pickUpShelfInRoutePath$ | async; let pickUpShelfInNavigation"
[routerLink]="pickUpShelfInNavigation.path"
[queryParams]="pickUpShelfInNavigation.queryParams"
@@ -154,14 +154,14 @@
</span>
<button
class="side-menu-group-arrow"
[class.side-menu-item-rotate]="goodsInExpanded"
(click)="$event.stopPropagation(); $event.preventDefault(); goodsInExpanded = !goodsInExpanded"
[class.side-menu-item-rotate]="shelfExpanded"
(click)="$event.stopPropagation(); $event.preventDefault(); shelfExpanded = !shelfExpanded"
>
<shared-icon icon="keyboard-arrow-down"></shared-icon>
</button>
</a>
<div class="side-menu-group-sub-items" [class.hidden]="!goodsInExpanded">
<div class="side-menu-group-sub-items" [class.hidden]="!shelfExpanded">
<a
class="side-menu-group-item"
*ngIf="pickUpShelfInListRoutePath$ | async; let pickUpShelfInListNavigation"

View File

@@ -1,4 +1,4 @@
import { Component, ChangeDetectionStrategy, Inject } from '@angular/core';
import { Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef } from '@angular/core';
import { AuthModule, AuthService } from '@core/auth';
import { StockService } from '@swagger/wws';
import { first, map, retry, switchMap, take } from 'rxjs/operators';
@@ -136,8 +136,8 @@ export class ShellSideMenuComponent {
queryParams: {},
});
goodsInExpanded: boolean;
customerExpanded: boolean;
shelfExpanded: boolean = false;
customerExpanded: boolean = false;
constructor(
private _shellService: ShellService,
@@ -155,9 +155,20 @@ export class ShellSideMenuComponent {
private _customerCreateNavigation: CustomerCreateNavigation,
private _pickUpShelfOutNavigation: PickUpShelfOutNavigationService,
private _pickUpShelfInNavigation: PickupShelfInNavigationService,
private _cdr: ChangeDetectorRef,
@Inject(DOCUMENT) private readonly _document: Document
) {}
expandCustomer() {
this.customerExpanded = true;
this._cdr.markForCheck();
}
expandShelf() {
this.shelfExpanded = true;
this._cdr.markForCheck();
}
getLastNavigationByProcessId(id: number, fallback?: { path: string[]; queryParams: any }) {
return this._breadcrumbService.getBreadcrumbByKey$(id)?.pipe(
map((breadcrumbs) => {