Kundennavigation angepasst

This commit is contained in:
Lorenz Hilpert
2023-07-14 12:19:03 +02:00
parent d77fe8c540
commit 729451fa48
2 changed files with 59 additions and 24 deletions

View File

@@ -14,7 +14,7 @@ export class CustomerSearchNavigation {
constructor(private _router: Router) {}
defaultRoute(params: { processId: NumberInput }): NavigationRoute {
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer'];
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer', 'search'];
const urlTree = this._router.createUrlTree(path, { queryParams: {} });
@@ -30,7 +30,7 @@ export class CustomerSearchNavigation {
}
detailsRoute(params: { processId: NumberInput; customerId: NumberInput }): NavigationRoute {
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer', coerceNumberProperty(params.customerId)];
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer', 'search', coerceNumberProperty(params.customerId)];
const urlTree = this._router.createUrlTree(path, { queryParams: {} });
@@ -50,6 +50,7 @@ export class CustomerSearchNavigation {
'/kunde',
coerceNumberProperty(params.processId),
'customer',
'search',
coerceNumberProperty(params.customerId),
'billingaddress',
'add',
@@ -73,6 +74,7 @@ export class CustomerSearchNavigation {
'/kunde',
coerceNumberProperty(params.processId),
'customer',
'search',
coerceNumberProperty(params.customerId),
'billingaddress',
coerceNumberProperty(params.payerId),
@@ -97,6 +99,7 @@ export class CustomerSearchNavigation {
'/kunde',
coerceNumberProperty(params.processId),
'customer',
'search',
coerceNumberProperty(params.customerId),
'shippingaddress',
'add',
@@ -116,7 +119,14 @@ export class CustomerSearchNavigation {
}
ordersRoute(params: { processId: NumberInput; customerId: NumberInput }): NavigationRoute {
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer', coerceNumberProperty(params.customerId), 'orders'];
const path = [
'/kunde',
coerceNumberProperty(params.processId),
'customer',
'search',
coerceNumberProperty(params.customerId),
'orders',
];
const urlTree = this._router.createUrlTree(path, { queryParams: {} });
@@ -141,6 +151,7 @@ export class CustomerSearchNavigation {
'/kunde',
coerceNumberProperty(params.processId),
'customer',
'search',
coerceNumberProperty(params.customerId),
'orders',
coerceNumberProperty(params.orderId),
@@ -169,7 +180,14 @@ export class CustomerSearchNavigation {
}
historyRoute(params: { processId: NumberInput; customerId: NumberInput }): NavigationRoute {
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer', coerceNumberProperty(params.customerId), 'history'];
const path = [
'/kunde',
coerceNumberProperty(params.processId),
'customer',
'search',
coerceNumberProperty(params.customerId),
'history',
];
const urlTree = this._router.createUrlTree(path, { queryParams: {} });
@@ -180,7 +198,7 @@ export class CustomerSearchNavigation {
}
editRoute(params: { processId: NumberInput; customerId: NumberInput; isB2b?: boolean }): NavigationRoute {
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer', coerceNumberProperty(params.customerId), 'edit'];
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer', 'search', coerceNumberProperty(params.customerId), 'edit'];
if (params.isB2b) {
path.push('b2b');
@@ -201,7 +219,7 @@ export class CustomerSearchNavigation {
}
filterRoute(params: { processId: NumberInput; comingFrom?: string }): NavigationRoute {
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer', 'filter'];
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer', 'search', 'filter'];
const urlTree = this._router.createUrlTree(path, { queryParams: { comingFrom: params.comingFrom } });
@@ -218,7 +236,7 @@ export class CustomerSearchNavigation {
}
listRoute(params: { processId: NumberInput; filter?: Filter }): NavigationRoute {
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer', 'search'];
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer', 'search', 'list'];
const queryParams = params.filter?.getQueryParams() ?? {};
@@ -232,7 +250,14 @@ export class CustomerSearchNavigation {
}
kundenkarteRoute(params: { processId: NumberInput; customerId: NumberInput }): NavigationRoute {
const path = ['/kunde', coerceNumberProperty(params.processId), 'customer', coerceNumberProperty(params.customerId), 'kundenkarte'];
const path = [
'/kunde',
coerceNumberProperty(params.processId),
'customer',
'search',
coerceNumberProperty(params.customerId),
'kundenkarte',
];
const urlTree = this._router.createUrlTree(path, { queryParams: {} });
@@ -252,6 +277,7 @@ export class CustomerSearchNavigation {
'/kunde',
coerceNumberProperty(params.processId),
'customer',
'search',
coerceNumberProperty(params.customerId),
'orders',
coerceNumberProperty(params.orderId),

View File

@@ -50,51 +50,60 @@ export const routes: Routes = [
path: '',
component: CustomerSearchComponent,
children: [
{ path: '', component: CustomerFilterMainViewComponent, data: { side: 'main', breadcrumb: 'main' } },
{ path: 'search', component: CustomerResultsMainViewComponent, data: { breadcrumb: 'search' } },
{ path: 'filter', component: CustomerFilterMainViewComponent, data: { side: 'results', breadcrumb: 'search' } },
{ path: ':customerId', component: CustomerDetailsViewMainComponent, data: { side: 'results', breadcrumb: 'details' } },
{ path: ':customerId/history', component: CustomerHistoryMainViewComponent, data: { side: 'results', breadcrumb: 'history' } },
{ path: '', pathMatch: 'full', redirectTo: 'search' },
{ path: 'search', component: CustomerFilterMainViewComponent, data: { side: 'main', breadcrumb: 'main' } },
{ path: 'search/list', component: CustomerResultsMainViewComponent, data: { breadcrumb: 'search' } },
{ path: 'search/filter', component: CustomerFilterMainViewComponent, data: { side: 'results', breadcrumb: 'search' } },
{ path: 'search/:customerId', component: CustomerDetailsViewMainComponent, data: { side: 'results', breadcrumb: 'details' } },
{
path: ':customerId/kundenkarte',
path: 'search/:customerId/history',
component: CustomerHistoryMainViewComponent,
data: { side: 'results', breadcrumb: 'history' },
},
{
path: 'search/:customerId/kundenkarte',
component: KundenkarteMainViewComponent,
data: { side: 'results', breadcrumb: 'kundenkarte' },
},
{ path: ':customerId/orders', component: CustomerOrdersMainViewComponent, data: { side: 'results', breadcrumb: 'orders' } },
{
path: ':customerId/orders/:orderId',
path: 'search/:customerId/orders',
component: CustomerOrdersMainViewComponent,
data: { side: 'results', breadcrumb: 'orders' },
},
{
path: 'search/:customerId/orders/:orderId',
component: OrderDetailsMainViewComponent,
data: { side: 'order-details', breadcrumb: 'order-details' },
},
{
path: ':customerId/orders/:orderId/:orderItemId',
path: 'search/:customerId/orders/:orderId/:orderItemId',
component: OrderDetailsMainViewComponent,
data: { side: 'order-details', breadcrumb: 'order-details' },
},
{
path: ':customerId/orders/:orderId/:orderItemId/history',
path: 'search/:customerId/orders/:orderId/:orderItemId/history',
component: CustomerOrderDetailsHistoryMainViewComponent,
data: { side: 'order-details', breadcrumb: 'order-details-history' },
},
{ path: ':customerId/edit/b2b', component: CustomerDataEditB2BComponent, data: { side: 'results', breadcrumb: 'edit' } },
{ path: ':customerId/edit', component: CustomerDataEditB2CComponent, data: { side: 'results', breadcrumb: 'edit' } },
{ path: 'search/:customerId/edit/b2b', component: CustomerDataEditB2BComponent, data: { side: 'results', breadcrumb: 'edit' } },
{ path: 'search/:customerId/edit', component: CustomerDataEditB2CComponent, data: { side: 'results', breadcrumb: 'edit' } },
{
path: ':customerId/billingaddress/add',
path: 'search/:customerId/billingaddress/add',
component: AddBillingAddressMainViewComponent,
data: { side: 'results', breadcrumb: 'add-billing-address' },
},
{
path: ':customerId/billingaddress/:payerId/edit',
path: 'search/:customerId/billingaddress/:payerId/edit',
component: EditBillingAddressMainViewComponent,
data: { side: 'results', breadcrumb: 'edit-billing-address' },
},
{
path: ':customerId/shippingaddress/add',
path: 'search/:customerId/shippingaddress/add',
component: AddShippingAddressMainViewComponent,
data: { side: 'results', breadcrumb: 'add-shipping-address' },
},
{
path: ':customerId/shippingaddress/:shippingAddressId/edit',
path: 'search/:customerId/shippingaddress/:shippingAddressId/edit',
component: EditShippingAddressMainViewComponent,
data: { side: 'results', breadcrumb: 'edit-shipping-address' },
},