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

fix(frontend): hidding logic wasn't working for hierachicalFacets panel #209

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

sbellone
Copy link
Collaborator

@sbellone sbellone commented Dec 5, 2024

InstantSearch panel permits to implement a hidden function to determine if the panel should be hidden (doc).

It wasn't working for hierarchicalFacets, and a workaround had been done in #146 to try to replicate the logic.
The problem is that when the panel is hidden by this hack, if the selected filters are reset, it's not becoming visible anymore.

Changes

  • fix the hidden function: the hierarchicalFacets are always present in options.results.hierarchicalFacets. But when there are no results matching, the data field is null. Checking the presence of data fixes the behaviour
  • remove the buggy workaround

How to test

  • Index records with the newArrivalsCategory attribute
  • Select a category without new arrivals: Men > Accessories > Gloves. The New Arrivals panel disappears
  • Select a category with new arrivals: The panel reappears

SFCC-410

@sbellone sbellone self-assigned this Dec 5, 2024
@sbellone sbellone requested a review from htuzel December 5, 2024 16:47
@sbellone sbellone merged commit 9973065 into develop Dec 9, 2024
5 checks passed
@sbellone sbellone deleted the fix/hidden-hierachical-panel branch December 9, 2024 13:47
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.

2 participants