From 90afcbfd81b3a4dc98acec337cb747ab8acb540b Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Tue, 27 Aug 2024 18:30:58 +0530 Subject: [PATCH 1/6] Improved: empty state UI for filters(#165) --- src/locales/en.json | 3 --- src/views/BrokeringQuery.vue | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index abb0ac3..c192ba5 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -6,11 +6,8 @@ "Activate": "Activate", "Add": "Add", "Add filters": "Add filters", - "Add inventory lookup filters.": "Add inventory lookup filters.", "Add inventory rule": "Add inventory rule", - "Add order filters.": "Add order filters.", "Add sorting": "Add sorting", - "Add sorting rules.": "Add sorting rules.", "All facilities enabled for online fulfillment will be attempted for brokering if no filter is applied.": "All facilities enabled for online fulfillment will be attempted for brokering if no filter is applied.", "All orders in all parkings will be attempted if no filter is applied.": "All orders in all parkings will be attempted if no filter is applied.", "Allow partial allocation": "Allow partial allocation", diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index 050a8e3..22d7f98 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -52,7 +52,6 @@

- {{ translate("Add order filters.") }}

{{ translate("All orders in all parkings will be attempted if no filter is applied.") }} {{ translate("Add filters") }} @@ -103,7 +102,6 @@

- {{ translate("Add sorting rules.") }}

{{ translate("Orders will be brokered based on order date if no sorting is specified.") }} {{ translate("Add sorting") }} @@ -184,9 +182,8 @@

- {{ translate("Add inventory lookup 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.") }} + {{ translate("Learn more") }}{{ translate(" about enabling a facility for online fulfillment.") }} {{ translate("Add filters") }} From bb0dc640155203441e0fd7c5f2c8b20428c0e043 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Tue, 3 Sep 2024 11:56:35 +0530 Subject: [PATCH 2/6] 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 3/6] 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; From 460b7b640358d3e5792676aceab5369b24c02019 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 4 Sep 2024 11:16:13 +0530 Subject: [PATCH 4/6] Improved: added option for ignoring facility order limit (#256) --- .env.example | 2 +- src/views/BrokeringQuery.vue | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 381858a..f47483d 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,7 @@ VUE_APP_VIEW_SIZE=10 VUE_APP_PERMISSION_ID= VUE_APP_DEFAULT_LOG_LEVEL="error" VUE_APP_RULE_ENUMS={"QUEUE":{"id":"OIP_QUEUE","code":"facilityId"},"SHIPPING_METHOD":{"id":"OIP_SHIP_METH_TYPE","code":"shipmentMethodTypeId"},"PRIORITY":{"id":"OIP_PRIORITY","code":"priority"},"PROMISE_DATE":{"id":"OIP_PROMISE_DATE","code":"promiseDaysCutoff"},"SALES_CHANNEL":{"id":"OIP_SALES_CHANNEL","code":"salesChannelEnumId"},"ORIGIN_FACILITY_GROUP":{"id":"OIP_ORIGIN_FAC_GRP","code":"originFacilityGroupId"},"SHIP_BY":{"id":"OSP_SHIP_BY","code":"shipBeforeDate"},"SHIP_AFTER":{"id":"OSP_SHIP_AFTER","code":"shipAfterDate"},"ORDER_DATE":{"id":"OSP_ORDER_DATE","code":"orderDate"},"SHIPPING_METHOD_SORT":{"id":"OSP_SHIP_METH","code":"deliveryDays"},"SORT_PRIORITY":{"id":"OSP_PRIORITY","code":"priority"}} -VUE_APP_RULE_FILTER_ENUMS={"FACILITY_GROUP":{"id":"IIP_FACILITY_GROUP","code":"facilityGroupId"},"PROXIMITY":{"id":"IIP_PROXIMITY","code":"distance"},"BRK_SAFETY_STOCK":{"id":"IIP_BRK_SFTY_STOCK","code":"brokeringSafetyStock"},"MEASUREMENT_SYSTEM":{"id":"IIP_MSMNT_SYSTEM","code":"measurementSystem"},"SPLIT_ITEM_GROUP":{"id":"IIP_SPLIT_ITEM_GROUP","code":"splitOrderItemGroup"}} +VUE_APP_RULE_FILTER_ENUMS={"FACILITY_GROUP":{"id":"IIP_FACILITY_GROUP","code":"facilityGroupId"},"PROXIMITY":{"id":"IIP_PROXIMITY","code":"distance"},"BRK_SAFETY_STOCK":{"id":"IIP_BRK_SFTY_STOCK","code":"brokeringSafetyStock"},"MEASUREMENT_SYSTEM":{"id":"IIP_MSMNT_SYSTEM","code":"measurementSystem"}, "SPLIT_ITEM_GROUP":{"id":"IIP_SPLIT_ITEM_GROUP","code":"splitOrderItemGroup"}, "FACILITY_ORDER_LIMIT": {"id":"IFP_IGNORE_ORD_FAC_LIMIT", "code":"ignoreFacilityOrderLimit"}} VUE_APP_RULE_SORT_ENUMS={"PROXIMITY":{"id":"ISP_PROXIMITY","code":"distance"},"INV_BALANCE":{"id":"ISP_INV_BAL","code":"inventoryForAllocation"},"CUSTOMER_SEQ":{"id":"ISP_CUST_SEQ","code":"facilitySequence"}} VUE_APP_RULE_ACTION_ENUMS={"RM_AUTO_CANCEL_DATE":{"id":"ORA_RM_CANCEL_DATE","code":"RM_AUTO_CANCEL_DATE"},"AUTO_CANCEL_DAYS":{"id":"ORA_AUTO_CANCEL_DAYS","code":"ADD_AUTO_CANCEL_DATE"},"NEXT_RULE":{"id":"ORA_NEXT_RULE","code":"NEXT_RULE"},"MOVE_TO_QUEUE":{"id":"ORA_MV_TO_QUEUE","code":"MOVE_TO_QUEUE"}} VUE_APP_CRON_EXPRESSIONS={"Every 5 minutes":"0 */5 * ? * *","Every 15 minutes":"0 */15 * ? * *","Every 30 minutes":"0 */30 * ? * *","Hourly":"0 0 * ? * *","Every six hours":"0 0 */6 ? * *","Every day at midnight":"0 0 0 * * ?"} diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index 0d96c3e..acfa0aa 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -220,6 +220,12 @@ {{ getFilterValue(inventoryRuleFilterOptions, conditionFilterEnums, "BRK_SAFETY_STOCK").fieldValue || getFilterValue(inventoryRuleFilterOptions, conditionFilterEnums, "BRK_SAFETY_STOCK").fieldValue == 0 ? getFilterValue(inventoryRuleFilterOptions, conditionFilterEnums, "BRK_SAFETY_STOCK").fieldValue : "-" }} + + + + {{ translate("Turn of the facility order limit check") }} + + @@ -949,7 +955,11 @@ function updateOrderFilterValue(event: CustomEvent, id: string, multi = false) { } function updateRuleFilterValue(event: CustomEvent, id: string) { - inventoryRuleFilterOptions.value[conditionFilterEnums[id].code].fieldValue = event.detail.value + if(id === "FACILITY_ORDER_LIMIT") { + inventoryRuleFilterOptions.value[conditionFilterEnums[id].code].fieldValue = event.detail.checked === true ? "Y" : "N" + } else { + inventoryRuleFilterOptions.value[conditionFilterEnums[id].code].fieldValue = event.detail.value + } updateRule() } From c7b6f8b757e6ec86d733767a48fc0f61a5d13398 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 4 Sep 2024 11:24:19 +0530 Subject: [PATCH 5/6] Improved: added entry in locale for the missing static label (#256) --- src/locales/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/locales/en.json b/src/locales/en.json index c192ba5..027a8a7 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -174,6 +174,7 @@ "This is the name of the OMS you are connected to right now. Make sure that you are connected to the right instance before proceeding.": "This is the name of the OMS you are connected to right now. Make sure that you are connected to the right instance before proceeding.", "Timezone": "Timezone", "Time zone updated successfully": "Time zone updated successfully", + "Turn of the facility order limit check": "Turn of the facility order limit check", "Unarchive": "Unarchive", "Unavailable items": "Unavailable items", "Updated at": "Updated at", From d6895c1c0b28c5b8fcd3e30cd8c592d071ca2c23 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 4 Sep 2024 12:12:23 +0530 Subject: [PATCH 6/6] Improved: optimized check condition (#256) --- src/views/BrokeringQuery.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index acfa0aa..468136c 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -956,7 +956,7 @@ function updateOrderFilterValue(event: CustomEvent, id: string, multi = false) { function updateRuleFilterValue(event: CustomEvent, id: string) { if(id === "FACILITY_ORDER_LIMIT") { - inventoryRuleFilterOptions.value[conditionFilterEnums[id].code].fieldValue = event.detail.checked === true ? "Y" : "N" + inventoryRuleFilterOptions.value[conditionFilterEnums[id].code].fieldValue = event.detail.checked ? "Y" : "N" } else { inventoryRuleFilterOptions.value[conditionFilterEnums[id].code].fieldValue = event.detail.value }