Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Fix: Compute canRefine on the transformed items #1568

Merged
merged 3 commits into from
Sep 26, 2018
Merged

Conversation

ltk
Copy link
Contributor

@ltk ltk commented Sep 10, 2018

Resolves #1524

Summary
There was previously a bug where canRefine props were calculated based on untransformed item lists. This caused unintended behaviors such as a ClearRefinements button remaining active when a refinement being ignored via a filter in transformItems was present.

Result
This PR calculates canRefine on the transformed list of items, correcting this behavior.

@algobot
Copy link
Contributor

algobot commented Sep 10, 2018

Deploy preview for react-instantsearch ready!

Built with commit 111eb18

https://deploy-preview-1568--react-instantsearch.netlify.com

Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Collaborator

@samouss samouss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes and sorry for the late review. We can add a test on each of the connectors to verify that the canRefine is actually computed on the correct transformed value. Let me know if you have the time to implement it.

@ltk
Copy link
Contributor Author

ltk commented Sep 17, 2018

@samouss yep, I can add those tests in the next couple of days.

@ltk
Copy link
Contributor Author

ltk commented Sep 24, 2018

@samouss, better late than never :-). Just pushed up those new tests.

@samouss
Copy link
Collaborator

samouss commented Sep 25, 2018

One last change and we are ready to merge! You have to run Prettier to fix the style issue. Thanks a lot for your contributions!

@samouss samouss merged commit c95384f into algolia:master Sep 26, 2018
samouss added a commit that referenced this pull request Sep 26, 2018
<a name="5.3.1"></a>
## [5.3.1](v5.3.0...v5.3.1) (2018-09-26)

### Bug Fixes

* **connector:** ensure canRefine is computed on the transformed items ([#1568](#1568)) ([c95384f](c95384f))
* **toggle:** ensure facet is present ([#1613](#1613)) ([e914ff6](e914ff6))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants