Update routing and side menu interactions

Refactored routing structure and improved side menu functionality.

- 🛠️ **Refactor**: Simplified route definitions for process handling
- 🎨 **Style**: Cleaned up side menu HTML for better readability
- 🛠️ **Refactor**: Enhanced side menu item click handling

#5021
This commit is contained in:
Lorenz Hilpert
2025-04-01 14:12:09 +02:00
parent ddad3ad967
commit b43d0fcea6
2 changed files with 22 additions and 29 deletions

View File

@@ -108,16 +108,6 @@ const routes: Routes = [
canActivate: [ActivateProcessIdGuard],
loadChildren: () => import('@page/pickup-shelf').then((m) => m.PickupShelfOutModule),
},
{
path: ':processId',
resolve: { process: processResolverFn },
children: [
{
path: 'return',
loadChildren: () => import('@feature/return/pages').then((m) => m.routes),
},
],
},
{ path: '**', redirectTo: 'dashboard', pathMatch: 'full' },
],
resolve: { section: CustomerSectionResolver },
@@ -162,7 +152,18 @@ const routes: Routes = [
],
resolve: { section: BranchSectionResolver },
},
{ path: '**', redirectTo: 'kunde', pathMatch: 'full' },
],
},
{
path: ':processId',
component: MainComponent,
resolve: { process: processResolverFn },
canActivate: [IsAuthenticatedGuard],
children: [
{
path: 'return',
loadChildren: () => import('@feature/return/pages').then((m) => m.routes),
},
],
},
];

View File

@@ -34,9 +34,7 @@
class="side-menu-group-arrow"
[class.side-menu-item-rotate]="customerExpanded"
(click)="
$event.stopPropagation();
$event.preventDefault();
customerExpanded = !customerExpanded
$event.stopPropagation(); $event.preventDefault(); customerExpanded = !customerExpanded
"
>
<shared-icon icon="keyboard-arrow-down"></shared-icon>
@@ -90,7 +88,11 @@
*ifRole="'Store'"
class="side-menu-group-item"
(click)="closeSideMenu(); focusSearchBox()"
[routerLink]="[processService.nextId(), 'return']"
[routerLink]="[
'/',
processService.activatedProcess()?.id || processService.nextId(),
'return',
]"
(isActiveChange)="focusSearchBox()"
>
<span class="side-menu-group-item-icon w-[2.375rem] h-12">
@@ -166,9 +168,7 @@
class="side-menu-group-arrow"
[class.side-menu-item-rotate]="shelfExpanded"
(click)="
$event.stopPropagation();
$event.preventDefault();
shelfExpanded = !shelfExpanded
$event.stopPropagation(); $event.preventDefault(); shelfExpanded = !shelfExpanded
"
>
<shared-icon icon="keyboard-arrow-down"></shared-icon>
@@ -178,10 +178,7 @@
<div class="side-menu-group-sub-items" [class.hidden]="!shelfExpanded">
<a
class="side-menu-group-item"
*ngIf="
pickUpShelfInRoutePath$ | async;
let pickUpShelfInListNavigation
"
*ngIf="pickUpShelfInRoutePath$ | async; let pickUpShelfInListNavigation"
(click)="closeSideMenu(); focusSearchBox()"
[routerLink]="pickUpShelfInListNavigation.path"
[queryParams]="pickUpShelfInListNavigation.queryParams"
@@ -234,9 +231,7 @@
(click)="closeSideMenu()"
[routerLink]="['/filiale', 'goods', 'in', 'list']"
[queryParams]="{ view: 'wareneingangsliste' }"
[class.active-child]="
(currentShelfView$ | async) === 'wareneingangsliste'
"
[class.active-child]="(currentShelfView$ | async) === 'wareneingangsliste'"
routerLinkActive="active"
(isActiveChange)="shelfActive($event)"
>
@@ -262,10 +257,7 @@
<a
class="side-menu-group-item"
*ngIf="
packageInspectionNavigation$ | async;
let packageInspectionNavigation
"
*ngIf="packageInspectionNavigation$ | async; let packageInspectionNavigation"
(click)="closeSideMenu(); fetchAndOpenPackages()"
[routerLink]="packageInspectionNavigation.path"
[queryParams]="packageInspectionNavigation.queryParams"