Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved: UI to display the message when promise date filter is selected(#68) #81

Merged
merged 4 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading