Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.17] [Fleet] Fix disabling logic for "View Agents" button in agent activity (#202968) #203385

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

jillguyonnet
Copy link
Contributor

Backport

This will backport the following commits from main to 8.17:

Questions ?

Please refer to the Backport tool documentation

elastic#202968)

## Summary

I came across a small bug while testing Fleet agents activity: the "View
Agents" button is currently always disabled for agent policy changes.
This is because agent policy data has been modified to be fetched with
`noAgentCount: true` by default.

As getting the agent count involves a performance concern, this PR fixes
the logic that disables the "View Agents" button for policy change
actions instead. The behaviour is not as follows:
* For tag updates actions: button not showed (no change)
* For policy change actions
* If `action.nbAgentsActionCreated > 10000`: disable button and show
tooltip explaining why it's disabled
* Otherwise: enable button and show tooltip saying that these are the
agents _currently_ assigned to the policy (existing behaviour, known
limitation)
* For other types of actions (no change)
* If `action.nbAgentsActionCreated > 10000`: disable button and show
tooltip explaining why it's disabled
   * Otherwise: enable button, no tooltip

### Screenshots

![Screenshot 2024-12-05 at 10 56
40](https://github.com/user-attachments/assets/c5f4f868-cdac-4de7-a96d-f11afd803d87)

![Screenshot 2024-12-05 at 10 57
13](https://github.com/user-attachments/assets/91195e3a-4f5c-4a91-b9ff-ffb62818647f)

![Screenshot 2024-12-05 at 10 57
20](https://github.com/user-attachments/assets/9029b1b5-6983-4509-9b62-15e073546d42)

(cherry picked from commit 7caa339)

# Conflicts:
#	x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts
@jillguyonnet jillguyonnet enabled auto-merge (squash) December 9, 2024 10:31
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Dec 9, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 1.8MB 1.8MB -379.0B

cc @jillguyonnet

@jillguyonnet jillguyonnet requested a review from nchaulet December 9, 2024 14:33
@jillguyonnet jillguyonnet merged commit 1eccf45 into elastic:8.17 Dec 10, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants