Skip to content

Commit

Permalink
Merge pull request #81 from ymaheshwari1/#68
Browse files Browse the repository at this point in the history
Improved: UI to display the message when promise date filter is selected(#68)
  • Loading branch information
ymaheshwari1 authored Feb 14, 2024
2 parents 9965926 + 734f41a commit 3586a4d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"Order Rule Filters": "Order Rule Filters",
"Order Rule Sort": "Order Rule Sort",
"operator": "operator",
"Partial allocation cannot be disabled. Orders are filtered by item when filtering by promise date.": "Partial allocation cannot be disabled. Orders are filtered by item when filtering by promise date.",
"Partially available": "Partially available",
"Passed duration": "Passed duration",
"Password": "Password",
Expand Down
20 changes: 8 additions & 12 deletions src/views/BrokeringQuery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,13 @@
{{ translate("Select if partial allocation should be allowed in this inventory rule") }}
</ion-card-content>
<ion-item lines="none">
<ion-toggle :disabled="isPromiseDateFilterApplied()" :checked="selectedRoutingRule.assignmentEnumId === 'ORA_MULTI'" @ionChange="updatePartialAllocation($event.detail.checked)">{{ translate("Allow partial allocation") }}</ion-toggle>
<!-- When selecting promiseDate route filter we will show the partial allocation option as checked on UI, but will not update its value on backend. Discussed with Aditya Sir -->
<ion-toggle :disabled="isPromiseDateFilterApplied()" :checked="selectedRoutingRule.assignmentEnumId === 'ORA_MULTI' || isPromiseDateFilterApplied()" @ionChange="updatePartialAllocation($event.detail.checked)">{{ translate("Allow partial allocation") }}</ion-toggle>
</ion-item>
<ion-item v-show="isPromiseDateFilterApplied()" lines="none">
<ion-label class="ion-text-wrap">
<p>{{ translate("Partial allocation cannot be disabled. Orders are filtered by item when filtering by promise date.") }}</p>
</ion-label>
</ion-item>
</ion-card>
<ion-card>
Expand Down Expand Up @@ -618,18 +624,8 @@ 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")
// When promise date range is selected for order filter, we will revert any change made to the partialAllocation enum and will change it to its initial value and will disable the partial allocation feature
if(filter?.fieldValue || filter?.fieldValue == 0) {
const assignmentEnumId = JSON.parse(JSON.stringify(currentRouting.value["rules"])).find((rule: any) => rule.routingRuleId === selectedRoutingRule.value.routingRuleId)?.assignmentEnumId
inventoryRules.value.find((inventoryRule: any) => {
if(inventoryRule.routingRuleId === selectedRoutingRule.value.routingRuleId) {
inventoryRule.assignmentEnumId = assignmentEnumId
return true;
}
})
}
return filter?.fieldValue || filter?.fieldValue == 0
}
Expand Down

0 comments on commit 3586a4d

Please sign in to comment.