fix conditions for batch run ui disabling (#29599)

## For #29595 

- Only depend on total filtered hosts count when selecting all hosts on
all pages


![ezgif-3acee2170765d3](https://github.com/user-attachments/assets/4581409f-b8d7-45cf-94a4-24826bc0aec0)

- [x] Manual QA for all new/changed functionality

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
jacobshandling
2025-05-29 13:06:21 -07:00
committed by GitHub
co-authored by Jacob Shandling
parent 9ba16421cc
commit b96ce7cdfd
@@ -1647,18 +1647,19 @@ const ManageHostsPage = ({
);
} else if (isAllTeamsSelected && isPremiumTier) {
disableRunScriptBatchTooltipContent = "Select a team to run a script";
} else if (runScriptBatchFilterNotSupported && isAllMatchingHostsSelected) {
disableRunScriptBatchTooltipContent =
"Choose different filters to run a script";
} else if (
// default to blocking until count API responds
!totalFilteredHostsCount ||
totalFilteredHostsCount > MAX_SCRIPT_BATCH_TARGETS
) {
disableRunScriptBatchTooltipContent =
"Target at most 5,000 hosts to run a script";
} else if (isAllMatchingHostsSelected) {
if (runScriptBatchFilterNotSupported) {
disableRunScriptBatchTooltipContent =
"Choose different filters to run a script";
} else if (
// default to blocking until count API responds
!totalFilteredHostsCount ||
totalFilteredHostsCount > MAX_SCRIPT_BATCH_TARGETS
) {
disableRunScriptBatchTooltipContent =
"Target at most 5,000 hosts to run a script";
}
}
const secondarySelectActions: IActionButtonProps[] = [
{
name: "run-script",