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

Added improved active filters, also made the filter functions globally available #587

Merged
merged 16 commits into from
Oct 24, 2024

Conversation

BobWez98
Copy link
Collaborator

@BobWez98 BobWez98 commented Oct 7, 2024

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

}


if (Object.keys(swatches.value).includes(filterKey)) {
Copy link
Collaborator Author

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.

@BobWez98 BobWez98 requested a review from royduin October 8, 2024 13:53

if (
Array.isArray(this.selectedValues[filterKey].value) &&
!['category', 'price', ...Object.keys(swatches.value)].includes(filterKey)
Copy link
Member

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?

@BobWez98 BobWez98 requested a review from royduin October 17, 2024 12:41

computed: {
activeFilters() {
return Object.keys(this.selectedValues)
Copy link
Collaborator Author

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

@royduin
Copy link
Member

royduin commented Oct 23, 2024

@indykoning, what do you think? 😇

Copy link
Member

@indykoning indykoning left a 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 🙂

@BobWez98
Copy link
Collaborator Author

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.

@royduin
Copy link
Member

royduin commented Oct 24, 2024

Do we need this in v2 or is just v3 fine?

@BobWez98
Copy link
Collaborator Author

I think v3 is fine.

@royduin royduin merged commit 00e56d3 into master Oct 24, 2024
14 checks passed
@royduin royduin deleted the feature/selected-filters branch October 24, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants