mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Fix Shell Navigation if ProcessId is undefined
This commit is contained in:
@@ -39,15 +39,15 @@
|
|||||||
<div class="shell-footer-wrapper">
|
<div class="shell-footer-wrapper">
|
||||||
<shell-footer *ngIf="section$ | async; let section">
|
<shell-footer *ngIf="section$ | async; let section">
|
||||||
<ng-container *ngIf="section === 'customer'">
|
<ng-container *ngIf="section === 'customer'">
|
||||||
<a [routerLink]="['/kunde', activatedProcessId$ | async, 'product']" routerLinkActive="active">
|
<a [routerLink]="[customerBasePath$ | async, 'product']" routerLinkActive="active">
|
||||||
<ui-icon icon="catalog" size="30px"></ui-icon>
|
<ui-icon icon="catalog" size="30px"></ui-icon>
|
||||||
Artikelsuche
|
Artikelsuche
|
||||||
</a>
|
</a>
|
||||||
<a [routerLink]="['/kunde', activatedProcessId$ | async, 'customer']" routerLinkActive="active">
|
<a [routerLink]="[customerBasePath$ | async, 'customer']" routerLinkActive="active">
|
||||||
<ui-icon icon="customer" size="24px"></ui-icon>
|
<ui-icon icon="customer" size="24px"></ui-icon>
|
||||||
Kundensuche
|
Kundensuche
|
||||||
</a>
|
</a>
|
||||||
<a [routerLink]="['/kunde', activatedProcessId$ | async, 'goods', 'out']" routerLinkActive="active">
|
<a [routerLink]="[customerBasePath$ | async, 'goods', 'out']" routerLinkActive="active">
|
||||||
<ui-icon icon="box_out" size="24px"></ui-icon>
|
<ui-icon icon="box_out" size="24px"></ui-icon>
|
||||||
Warenausgabe
|
Warenausgabe
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ describe('ShellComponent', () => {
|
|||||||
|
|
||||||
it('should display the menu items for section customer', () => {
|
it('should display the menu items for section customer', () => {
|
||||||
applicationServiceMock.getSection$.and.returnValue(of('customer'));
|
applicationServiceMock.getSection$.and.returnValue(of('customer'));
|
||||||
applicationServiceMock.getActivatedProcessId$.and.returnValue(of(1));
|
spectator.component.customerBasePath$ = of('/kunde/1');
|
||||||
spectator.detectComponentChanges();
|
spectator.detectComponentChanges();
|
||||||
|
|
||||||
const anchors = spectator.queryAll('shell-footer a');
|
const anchors = spectator.queryAll('shell-footer a');
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ export class ShellComponent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
customerBasePath$ = this.activatedProcessId$.pipe(map((processId) => (processId ? `/kunde/${processId}` : '/kunde')));
|
||||||
|
|
||||||
get section$() {
|
get section$() {
|
||||||
return this._appService.getSection$().pipe(shareReplay());
|
return this._appService.getSection$().pipe(shareReplay());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user