Skip to content

Commit

Permalink
DataViews: hide filter toggle if there are no filters (#64640)
Browse files Browse the repository at this point in the history
Unlinked contributors: raj.patel@rtcamp.com.

Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: imrraaj <imrraaj@git.wordpress.org>
Co-authored-by: juanmaguitar <juanmaguitar@git.wordpress.org>
  • Loading branch information
4 people authored Aug 21, 2024
1 parent 22e9896 commit f971fbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/dataviews/src/components/dataviews-filters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ export function FilterVisibilityToggle( {
const visibleFilters = filters.filter( ( filter ) => filter.isVisible );

const hasVisibleFilters = !! visibleFilters.length;
if ( filters.length === 0 ) {
return null;
}
if ( ! hasVisibleFilters ) {
return (
<AddFilterDropdownMenu
Expand Down

1 comment on commit f971fbf

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in f971fbf.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10486226987
📝 Reported issues:

Please sign in to comment.