mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Fleet UI: Hide host software filters when no software + no filters applied (#23519)
This commit is contained in:
parent
441661db2c
commit
2d2aa24466
1 changed files with 9 additions and 2 deletions
|
|
@ -207,6 +207,13 @@ const HostSoftwareTable = ({
|
|||
);
|
||||
}, [hostSoftwareFilter, platform, searchQuery]);
|
||||
|
||||
// Determines if a user should be able to filter or search in the table
|
||||
const hasData = data && data.software.length > 0;
|
||||
const hasQuery = searchQuery !== "";
|
||||
const hasSoftwareFilter = hostSoftwareFilter !== "allSoftware";
|
||||
|
||||
const showFilterHeaders = hasData || hasQuery || hasSoftwareFilter;
|
||||
|
||||
return (
|
||||
<div className={baseClass}>
|
||||
<TableContainer
|
||||
|
|
@ -223,10 +230,10 @@ const HostSoftwareTable = ({
|
|||
inputPlaceHolder="Search by name"
|
||||
onQueryChange={onQueryChange}
|
||||
emptyComponent={memoizedEmptyComponent}
|
||||
customControl={memoizedFilterDropdown}
|
||||
customControl={showFilterHeaders ? memoizedFilterDropdown : undefined}
|
||||
showMarkAllPages={false}
|
||||
isAllPagesSelected={false}
|
||||
searchable
|
||||
searchable={showFilterHeaders}
|
||||
manualSortBy
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue