mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 730: #1944 Kundendetails Bestellungen Breadcrumb
#1944 Kundendetails Bestellungen Breadcrumb Related work items: #1944
This commit is contained in:
committed by
Lorenz Hilpert
parent
43876e2ceb
commit
b0bb686a35
@@ -170,6 +170,8 @@ export class CustomerDetailsComponent implements OnInit {
|
||||
path: `/customer/${customerId}`,
|
||||
tags: ['customer', 'details'],
|
||||
});
|
||||
|
||||
this.breadcrumb.removeBreadcrumbsAfter(this.currentBreadcrumb.id, ['customer']);
|
||||
}
|
||||
|
||||
updateBreadcrumbName(customer: CustomerDTO) {
|
||||
|
||||
@@ -8,6 +8,8 @@ import { OrderListItemDTO } from '@swagger/oms';
|
||||
import { OmsService } from '@domain/oms';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { BehaviorSubject, combineLatest, Subscription } from 'rxjs';
|
||||
import { ApplicationService } from '@core/application';
|
||||
import { BreadcrumbService } from '@core/breadcrumb';
|
||||
|
||||
@Component({
|
||||
selector: 'page-customer-orders',
|
||||
@@ -26,7 +28,13 @@ export class CustomerOrdersComponent implements OnInit, OnDestroy {
|
||||
isLoading: boolean;
|
||||
hasCustomerCard$: Observable<boolean>;
|
||||
|
||||
constructor(private activatedRoute: ActivatedRoute, private customerDetailsService: CrmCustomerService, private omsService: OmsService) {}
|
||||
constructor(
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private customerDetailsService: CrmCustomerService,
|
||||
private omsService: OmsService,
|
||||
private application: ApplicationService,
|
||||
private breadcrumb: BreadcrumbService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const customerId$ = this.activatedRoute.params.pipe(map((params) => Number(params['customerId'])));
|
||||
@@ -53,6 +61,28 @@ export class CustomerOrdersComponent implements OnInit, OnDestroy {
|
||||
this.isLoading = false;
|
||||
})
|
||||
);
|
||||
|
||||
this.createBreadcrumb();
|
||||
}
|
||||
|
||||
async createBreadcrumb() {
|
||||
const customer = await this.customer$?.pipe(first()).toPromise();
|
||||
this.breadcrumb.addBreadcrumbIfNotExists({
|
||||
key: this.application.activatedProcessId,
|
||||
name: 'Bestellungen',
|
||||
path: `/customer/${customer?.id}/orders`,
|
||||
tags: ['customer', 'orders'],
|
||||
params: {},
|
||||
});
|
||||
|
||||
const crumbs = await this.breadcrumb
|
||||
.getBreadcrumbsByKeyAndTags$(this.application.activatedProcessId, ['customer', 'orders'])
|
||||
.pipe(first())
|
||||
.toPromise();
|
||||
|
||||
for (const crumb of crumbs) {
|
||||
this.breadcrumb.removeBreadcrumbsAfter(crumb.id, ['customer']);
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
||||
Reference in New Issue
Block a user