Skip to content

Commit

Permalink
Merge pull request #277 from ymaheshwari1/#269
Browse files Browse the repository at this point in the history
Fixed: rule name not being updated(#269)
  • Loading branch information
ymaheshwari1 authored Nov 6, 2024
2 parents 89c281a + 89fb3a9 commit a3d66ed
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"Failed to fetch sort options": "Failed to fetch sort options",
"Failed to update group information": "Failed to update group information",
"Failed to update group status": "Failed to update group status",
"Failed to update rule information": "Failed to update rule information",
"Failed to schedule service": "Failed to schedule service",
"Fetching filters and inventory rules": "Fetching filters and inventory rules",
"Fetching runs": "Fetching runs",
Expand Down Expand Up @@ -114,6 +115,7 @@
"Order priority": "Order priority",
"Order Rule Filters": "Order Rule Filters",
"Order Rule Sort": "Order Rule Sort",
"Order rule information updated": "Order rule information updated",
"Order routing information updated": "Order routing information updated",
"Orders will be brokered based on order date if no sorting is specified.": "Orders will be brokered based on order date if no sorting is specified.",
"Origin Facility Group": "Origin Facility Group",
Expand Down
32 changes: 26 additions & 6 deletions src/views/BrokeringQuery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,9 @@ async function addInventoryRule() {
function isFacilityGroupSelected(facilityGroupId: string, type: string) {
if(type === "excluded") {
return facilityGroupId == getFilterValue(inventoryRuleFilterOptions.value, conditionFilterEnums, 'FACILITY_GROUP').fieldValue
return facilityGroupId == getFilterValue(inventoryRuleFilterOptions.value, conditionFilterEnums, 'FACILITY_GROUP')?.fieldValue
} else {
return facilityGroupId == getFilterValue(inventoryRuleFilterOptions.value, conditionFilterEnums, 'FACILITY_GROUP_EXCLUDED').fieldValue
return facilityGroupId == getFilterValue(inventoryRuleFilterOptions.value, conditionFilterEnums, 'FACILITY_GROUP_EXCLUDED')?.fieldValue
}
}
Expand Down Expand Up @@ -1076,14 +1076,34 @@ async function editRuleName() {
ruleNameRef.value.$el.setFocus();
}
function updateRuleName(routingRuleId: string) {
// Checking the updated name with the original object, as we have reference to inventoryRules that will also gets updated on updating selectedRoutingRule
async function updateRuleName(routingRuleId: string) {
let isUpdateRequired = false;
currentRouting.value["rules"].map((inventoryRule: any) => {
if(inventoryRule.routingRuleId === routingRuleId && inventoryRule.ruleName.trim() !== selectedRoutingRule.value.ruleName.trim()) {
hasUnsavedChanges.value = true
isUpdateRequired = true
}
})
isRuleNameUpdating.value = false;
if(isUpdateRequired) {
emitter.emit("presentLoader", { message: "Updating...", backdropDismiss: false })
let ruleId = await store.dispatch("orderRouting/updateRule", {
routingRuleId,
orderRoutingId: props.orderRoutingId,
ruleName: selectedRoutingRule.value.ruleName.trim()
})
if(ruleId) {
showToast(translate("Order rule information updated"))
} else {
showToast(translate("Failed to update rule information"))
}
emitter.emit("dismissLoader")
}
isRuleNameUpdating.value = false
}
async function cloneRule() {

Check warning on line 1109 in src/views/BrokeringQuery.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / build_and_deploy

'cloneRule' is defined but never used

Check warning on line 1109 in src/views/BrokeringQuery.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'cloneRule' is defined but never used

Check warning on line 1109 in src/views/BrokeringQuery.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'cloneRule' is defined but never used
Expand Down

0 comments on commit a3d66ed

Please sign in to comment.