Farfetch / blackout

Blackout is the codename for the Farfetch Platform Solutions (FPS) projects. Useful to build e-commerce applications using the FPS APIs and integrating business logic.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

Screenshot_20220509_130318

Steps to reproduce

  1. Access https://preview-sacai.blackandwhite-ff.com/en-pt/shopping/women?sizes=20&contextfilters=categories:144307&pageindex=1
  2. Open the filters panel through the Refine button on the right hand side
  3. 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

Redux state snapshots:
Screenshot_20220509_154218
Screenshot_20220509_154052

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.