Removed Extends Base Component from Shelf In List

This commit is contained in:
Nino
2023-10-06 14:12:59 +02:00
parent 8a84e69ce3
commit a7003b84bf

View File

@@ -7,10 +7,9 @@ import { PickUpShelfListItemComponent } from '../../shared/pickup-shelf-list-ite
import { UiScrollContainerModule } from '@ui/scroll-container';
import { GroupByPipe } from '@ui/common';
import { UiSpinnerModule } from '@ui/spinner';
import { GetNameForBreadcrumbData, GetPathForBreadcrumbData, PickupShelfBaseComponent } from '../../pickup-shelf-base.component';
import { NavigationRoute, PickupShelfInNavigationService } from '@shared/services';
import { map, take } from 'rxjs/operators';
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString } from '@swagger/oms';
import { PickupShelfInNavigationService } from '@shared/services';
import { map } from 'rxjs/operators';
import { DBHOrderItemListItemDTO } from '@swagger/oms';
import { Observable, combineLatest, of } from 'rxjs';
import { PickupShelfDetailsStore, PickupShelfStore } from '../../store';
import { isEqual } from 'lodash';
@@ -36,7 +35,7 @@ import { EnvironmentService } from '@core/environment';
UiSpinnerModule,
],
})
export class PickUpShelfInListComponent extends PickupShelfBaseComponent implements OnInit {
export class PickUpShelfInListComponent implements OnInit {
private _pickupShelfInNavigationService = inject(PickupShelfInNavigationService);
store = inject(PickupShelfStore);
@@ -90,9 +89,7 @@ export class PickUpShelfInListComponent extends PickupShelfBaseComponent impleme
private _environment: EnvironmentService,
private _activatedRoute: ActivatedRoute,
private _pickUpShelfInNavigation: PickupShelfInNavigationService
) {
super();
}
) {}
ngOnInit() {
if (!this.store.list.length) {
@@ -112,13 +109,6 @@ export class PickUpShelfInListComponent extends PickupShelfBaseComponent impleme
}).path;
}
selectionRules(action: KeyValueDTOOfStringAndString) {
return (
(action.command.includes('FETCHED') && action.key === '256' && action.enabled !== false) ||
action.command.includes('COLLECT_ON_DELIVERYNOTE')
);
}
search(filter: Filter) {
this.store.setQueryParams(filter.getQueryParams());
this.store.fetchList();
@@ -127,141 +117,4 @@ export class PickUpShelfInListComponent extends PickupShelfBaseComponent impleme
loadMore() {
this.store.fetchMoreList();
}
getNameForMainBreadcrumb(data: { queryParams: Record<string, string> }): string | Promise<string> {
return 'Einbuchen';
}
getPathForMainBreadcrumb(data: { queryParams: Record<string, string> }): NavigationRoute | Promise<NavigationRoute> {
return this._pickupShelfInNavigationService.defaultRoute();
}
getNameForListBreadcrumb(data: GetNameForBreadcrumbData): string | Promise<string> {
if (data.queryParams?.main_qs) {
return data.queryParams.main_qs;
}
return 'Alle';
}
getPathFoListBreadcrumb(data: GetPathForBreadcrumbData): NavigationRoute | Promise<NavigationRoute> {
return this._pickupShelfInNavigationService.listRoute();
}
getNameForFilterBreadcrumb(data: GetNameForBreadcrumbData): string | Promise<string> {
return 'Filter';
}
getPathForFilter(data: GetPathForBreadcrumbData): NavigationRoute | Promise<NavigationRoute> {
return this._pickupShelfInNavigationService.filterRoute();
}
async getNameForDetailBreadcrumb(data: GetNameForBreadcrumbData): Promise<string> {
const compartmentCode = await this.detailsStore.compartmentCode$.pipe(take(1)).toPromise();
if (compartmentCode) {
return compartmentCode;
}
const order = await this.detailsStore.order$.pipe(take(1)).toPromise();
if (order?.orderNumber) {
return order?.orderNumber;
}
return 'Details';
}
async getPathForDetailForDetailBreadcrumb(data: GetPathForBreadcrumbData): Promise<NavigationRoute> {
const compartmentCode = await this.detailsStore.compartmentCode$.pipe(take(1)).toPromise();
const order = await this.detailsStore.order$.pipe(take(1)).toPromise();
const processingStatus = await this.detailsStore.processingStatus$.pipe(take(1)).toPromise();
const item = await this.detailsStore.selectedOrderItems$.pipe(take(1)).toPromise();
return this._pickupShelfInNavigationService.detailRoute({
item: {
orderId: order?.id,
compartmentCode,
orderNumber: order?.orderNumber,
processingStatus: processingStatus,
orderItemSubsetId: item?.find((_) => true)?.orderItemSubsetId,
},
});
}
getPathForDetail(item: DBHOrderItemListItemDTO): Observable<NavigationRoute> {
return of(
this._pickupShelfInNavigationService.detailRoute({
item: {
compartmentCode: item.compartmentCode,
orderId: item.orderId,
orderNumber: item.orderNumber,
processingStatus: item.processingStatus,
orderItemSubsetId: item.orderItemSubsetId,
},
})
);
}
getPathForEdit(item: DBHOrderItemListItemDTO): Observable<NavigationRoute> {
return of(
this._pickupShelfInNavigationService.editRoute({
compartmentCode: item.compartmentCode,
orderId: item.orderId,
orderNumber: item.orderNumber,
processingStatus: item.processingStatus,
orderItemSubsetId: item.orderItemSubsetId,
})
);
}
async getPathForEditBreadcrumb(data: GetPathForBreadcrumbData): Promise<NavigationRoute> {
const compartmentCode = await this.detailsStore.compartmentCode$.pipe(take(1)).toPromise();
const order = await this.detailsStore.order$.pipe(take(1)).toPromise();
const processingStatus = await this.detailsStore.processingStatus$.pipe(take(1)).toPromise();
const item = await this.detailsStore.selectedOrderItems$.pipe(take(1)).toPromise();
return this._pickupShelfInNavigationService.editRoute({
orderId: order?.id,
compartmentCode,
orderNumber: order?.orderNumber,
processingStatus: processingStatus,
orderItemSubsetId: item?.find((_) => true)?.orderItemSubsetId,
});
}
async getNameForEditBreadcrumb(data: GetNameForBreadcrumbData): Promise<string> {
return 'Bearbeiten';
}
getPathForHistory(item: DBHOrderItemListItemDTO): Observable<NavigationRoute> {
return of(
this._pickupShelfInNavigationService.historyRoute({
compartmentCode: item.compartmentCode,
orderId: item.orderId,
orderNumber: item.orderNumber,
processingStatus: item.processingStatus,
orderItemSubsetId: item.orderItemSubsetId,
})
);
}
async getPathForHistoryBreadcrumb(data: GetPathForBreadcrumbData): Promise<NavigationRoute> {
const compartmentCode = await this.detailsStore.compartmentCode$.pipe(take(1)).toPromise();
const order = await this.detailsStore.order$.pipe(take(1)).toPromise();
const processingStatus = await this.detailsStore.processingStatus$.pipe(take(1)).toPromise();
const item = await this.detailsStore.selectedOrderItems$.pipe(take(1)).toPromise();
return this._pickupShelfInNavigationService.historyRoute({
orderId: order?.id,
compartmentCode,
orderNumber: order?.orderNumber,
processingStatus: processingStatus,
orderItemSubsetId: item?.find((_) => true)?.orderItemSubsetId,
});
}
async getNameForHistoryBreadcrumb(data: GetNameForBreadcrumbData): Promise<string> {
return 'Historie';
}
}