Compare commits

...

1 Commits

Author SHA1 Message Date
Nino
1a8b70defd #4690 PickupShelfOut Details Display FETCHED_PARTIAL Action Correctly 2024-03-04 16:27:58 +01:00
3 changed files with 28 additions and 2 deletions

View File

@@ -84,7 +84,7 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
addToPreviousCompartmentAction$ = this.store.addToPreviousCompartmentAction$;
mainActions$ = this.store.mainActions$;
mainActions$ = this.store.mainShelfOutActions$;
trackByFnGroupDBHOrderItemListItemDTO = (index: number, group: { type: string; items: DBHOrderItemListItemDTO[] }) => group.type;

View File

@@ -1,5 +1,5 @@
import { PickupShelfDetailsState } from './pickup-shelf-details.state';
import { DBHOrderItemListItemDTO } from '@swagger/oms';
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString } from '@swagger/oms';
export const selectOrder = (s: PickupShelfDetailsState) => s.order;
@@ -245,6 +245,26 @@ export const selectMainActions = (s: PickupShelfDetailsState) => {
?.filter((action) => (fetchPartial ? !action.command.includes('FETCHED_PARTIAL') : true));
};
export const selectShelfOutMainActions = (s: PickupShelfDetailsState) => {
const items = selectOrderItems(s);
const fetchPartial = selectFetchPartial(s);
// Ticket #4690 Consider every Item for selecting the main actions in Details View - Only for PickUpShelfOut
const actions: KeyValueDTOOfStringAndString[] = [];
for (const item of items) {
const actionsFromItem = item?.actions
?.filter((action) => typeof action?.enabled !== 'boolean')
?.filter((action) => (fetchPartial ? !action.command.includes('FETCHED_PARTIAL') : true));
for (const action of actionsFromItem) {
if (!actions.find((a) => a.command === action.command)) {
actions.push(action);
}
}
}
return actions;
};
export const selectCustomerNumber = (s: PickupShelfDetailsState) => {
const order = selectOrder(s);
return order?.buyer?.buyerNumber;

View File

@@ -212,6 +212,12 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
return this.get(Selectors.selectMainActions);
}
mainShelfOutActions$ = this.select(Selectors.selectShelfOutMainActions);
get mainShelfOutActions() {
return this.get(Selectors.selectShelfOutMainActions);
}
customerNumber$ = this.select(Selectors.selectCustomerNumber);
get customerNumber() {