Skip to content

feat(DataViewFilters): add category group clear button to checkbox an…#688

Open
aloktomarr wants to merge 1 commit into
patternfly:mainfrom
aloktomarr:fix/data-view-filters-delete-label-group-646
Open

feat(DataViewFilters): add category group clear button to checkbox an…#688
aloktomarr wants to merge 1 commit into
patternfly:mainfrom
aloktomarr:fix/data-view-filters-delete-label-group-646

Conversation

@aloktomarr

Copy link
Copy Markdown

What

This adds the category level clear button to DataViewCheckboxFilter and DataViewTextFilter. Both filters now render the group close button on their toolbar chips, the same way DataViewTreeFilter already does through its deleteLabelGroup action.

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 deleteLabelGroup on 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 onChange fires 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

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consistency: Add chip toolbar buttons to all DataView filters to match TreeViewFilter

1 participant