Skip to content

Commit

Permalink
Remove unnecessary label when no visible filters exist (#55838)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras authored Nov 3, 2023
1 parent bc5c49c commit c6bddbd
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions packages/edit-site/src/components/dataviews/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,24 @@ export default function Filters( { fields, view, onChangeView } ) {
} );
} );

return (
view.visibleFilters?.map( ( filterName ) => {
const filter = filterIndex[ filterName ];
return view.visibleFilters?.map( ( filterName ) => {
const filter = filterIndex[ filterName ];

if ( ! filter ) {
return null;
}
if ( ! filter ) {
return null;
}

if ( filter.type === 'enumeration' ) {
return (
<InFilter
key={ filterName }
filter={ filter }
view={ view }
onChangeView={ onChangeView }
/>
);
}
if ( filter.type === 'enumeration' ) {
return (
<InFilter
key={ filterName }
filter={ filter }
view={ view }
onChangeView={ onChangeView }
/>
);
}

return null;
} ) || __( 'No filters available' )
);
return null;
} );
}

1 comment on commit c6bddbd

@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 c6bddbd.
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/6744365990
📝 Reported issues:

Please sign in to comment.