Sizes facet naming change doesn't match `filterSegments` in listing results
desktp opened this issue · comments
Expected behavior
To get the sizes
facet on searchResults
correctly filled.
Actual behavior
The changes introduced in 1.52.1 related to the naming of the sizes facet, which solved the issue of not discerning from which category that size is, also introduced a problem when getting the search results, because now none of the sizes match, as that info doesn't come correctly filled from the backend either:
Steps to reproduce
- Access https://preview-sacai.blackandwhite-ff.com/en-pt/shopping/women?sizes=20&contextfilters=categories:144307&pageindex=1
- Open the filters panel through the
Refine
button on the right hand side - Check as the pill reads
common.filters.facets.sizes.null
Context/environment
@farfetch/blackout-core
:1.55.0
@farfetch/blackout-react
:0.35.0
Additional information
Possible fix
Best case scenario would be actually receiving the proper information from the backend so that the lib can map the facets properly. If that isn't possible, having a fallback when parsing the filter segments so that we don't get undefined
/null
values on the description and/or slug.
Having the information from the backend it's not possible here; I'll open a PR adding the facetId
to the filterSegments
instead 🙂
With it, you can map directly the filter segment with the respective facet entity.
Also added the description
from the facet, I think this is what you needed for your use case.