-
Notifications
You must be signed in to change notification settings - Fork 21
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
Implemented: logic to use filters modal for selecting or removing a filter and removed faceting logic(#29wm19n) #50
Conversation
ymaheshwari1
commented
May 6, 2022
•
edited
Loading
edited
- Bind the search filter modal with the add button on the search product page
- Made the options in the modal dynamic on the basis of search query in the modal
- Removed logic to get the facets from solr-query on initial page load
- Created state for storing the query and action to update the query
- Created state for storing the filters and action, mutations for updating the filters
- Improved logic to define infinite scroll.
- Implemented functionality to clear filters and reset filters
…ayed the options in the modal(#29wm19n)
…lr and defined state to store the applied filters(#29wm19n)
…d filters(#29wm19n)
…update the solr query(#29wm19n)
…another type or not(#29wm19n)
…e it when fetching or applying the filters(#29wm19n)
…ove some unwanted code(#29wm19n)
…get the query, removed some unwanted console statements and updated logic to prepare the query when having empty query string(#29wm19n)
…c to check if the current value is in another type(#29wm19n)
…clear all button(#29wm19n)
dispatch('updateQuery') | ||
}, | ||
|
||
async updateQuery({ commit, dispatch, state }, payload) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could implement a method to prepare query and have only 2 actions update filter & get products. Could be a separate task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure Sir, will handle this in another PR, created a ticket for the same.
src/store/modules/product/actions.ts
Outdated
// done this as for now not creating a separate mutation for this or updating current mutation logic | ||
// as per this functionality | ||
// TODO: update this logic to simply update the filters state | ||
Object.keys(appliedFilters).map((id: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could have a single mutation to reset all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defined a single mutation to reset the filter.
src/views/SelectProduct.vue
Outdated
totalSKUs: this.products.total.variant | ||
} | ||
}) | ||
|
||
saveThresholdModal.present(); | ||
}, | ||
async openSearchModal(label: string, facetToSelect: string, searchfield: string, type: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async openSearchModal(label: string, facetToSelect: string, searchfield: string, type: string) { | |
async searchFilter(label: string, facetToSelect: string, searchfield: string, type: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done Sir
…en updating the filters(#29wm19n)
…ring it, and improved the variable name(#29wm19n)