From dcab823406f818e2cdac08fc57d8a0d8ba7ae9bf Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Thu, 22 Aug 2024 18:07:32 +0530 Subject: [PATCH 1/7] Implemented: support to exclude specific inventory filter from the rule(#248) --- .env.example | 2 +- .../AddInventoryFilterOptionsModal.vue | 12 +++++-- src/store/modules/orderRouting/actions.ts | 5 +++ src/store/modules/util/actions.ts | 10 ++++++ src/views/BrokeringQuery.vue | 32 ++++++++++++++++++- 5 files changed, 56 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 381858a..e780e06 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"},"FACILITY_GROUP_EXCLUDED":{"id":"IIP_FACILITY_GROUP_EXCLUDED","code":"facilityGroupId_excluded"},"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_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/components/AddInventoryFilterOptionsModal.vue b/src/components/AddInventoryFilterOptionsModal.vue index fbbf8da..b1fcd28 100644 --- a/src/components/AddInventoryFilterOptionsModal.vue +++ b/src/components/AddInventoryFilterOptionsModal.vue @@ -12,13 +12,18 @@

{{ translate(`Failed to fetch ${props.label?.toLowerCase()} options`) }}

+ + @@ -36,7 +41,7 @@ diff --git a/src/components/GroupActionsPopover.vue b/src/components/GroupActionsPopover.vue index c2e95d0..31dd116 100644 --- a/src/components/GroupActionsPopover.vue +++ b/src/components/GroupActionsPopover.vue @@ -42,15 +42,23 @@ const props = defineProps(["group"]) const isOmsConnectionExist = computed(() => store.getters["util/isOmsConnectionExist"]) async function updateGroupStatus(paused: string) { + console.log(props.group) let routingGroups = []; const payload = { routingGroupId: props.group.routingGroupId, - paused + paused, + cronExpression: props.group.schedule?.cronExpression || "0 0 0 * * ?" } try { const resp = await OrderRoutingService.scheduleBrokering(payload) + console.log('resp', resp, hasError(resp)) if(!hasError(resp)){ + props.group.schedule = { + ...props.group.schedule, + cronExpression: payload.cronExpression, + cronDescription: + } showToast(translate("Group status updated")) routingGroups = await store.dispatch("orderRouting/updateGroupStatus", { routingGroupId: props.group.routingGroupId, value: paused }) } else { diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index ac542d5..9c93f8a 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -32,6 +32,22 @@ const actions: ActionTree = { return enumerations }, enums) + console.log('enums', enums) + + if(enums["ORD_FILTER_PRM_TYPE"]) { + Object.values(enums["ORD_FILTER_PRM_TYPE"]).reduce((filters: any, filter: any) => { + filters[filter.enumId + "_EXCLUDED"] = { + "enumId": filter.enumId + "_EXCLUDED", + "enumTypeId": filter.enumTypeId, + "enumCode": filter.enumCode + "_excluded", + "sequenceNum": 5, + "description": filter.description + } + + return filters; + }, enums["ORD_FILTER_PRM_TYPE"]) + } + if(enums["INV_FILTER_PRM_TYPE"] && enums["INV_FILTER_PRM_TYPE"]["IIP_FACILITY_GROUP"]) { enums["INV_FILTER_PRM_TYPE"]["IIP_FACILITY_GROUP_EXCLUDED"] = { "enumId": "IIP_FACILITY_GROUP_EXCLUDED", diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index 7be82c9..caa8411 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -65,11 +65,29 @@ {{ facility.facilityName || facilityId }} + + +
+ {{ translate("Queue") }} + {{ translate("Excluded") }} +
+ {{ facility.facilityName || facilityId }} +
+
{{ shippingMethod.description || shippingMethodId }} + + +
+ {{ translate('Shipping method') }} + {{ translate("Excluded") }} +
+ {{ shippingMethod.description || shippingMethodId }} +
+
{{ translate("High") }} @@ -77,22 +95,57 @@ {{ translate("Low") }} + + +
+ {{ translate('Order priority') }} + {{ translate("Excluded") }} +
+ {{ translate("High") }} + {{ translate("Medium") }} + {{ translate("Low") }} +
+
{{ translate("Promise date") }} {{ getPromiseDateValue() }} + + {{ translate("Promise date") }} + + {{ getPromiseDateValue() }} + + {{ enumInfo.description || enumInfo.enumId }} + + +
+ {{ translate('Sales Channel') }} + {{ translate("Excluded") }} +
+ {{ enumInfo.description || enumInfo.enumId }} +
+
{{ facilityGroup.facilityGroupName || facilityGroupId }} + + +
+ {{ translate('Origin Facility Group') }} + {{ translate("Excluded") }} +
+ {{ facilityGroup.facilityGroupName || facilityGroupId }} +
+
@@ -269,7 +322,6 @@ {{ translate("Select if partial allocation should be allowed in this inventory rule") }} - {{ translate("Allow partial allocation") }} @@ -880,12 +932,12 @@ function getLabel(parentType: string, code: string) { return enumInfo?.description } -async function selectPromiseFilterValue(ev: CustomEvent) { +async function selectPromiseFilterValue(ev: CustomEvent, type = "included") { const popover = await popoverController .create({ component: PromiseFilterPopover, componentProps: { - value: getFilterValue(orderRoutingFilterOptions.value, ruleEnums, "PROMISE_DATE").fieldValue + value: getFilterValue(orderRoutingFilterOptions.value, ruleEnums, type === "excluded" ? "PROMISE_DATE_EXCLUDED" : "PROMISE_DATE").fieldValue }, event: ev, translucent: true, @@ -894,10 +946,12 @@ async function selectPromiseFilterValue(ev: CustomEvent) { popover.onDidDismiss().then((result: any) => { if(result.data?.duration || result.data?.duration == 0) { - getFilterValue(orderRoutingFilterOptions.value, ruleEnums, "PROMISE_DATE").fieldValue = result.data?.isPastDuration ? `-${result.data?.duration}` : result.data?.duration + getFilterValue(orderRoutingFilterOptions.value, ruleEnums, type === "excluded" ? "PROMISE_DATE_EXCLUDED" : "PROMISE_DATE").fieldValue = result.data?.isPastDuration ? `-${result.data?.duration}` : result.data?.duration + // Making partial allocation value to `MULTI` when applying promise date filter + updatePartialAllocation(true); hasUnsavedChanges.value = true } - getFilterValue(orderRoutingFilterOptions.value, ruleEnums, "PROMISE_DATE").operator = "less-equals" + getFilterValue(orderRoutingFilterOptions.value, ruleEnums, type === "excluded" ? "PROMISE_DATE_EXCLUDED" : "PROMISE_DATE").operator = "less-equals" }) return popover.present(); @@ -941,12 +995,13 @@ function updateOperator(event: CustomEvent) { } function updateOrderFilterValue(event: CustomEvent, id: string, multi = false) { + console.log('id', id) let value = event.detail.value - let operator = "equals" + let operator = id.includes("_EXCLUDED") ? "not-equals" : "equals" // When the filter has multiple selection support then we will receive an array in the event value and thus creating a string before updating the same as the fieldValue supports a string as value if(multi && value.length > 1) { value = value.join(',') - operator = "in" + operator = id.includes("_EXCLUDED") ? "not-in" : "in" } else if(multi) { // When filter is having a single option selected with multiple selection enabled, we will receive an array with single value, but as we need to pass a string, so fetching the 0th index from the array value = value[0] From 01485d45b8d0b715d2bdc54531e97561d7e1797e Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Tue, 15 Oct 2024 12:50:14 +0530 Subject: [PATCH 3/7] Updated: enum example entry to include exclude options --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 61fa02c..c143666 100644 --- a/.env.example +++ b/.env.example @@ -4,7 +4,7 @@ VUE_APP_CACHE_MAX_AGE=3600 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_ENUMS={"QUEUE":{"id":"OIP_QUEUE","code":"facilityId"},"QUEUE_EXCLUDED":{"id":"OIP_QUEUE_EXCLUDED","code":"facilityId_excluded"},"SHIPPING_METHOD":{"id":"OIP_SHIP_METH_TYPE","code":"shipmentMethodTypeId"},"SHIPPING_METHOD_EXCLUDED":{"id":"OIP_SHIP_METH_TYPE_EXCLUDED","code":"shipmentMethodTypeId_excluded"},"PRIORITY":{"id":"OIP_PRIORITY","code":"priority"},"PRIORITY_EXCLUDED":{"id":"OIP_PRIORITY_EXCLUDED","code":"priority_excluded"},"PROMISE_DATE":{"id":"OIP_PROMISE_DATE","code":"promiseDaysCutoff"},"PROMISE_DATE_EXCLUDED":{"id":"OIP_PROMISE_DATE_EXCLUDED","code":"promiseDaysCutoff_excluded"},"SALES_CHANNEL":{"id":"OIP_SALES_CHANNEL","code":"salesChannelEnumId"},"SALES_CHANNEL_EXCLUDED":{"id":"OIP_SALES_CHANNEL_EXCLUDED","code":"salesChannelEnumId_excluded"},"ORIGIN_FACILITY_GROUP":{"id":"OIP_ORIGIN_FAC_GRP","code":"originFacilityGroupId"},"ORIGIN_FACILITY_GROUP_EXCLUDED":{"id":"OIP_ORIGIN_FAC_GRP_EXCLUDED","code":"originFacilityGroupId_excluded"},"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"},"FACILITY_GROUP_EXCLUDED":{"id":"IIP_FACILITY_GROUP_EXCLUDED","code":"facilityGroupId_excluded"},"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"}} From 219b0ea67304e9905351f2744f14568ff81f53f6 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Tue, 15 Oct 2024 12:56:33 +0530 Subject: [PATCH 4/7] Improved: logic to display the exclude features when moving to rules page(#248) --- src/store/modules/orderRouting/actions.ts | 9 +++++++++ src/store/modules/util/actions.ts | 2 -- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/store/modules/orderRouting/actions.ts b/src/store/modules/orderRouting/actions.ts index dd20985..171282f 100644 --- a/src/store/modules/orderRouting/actions.ts +++ b/src/store/modules/orderRouting/actions.ts @@ -198,6 +198,15 @@ const actions: ActionTree = { if(!hasError(resp) && resp.data) { currentRoute = resp.data + + if(currentRoute["orderFilters"]?.length) { + currentRoute["orderFilters"].map((filter: any) => { + if(filter.operator === "not-equals" || filter.operator === "not-in") { + filter.fieldName += "_excluded" + } + }) + } + currentRoute["rules"] = currentRoute["rules"]?.length ? sortSequence(currentRoute["rules"]) : [] } else { throw resp.data diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index 9c93f8a..f34d1db 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -32,8 +32,6 @@ const actions: ActionTree = { return enumerations }, enums) - console.log('enums', enums) - if(enums["ORD_FILTER_PRM_TYPE"]) { Object.values(enums["ORD_FILTER_PRM_TYPE"]).reduce((filters: any, filter: any) => { filters[filter.enumId + "_EXCLUDED"] = { From 1cce8e799a54afd35c1812603c383d0f72d8e505 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Tue, 15 Oct 2024 12:57:51 +0530 Subject: [PATCH 5/7] Fixed: issue to not display the duplicate options in exclude and include section(#248) --- src/components/AddOrderRouteFilterOptions.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/AddOrderRouteFilterOptions.vue b/src/components/AddOrderRouteFilterOptions.vue index 405231d..938d3b4 100644 --- a/src/components/AddOrderRouteFilterOptions.vue +++ b/src/components/AddOrderRouteFilterOptions.vue @@ -23,8 +23,8 @@ -
- +
+ {{ sort.description || sort.enumCode }}
@@ -79,6 +79,16 @@ onMounted(() => { routingFilters.value = props.orderRoutingFilters ? JSON.parse(JSON.stringify(props.orderRoutingFilters)) : {} }) +function getOptions() { + if(props.conditionTypeEnumId === "ENTCT_FILTER") { + const excludeOptions = Object.values(enums.value[props.parentEnumId]).filter((enumeration: any) => enumeration.enumId.includes('_EXCLUDED')) + const includeOptions = Object.values(enums.value[props.parentEnumId]).filter((enumeration: any) => !enumeration.enumId.includes('_EXCLUDED')) + return segmentSelected.value === "excluded" ? excludeOptions : includeOptions + } + + return Object.values(enums.value[props.parentEnumId]) +} + function checkFilters() { areFiltersUpdated.value = false; areFiltersUpdated.value = Object.keys(routingFilters.value).some((options: string) => { @@ -125,7 +135,6 @@ function isSortOptionSelected(code: string) { } function closeModal(action = "close") { - console.log('routingFilters.value',routingFilters.value) modalController.dismiss({ dismissed: true, filters: routingFilters.value }, action) } From 4d5c54610462cb573f05b70b90e52eea815f4103 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Tue, 15 Oct 2024 14:23:45 +0530 Subject: [PATCH 6/7] Fixed: case when saving exclude options on server --- src/components/GroupActionsPopover.vue | 9 +-------- src/views/BrokeringQuery.vue | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/components/GroupActionsPopover.vue b/src/components/GroupActionsPopover.vue index 31dd116..88131b2 100644 --- a/src/components/GroupActionsPopover.vue +++ b/src/components/GroupActionsPopover.vue @@ -42,7 +42,6 @@ const props = defineProps(["group"]) const isOmsConnectionExist = computed(() => store.getters["util/isOmsConnectionExist"]) async function updateGroupStatus(paused: string) { - console.log(props.group) let routingGroups = []; const payload = { routingGroupId: props.group.routingGroupId, @@ -52,13 +51,7 @@ async function updateGroupStatus(paused: string) { try { const resp = await OrderRoutingService.scheduleBrokering(payload) - console.log('resp', resp, hasError(resp)) - if(!hasError(resp)){ - props.group.schedule = { - ...props.group.schedule, - cronExpression: payload.cronExpression, - cronDescription: - } + if(!hasError(resp)) { showToast(translate("Group status updated")) routingGroups = await store.dispatch("orderRouting/updateGroupStatus", { routingGroupId: props.group.routingGroupId, value: paused }) } else { diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index 51e7e03..2720023 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -933,7 +933,7 @@ function getSelectedValue(options: any, enumerations: any, parameter: string) { if(value?.length > 1) { return `${value.length} ${translate("selected")}` } else { - return parameter === "SHIPPING_METHOD" ? shippingMethods.value[value[0]]?.description || value[0] : parameter === "SALES_CHANNEL" ? enums.value["ORDER_SALES_CHANNEL"] ? enums.value["ORDER_SALES_CHANNEL"][value[0]]?.description : value[0] : parameter === "ORIGIN_FACILITY_GROUP" ? facilityGroups.value[value[0]]?.facilityGroupName || value[0] : facilities.value[value[0]]?.facilityName || value[0] + return parameter === "SHIPPING_METHOD" || parameter === "SHIPPING_METHOD_EXCLUDED" ? shippingMethods.value[value[0]]?.description || value[0] : parameter === "SALES_CHANNEL" || parameter === "SALES_CHANNEL_EXCLUDED" ? enums.value["ORDER_SALES_CHANNEL"] ? enums.value["ORDER_SALES_CHANNEL"][value[0]]?.description : value[0] : parameter === "ORIGIN_FACILITY_GROUP" || parameter === "ORIGIN_FACILITY_GROUP_EXCLUDED" ? facilityGroups.value[value[0]]?.facilityGroupName || value[0] : facilities.value[value[0]]?.facilityName || value[0] } } @@ -1010,7 +1010,6 @@ function updateOperator(event: CustomEvent) { } function updateOrderFilterValue(event: CustomEvent, id: string, multi = false) { - console.log('id', id) let value = event.detail.value let operator = id.includes("_EXCLUDED") ? "not-equals" : "equals" // When the filter has multiple selection support then we will receive an array in the event value and thus creating a string before updating the same as the fieldValue supports a string as value @@ -1341,6 +1340,19 @@ async function save() { const routeSortOptionsDiff = findSortDiff(initialOrderFilters["ENTCT_SORT_BY"] ? initialOrderFilters["ENTCT_SORT_BY"] : {}, orderRoutingSortOptions.value) const routeFilterOptionsDiff = findFilterDiff(initialOrderFilters["ENTCT_FILTER"] ? initialOrderFilters["ENTCT_FILTER"] : {}, orderRoutingFilterOptions.value) + // As we have explicitely added the options for exclude filter for inventory rules, we will remove the _excluded from the fieldName parameter before updating the same + Object.entries(routeFilterOptionsDiff.seqToRemove).map(([key, value]: any) => { + if(key.includes("_excluded")) { + value["fieldName"] = value["fieldName"].split("_")[0] + } + }) + + Object.entries(routeFilterOptionsDiff.seqToUpdate).map(([key, value]: any) => { + if(key.includes("_excluded")) { + value["fieldName"] = value["fieldName"].split("_")[0] + } + }) + const filtersToRemove = Object.values({ ...routeFilterOptionsDiff.seqToRemove, ...routeSortOptionsDiff.seqToRemove }) const filtersToUpdate = Object.values({ ...routeFilterOptionsDiff.seqToUpdate, ...routeSortOptionsDiff.seqToUpdate }) // Diff found for removing and updating filters From de64dc771b09dd6ff90a1189d111d27fcfa70f86 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Tue, 15 Oct 2024 15:03:09 +0530 Subject: [PATCH 7/7] Improved: locale file(#248) --- src/locales/en.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/locales/en.json b/src/locales/en.json index 027a8a7..f8614dd 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -47,6 +47,8 @@ "Edit": "Edit", "Enter a valid value": "Enter a valid value", "Error getting user profile": "Error getting user profile", + "Exclude": "Exclude", + "Excluded": "Excluded", "Execution history": "Execution history", "Expression": "Expression", "Facilities will be sorted based on creation date if no sorting preferences are applied.": "Facilities will be sorted based on creation date if no sorting preferences are applied.", @@ -75,6 +77,7 @@ "greater": "greater", "greater than or equal to": "greater than or equal to", "High": "High", + "Include": "Include", "Inventory Filters": "Inventory Filters", "Inventory rule created successfully": "Inventory rule created successfully", "Inventory Sort": "Inventory Sort",