Skip to content

Commit

Permalink
Fixed: issue to not display the duplicate options in exclude and incl…
Browse files Browse the repository at this point in the history
…ude section(#248)
  • Loading branch information
ymaheshwari1 committed Oct 15, 2024
1 parent 219b0ea commit 1cce8e7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/components/AddOrderRouteFilterOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
</div>
<ion-list v-else>
<!-- Added this div as we need to hide ProductCategory option from filters, need to remove this once we add support for ProductCategory filter-->
<div v-for="sort in Object.values(enums[props.parentEnumId])" :key="sort.enumId">
<ion-item v-if="sort.enumId !== 'OIP_PROD_CATEGORY'">
<div v-for="sort in getOptions()" :key="sort.enumId">
<ion-item v-if="sort.enumId !== 'OIP_PROD_CATEGORY' && sort.enumId !== 'OIP_PROD_CATEGORY_EXCLUDED'">
<ion-checkbox :checked="isSortOptionSelected(sort.enumCode)" @ionChange="addSortOption(sort)">{{ sort.description || sort.enumCode }}</ion-checkbox>
</ion-item>
</div>
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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)
}
</script>

0 comments on commit 1cce8e7

Please sign in to comment.