-
Notifications
You must be signed in to change notification settings - Fork 11
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
Added improved active filters, also made the filter functions globally available #587
Conversation
} | ||
|
||
|
||
if (Object.keys(swatches.value).includes(filterKey)) { |
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.
I removed the Color config @royduin . Every swatch can be used as a "active" filter now. Even though color filters are circles with the color as background. I think the label will suffice as "active filter" ( E.G. "Blue") as most webshops do this.
|
||
if ( | ||
Array.isArray(this.selectedValues[filterKey].value) && | ||
!['category', 'price', ...Object.keys(swatches.value)].includes(filterKey) |
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.
Can't we do something with early returns or a switch case so we don't have to specify this list here?
…to feature/selected-filters
|
||
computed: { | ||
activeFilters() { | ||
return Object.keys(this.selectedValues) |
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.
Tried to make it as short as possible now @royduin
@indykoning, what do you think? 😇 |
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.
LGTM, just one question 🙂
Currently Rapidez does not support other slider type filters than price, see; https://github.com/rapidez/core/blob/master/resources/views/listing/partials/filter/price.blade.php . I'll make an internal note for this to be developed. |
Do we need this in v2 or is just v3 fine? |
I think v3 is fine. |
This adds a new frontend for the active filtering. Sadly we need a Vue component for this to map out the active filtering as there's some irregularity's in there like our Category filter, price and color filter.
I also made the Vue filters globally available so we can use them outside of templates, like the
url()
method already was.This PR uses the colors added in #580