[8.12] [Fleet] Allow back previously disabled bulk actions (#176485) (#176512)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[Fleet] Allow back previously disabled bulk actions
(#176485)](https://github.com/elastic/kibana/pull/176485)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Cristina
Amico","email":"criamico@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-02-08T14:59:23Z","message":"[Fleet]
Allow back previously disabled bulk actions (#176485)\n\nPatch for
https://github.com/elastic/kibana/issues/171914\r\n\r\n## Summary\r\nIn
https://github.com/elastic/kibana/pull/175318 I had disabled the
bulk\r\nactions when the count was incorrect (negative). This was not a
good\r\nidea, since some of those actions could still be applied
(like\r\nunenrolling) even if the shown count is not correct. Here I'm
removing\r\nthat check.\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"b62011026850bf968a90c403cae11c453c4e9130","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:prev-minor","v8.13.0"],"title":"[Fleet]
Allow back previously disabled bulk
actions","number":176485,"url":"https://github.com/elastic/kibana/pull/176485","mergeCommit":{"message":"[Fleet]
Allow back previously disabled bulk actions (#176485)\n\nPatch for
https://github.com/elastic/kibana/issues/171914\r\n\r\n## Summary\r\nIn
https://github.com/elastic/kibana/pull/175318 I had disabled the
bulk\r\nactions when the count was incorrect (negative). This was not a
good\r\nidea, since some of those actions could still be applied
(like\r\nunenrolling) even if the shown count is not correct. Here I'm
removing\r\nthat check.\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"b62011026850bf968a90c403cae11c453c4e9130"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/176485","number":176485,"mergeCommit":{"message":"[Fleet]
Allow back previously disabled bulk actions (#176485)\n\nPatch for
https://github.com/elastic/kibana/issues/171914\r\n\r\n## Summary\r\nIn
https://github.com/elastic/kibana/pull/175318 I had disabled the
bulk\r\nactions when the count was incorrect (negative). This was not a
good\r\nidea, since some of those actions could still be applied
(like\r\nunenrolling) even if the shown count is not correct. Here I'm
removing\r\nthat check.\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"b62011026850bf968a90c403cae11c453c4e9130"}}]}]
BACKPORT-->

Co-authored-by: Cristina Amico <criamico@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2024-02-08 11:17:36 -05:00 committed by GitHub
parent 9167e3cc7e
commit 014ef995ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -105,7 +105,7 @@ export const AgentBulkActions: React.FunctionComponent<Props> = ({
const atLeastOneActiveAgentSelected =
selectionMode === 'manual'
? !!selectedAgents.find((agent) => agent.active)
: agentCount > 0 && shownAgents > inactiveShownAgents;
: shownAgents > inactiveShownAgents;
const agents = selectionMode === 'manual' ? selectedAgents : selectionQuery;
const [tagsPopoverButton, setTagsPopoverButton] = useState<HTMLElement>();