Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [Fleet] Fix agents count in agent list table and add tooltip wi…
…th correct info (#197834) (#198002) # Backport This will backport the following commits from `main` to `8.x`: - [[Fleet] Fix agents count in agent list table and add tooltip with correct info (#197834)](#197834) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-28T14:00:00Z","message":"[Fleet] Fix agents count in agent list table and add tooltip with correct info (#197834)\n\nFixes https://github.com/elastic/kibana/issues/195441\r\n\r\n## Summary\r\nSelection agent count on agent list table gets incorrect when there are\r\nmultiple hosted agents, especially if they are on inactive state. In\r\nfact to calculate the selected number of agents we were getting hosted\r\nagents, but without taking into account the filtering applied on the\r\npage, i.e. we were always getting all the hosted agent (inactive too).\r\nThis caused the final calculation to be off. \r\n\r\nIn this PR I'm fixing [the\r\nquery](https://github.com/elastic/kibana/pull/197834/files#diff-9707a4b93a96749876e4cf173a0b39cd5a620e311e2652c5ed4b8670ca7e6becR309-R320)\r\nused to get those agents to take in account the filters and I'm also\r\nadding a small tooltip that breaks up the number of agents (selected,\r\ntotal, hosted)\r\n\r\n### Testing\r\n- Make sure to have many agents, hosted and not in different states\r\n(inactive, unenrolled)\r\n- To make a hosted agent inactive follow the steps explained\r\n[here](https://github.com/elastic/kibana/issues/195441)\r\n- Verify that the selection numbers are correct: select agents on all\r\npages and hover on the new tooltip shown besides the \"selected agents\".\r\nThis number should match the number shown on the actions dropdown\r\n\r\n\r\n### Screenshots\r\n<img width=\"2376\" alt=\"Screenshot 2024-10-25 at 17 00 44\"\r\nsrc=\"https://github.com/user-attachments/assets/81d2836a-f997-4ccb-a23c-3d2cfbfa62d3\">\r\n<img width=\"2409\" alt=\"Screenshot 2024-10-25 at 17 00 59\"\r\nsrc=\"https://github.com/user-attachments/assets/ba21933a-f1e6-457e-8059-e87b3e29a7d1\">\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c153c491-29a1-481c-a3e3-25bab6412963\r\n\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\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\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"079e929a1cfaac103dea4e301c9b697e561ffd17","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-minor"],"title":"[Fleet] Fix agents count in agent list table and add tooltip with correct info","number":197834,"url":"https://github.com/elastic/kibana/pull/197834","mergeCommit":{"message":"[Fleet] Fix agents count in agent list table and add tooltip with correct info (#197834)\n\nFixes https://github.com/elastic/kibana/issues/195441\r\n\r\n## Summary\r\nSelection agent count on agent list table gets incorrect when there are\r\nmultiple hosted agents, especially if they are on inactive state. In\r\nfact to calculate the selected number of agents we were getting hosted\r\nagents, but without taking into account the filtering applied on the\r\npage, i.e. we were always getting all the hosted agent (inactive too).\r\nThis caused the final calculation to be off. \r\n\r\nIn this PR I'm fixing [the\r\nquery](https://github.com/elastic/kibana/pull/197834/files#diff-9707a4b93a96749876e4cf173a0b39cd5a620e311e2652c5ed4b8670ca7e6becR309-R320)\r\nused to get those agents to take in account the filters and I'm also\r\nadding a small tooltip that breaks up the number of agents (selected,\r\ntotal, hosted)\r\n\r\n### Testing\r\n- Make sure to have many agents, hosted and not in different states\r\n(inactive, unenrolled)\r\n- To make a hosted agent inactive follow the steps explained\r\n[here](https://github.com/elastic/kibana/issues/195441)\r\n- Verify that the selection numbers are correct: select agents on all\r\npages and hover on the new tooltip shown besides the \"selected agents\".\r\nThis number should match the number shown on the actions dropdown\r\n\r\n\r\n### Screenshots\r\n<img width=\"2376\" alt=\"Screenshot 2024-10-25 at 17 00 44\"\r\nsrc=\"https://github.com/user-attachments/assets/81d2836a-f997-4ccb-a23c-3d2cfbfa62d3\">\r\n<img width=\"2409\" alt=\"Screenshot 2024-10-25 at 17 00 59\"\r\nsrc=\"https://github.com/user-attachments/assets/ba21933a-f1e6-457e-8059-e87b3e29a7d1\">\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c153c491-29a1-481c-a3e3-25bab6412963\r\n\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\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\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"079e929a1cfaac103dea4e301c9b697e561ffd17"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197834","number":197834,"mergeCommit":{"message":"[Fleet] Fix agents count in agent list table and add tooltip with correct info (#197834)\n\nFixes https://github.com/elastic/kibana/issues/195441\r\n\r\n## Summary\r\nSelection agent count on agent list table gets incorrect when there are\r\nmultiple hosted agents, especially if they are on inactive state. In\r\nfact to calculate the selected number of agents we were getting hosted\r\nagents, but without taking into account the filtering applied on the\r\npage, i.e. we were always getting all the hosted agent (inactive too).\r\nThis caused the final calculation to be off. \r\n\r\nIn this PR I'm fixing [the\r\nquery](https://github.com/elastic/kibana/pull/197834/files#diff-9707a4b93a96749876e4cf173a0b39cd5a620e311e2652c5ed4b8670ca7e6becR309-R320)\r\nused to get those agents to take in account the filters and I'm also\r\nadding a small tooltip that breaks up the number of agents (selected,\r\ntotal, hosted)\r\n\r\n### Testing\r\n- Make sure to have many agents, hosted and not in different states\r\n(inactive, unenrolled)\r\n- To make a hosted agent inactive follow the steps explained\r\n[here](https://github.com/elastic/kibana/issues/195441)\r\n- Verify that the selection numbers are correct: select agents on all\r\npages and hover on the new tooltip shown besides the \"selected agents\".\r\nThis number should match the number shown on the actions dropdown\r\n\r\n\r\n### Screenshots\r\n<img width=\"2376\" alt=\"Screenshot 2024-10-25 at 17 00 44\"\r\nsrc=\"https://github.com/user-attachments/assets/81d2836a-f997-4ccb-a23c-3d2cfbfa62d3\">\r\n<img width=\"2409\" alt=\"Screenshot 2024-10-25 at 17 00 59\"\r\nsrc=\"https://github.com/user-attachments/assets/ba21933a-f1e6-457e-8059-e87b3e29a7d1\">\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c153c491-29a1-481c-a3e3-25bab6412963\r\n\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\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\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"079e929a1cfaac103dea4e301c9b697e561ffd17"}}]}] BACKPORT--> Co-authored-by: Cristina Amico <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information