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

bug: Clear all button working with collection facet #11

Merged
merged 9 commits into from
Dec 10, 2019

Conversation

kabeaty
Copy link
Contributor

@kabeaty kabeaty commented Dec 3, 2019

What do these changes do/fix?

Previously, the root Clear all button for the SearchFacets component was not appearing when collectionFacets were selected, and it was also not clearing collectionFacets when it was clicked. These changes make it so that this Clear all button interacts with the collectionFacets component as it does the other facets components.

related to issues:
https://github.ibm.com/watson-discovery/disco-widgets/issues/427
https://github.ibm.com/watson-discovery/disco-widgets/issues/428

How do you test/verify these changes?

I added some tests for this interaction.
You can also test in the example app with a project that has collections. Select a collection and see that the Clear all button appears. Click the Clear all button and see that it deselects the collections that you selected.

Have you documented your changes (if necessary)?

I added comments to props that were added, and I also left a comment in the SearchFacets component regarding what we should change when Carbon MultiSelect offers more control over selection. I also opened a Carbon enhancement request here: carbon-design-system/carbon#4812.

Are there any breaking changes included in this pull request?

I don't believe so since new props are only being added to the CollectionFacets component, but not to the top-level SearchFacets component.

@@ -8,3 +8,5 @@ export const optionClass = `${baseClass}__facet__option`;
export const optionLabelClass = `${baseClass}__facet__option-label`;
export const singleSelectGroupClass = `${baseClass}__facet__single__select__group`;
export const labelAndSelectionContainerClass = `${baseClass}__facet__label-and-selection-container`;

export const collectionFacetIdPrefix = 'collection-facet-';
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure this is a css class, but no big deal

@maniax89 maniax89 changed the base branch from master to develop December 6, 2019 16:42
@maniax89 maniax89 merged commit 46fc3e8 into develop Dec 10, 2019
@maniax89 maniax89 deleted the bug/clear-all-collection-facet branch December 10, 2019 00:34
broulaye pushed a commit that referenced this pull request Jan 10, 2020
* Clear all button works with collection facets

* Refactor css classes in SearchFacets

* Add tests for clearAll button with collectionFacets

* Improve naming and add tests for multiple selected collections with clearAll

* Clean up double import from same file

* Update test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants