From bb0dc640155203441e0fd7c5f2c8b20428c0e043 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Tue, 3 Sep 2024 11:56:35 +0530 Subject: [PATCH 1/2] Improved: condition to make the value of partial allocation updated or server when selecting promise date and also enabled partial group allocation when partial allocation is enabled(#257) --- src/views/BrokeringQuery.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index 22d7f98..c5d6d78 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -257,8 +257,7 @@ {{ translate("Select if partial allocation should be allowed in this inventory rule") }} - - {{ translate("Allow partial allocation") }} + {{ translate("Allow partial allocation") }} @@ -808,6 +807,11 @@ function updatePartialAllocation(checked: any) { if(inventoryRule.routingRuleId === selectedRoutingRule.value.routingRuleId) { // Updating selected routing rule explicitely as we are using rulesForReorder for fetching selected values inventoryRule.assignmentEnumId = selectedRoutingRule.value.assignmentEnumId = checked ? "ORA_MULTI" : "ORA_SINGLE" + + // When enabling partial allocation, updating the value of partial group item allocation by default, + // as when partial allocation is enabled we are saying to partial allocate all items of orders thus need to make + // group items allocation enabled as well in this case. + updatePartialGroupItemsAllocation(checked) } }) hasUnsavedChanges.value = true @@ -818,7 +822,6 @@ function isPromiseDateFilterApplied() { return; } - // When user updates partial allocation and then selects promiseDate filter then we will assume that the user wants to change the value for partialAllocation on server and thus we will not revert any change made in the partial allocation action and update its value on server const filter = getFilterValue(orderRoutingFilterOptions.value, ruleEnums, "PROMISE_DATE") return filter?.fieldValue || filter?.fieldValue == 0 } @@ -876,6 +879,9 @@ async function selectPromiseFilterValue(ev: CustomEvent) { if(result.data?.duration || result.data?.duration == 0) { getFilterValue(orderRoutingFilterOptions.value, ruleEnums, "PROMISE_DATE").fieldValue = result.data?.isPastDuration ? `-${result.data?.duration}` : result.data?.duration hasUnsavedChanges.value = true + + // When selecting promiseDate route filter value, we also need to enable partial allocation and make its value change on the server + updatePartialAllocation(true); } getFilterValue(orderRoutingFilterOptions.value, ruleEnums, "PROMISE_DATE").operator = "less-equals" }) From 3a305642aab988c711b6cac48934a6a300c196d4 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Tue, 3 Sep 2024 12:02:30 +0530 Subject: [PATCH 2/2] Fixed: case to display empty state in rule filter only when an option from available filter is selected(#257) When applying partial group item allocation filter, empty state from the rule filters card is removed even when no filter is displayed inside the filter card, thus added check to not honor partial group item allocation as a filter when checking condition for displaying empty state --- src/views/BrokeringQuery.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index c5d6d78..0d96c3e 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -177,11 +177,11 @@

{{ translate("Filters") }}

- +
-

+

{{ translate("All facilities enabled for online fulfillment will be attempted for brokering if no filter is applied.") }}

{{ translate("Learn more") }}{{ translate(" about enabling a facility for online fulfillment.") }} @@ -817,6 +817,11 @@ function updatePartialAllocation(checked: any) { hasUnsavedChanges.value = true } +function isInventoryRuleFiltersApplied() { + const ruleFilters = Object.keys(inventoryRuleFilterOptions.value).filter((rule: string) => rule !== conditionFilterEnums["SPLIT_ITEM_GROUP"].code); + return ruleFilters.length +} + function isPromiseDateFilterApplied() { if(!currentRouting.value["rules"]?.length) { return;