feat(DataViewFilters): add category group clear button to checkbox an…#688
Open
aloktomarr wants to merge 1 commit into
Open
feat(DataViewFilters): add category group clear button to checkbox an…#688aloktomarr wants to merge 1 commit into
aloktomarr wants to merge 1 commit into
Conversation
…d text filters Add the deleteLabelGroup action to DataViewCheckboxFilter and DataViewTextFilter so each filter category exposes a group-level clear button in the toolbar, matching the existing DataViewTreeFilter behaviour. Fixes patternfly#646
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This adds the category level clear button to
DataViewCheckboxFilterandDataViewTextFilter. Both filters now render the group close button on their toolbar chips, the same wayDataViewTreeFilteralready does through itsdeleteLabelGroupaction.Why
Issue #646 points out that the tree filter shows an extra button on its chip group that clears the whole category at once, while the checkbox and text filters do not. That makes the filter set feel inconsistent. Wiring up
deleteLabelGroupon the two remaining filters brings them in line so every DataView filter behaves the same way.How
For the checkbox filter the group clear resets the selection to an empty array. For the text filter it resets the value to an empty string, which is what the existing single chip delete already does.
One thing worth a maintainer eye
The text filter only ever holds a single value, so its group clear is functionally the same as deleting its one chip. I included it anyway for the consistency the issue asks for, but I am happy to scope it back to the multi value filters only if you would rather keep the group button meaningful.
Testing
Added a test to each filter that renders it with values, checks the group clear button is present, clicks it, and asserts
onChangefires with the cleared value. Updated the two render snapshots to include the new button markup. Full suite passes (78 tests), eslint and tsc are clean.Fixes #646