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

[Fleet] Agent List: Inform users when agents have become inactive since last page view #149226

Merged
merged 7 commits into from Jan 19, 2023

Conversation

hop-dev
Copy link
Contributor

@hop-dev hop-dev commented Jan 19, 2023

Summary

Closes #148285

When agents have become inactive since the user last viewed the agents, display a tour popover showing them how/where to apply filters to view them.

The tour popover is only displayed once, once the user clicks the agent status filters it is hidden, and we store in local storage to keep it hidden in the future.

Local storage is used to track the last number of inactive agents the user saw.

Screenshot 2023-01-19 at 14 20 16

Screenshot 2023-01-19 at 14 20 21

###Testing

Note: to reset the popover state to not having been viewied, in dev tools console run:

localStorage.removeItem("fleet.inactiveAgentsCalloutHasBeenDismissed")

for dev testing the createAgents script is very handy:

node scripts/create_agents --count 100  --kibana http://127.0.0.1:5601/mark --status inactive --inactivityTimeout 360 --delete

Test steos:

  • make an agent go to the inactive state
  • navigate to the agent list page
  • the tour popover should be shown
  • clicking the status filter should hide the tour popover
  • the inactive status should have a badge with 1 in it
  • refresh the page
  • the tour should not show
  • click the inactive status filter
  • the badge should disappear
  • make another agent inactive
  • refresh the page
  • the badge should be back with "1" in

@@ -0,0 +1,202 @@
/*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved the agent status filter to its own component as it has got a bit more complex

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing it!

@hop-dev
Copy link
Contributor Author

hop-dev commented Jan 19, 2023

@elasticmachine merge upstream

@hop-dev hop-dev self-assigned this Jan 19, 2023
@hop-dev hop-dev added release_note:enhancement Team:Fleet Team label for Observability Data Collection Fleet team labels Jan 19, 2023
@hop-dev hop-dev marked this pull request as ready for review January 19, 2023 16:34
@hop-dev hop-dev requested a review from a team as a code owner January 19, 2023 16:34
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Contributor

@criamico criamico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested locally and works well. LGTM 🚢

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
fleet 762 765 +3

Async chunks

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

id before after diff
fleet 915.8KB 917.6KB +1.7KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @hop-dev

@hop-dev hop-dev merged commit 7bc9b8d into elastic:main Jan 19, 2023
@hop-dev hop-dev deleted the 148285-notify-inactive-agents branch January 19, 2023 17:59
@kibanamachine kibanamachine added v8.7.0 backport:skip This commit does not require backporting labels Jan 19, 2023
adcoelho pushed a commit to adcoelho/kibana that referenced this pull request Jan 23, 2023
criamico added a commit that referenced this pull request Feb 19, 2024
Fixes #176124

## Summary
The [inactive popover](#149226)
that appears the first time after agents become inactive was broken
(probably because of a EUi upgrade) and wasn't dismissable anymore.

I'm adding a footer with button that makes it easily dismissable.

![Screenshot 2024-02-14 at 16 15
36](https://github.com/elastic/kibana/assets/16084106/b4029aa2-e0f7-42d4-afe1-e810b7e88d23)

### Testing 
- In dev tools console, run the following. This removes from the local
storage the key that signals that the tour was already ran once.
```
  localStorage.removeItem("fleet.inactiveAgentsCalloutHasBeenDismissed")
```
- Enroll some agents and wait that at least one becomes inactive
- The popover should be visible and it should be possible to dismiss it
by clicking "got it".

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 19, 2024
Fixes elastic#176124

## Summary
The [inactive popover](elastic#149226)
that appears the first time after agents become inactive was broken
(probably because of a EUi upgrade) and wasn't dismissable anymore.

I'm adding a footer with button that makes it easily dismissable.

![Screenshot 2024-02-14 at 16 15
36](https://github.com/elastic/kibana/assets/16084106/b4029aa2-e0f7-42d4-afe1-e810b7e88d23)

### Testing
- In dev tools console, run the following. This removes from the local
storage the key that signals that the tour was already ran once.
```
  localStorage.removeItem("fleet.inactiveAgentsCalloutHasBeenDismissed")
```
- Enroll some agents and wait that at least one becomes inactive
- The popover should be visible and it should be possible to dismiss it
by clicking "got it".

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 851657c)
criamico added a commit to criamico/kibana that referenced this pull request Feb 19, 2024
Fixes elastic#176124

## Summary
The [inactive popover](elastic#149226)
that appears the first time after agents become inactive was broken
(probably because of a EUi upgrade) and wasn't dismissable anymore.

I'm adding a footer with button that makes it easily dismissable.

![Screenshot 2024-02-14 at 16 15
36](https://github.com/elastic/kibana/assets/16084106/b4029aa2-e0f7-42d4-afe1-e810b7e88d23)

### Testing
- In dev tools console, run the following. This removes from the local
storage the key that signals that the tour was already ran once.
```
  localStorage.removeItem("fleet.inactiveAgentsCalloutHasBeenDismissed")
```
- Enroll some agents and wait that at least one becomes inactive
- The popover should be visible and it should be possible to dismiss it
by clicking "got it".

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 851657c)

# Conflicts:
#	x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_status_filter.tsx
awahab07 pushed a commit to awahab07/kibana that referenced this pull request Feb 19, 2024
Fixes elastic#176124

## Summary
The [inactive popover](elastic#149226)
that appears the first time after agents become inactive was broken
(probably because of a EUi upgrade) and wasn't dismissable anymore.

I'm adding a footer with button that makes it easily dismissable.

![Screenshot 2024-02-14 at 16 15
36](https://github.com/elastic/kibana/assets/16084106/b4029aa2-e0f7-42d4-afe1-e810b7e88d23)

### Testing 
- In dev tools console, run the following. This removes from the local
storage the key that signals that the tour was already ran once.
```
  localStorage.removeItem("fleet.inactiveAgentsCalloutHasBeenDismissed")
```
- Enroll some agents and wait that at least one becomes inactive
- The popover should be visible and it should be possible to dismiss it
by clicking "got it".

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
criamico added a commit that referenced this pull request Feb 20, 2024
…7172)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[Fleet] Fix inactive popover tour not resetting
(#176929)](#176929)

<!--- Backport version: 8.9.8 -->

### 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-19T10:25:20Z","message":"[Fleet]
Fix inactive popover tour not resetting (#176929)\n\nFixes
#176124 Summary\r\nThe
[inactive
popover](#149226 appears
the first time after agents become inactive was broken\r\n(probably
because of a EUi upgrade) and wasn't dismissable anymore.\r\n\r\nI'm
adding a footer with button that makes it easily
dismissable.\r\n\r\n![Screenshot 2024-02-14 at 16
15\r\n36](https://github.com/elastic/kibana/assets/16084106/b4029aa2-e0f7-42d4-afe1-e810b7e88d23)\r\n\r\n###
Testing \r\n- In dev tools console, run the following. This removes from
the local\r\nstorage the key that signals that the tour was already ran
once.\r\n```\r\n
localStorage.removeItem(\"fleet.inactiveAgentsCalloutHasBeenDismissed\")\r\n```\r\n-
Enroll some agents and wait that at least one becomes inactive\r\n- The
popover should be visible and it should be possible to dismiss it\r\nby
clicking \"got it\".\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"851657c6f9fd0113f3a5900c100ce0f3e151841f","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","v8.13.0","v8.12.2","v8.14.0"],"number":176929,"url":"#176929
Fix inactive popover tour not resetting (#176929)\n\nFixes
#176124 Summary\r\nThe
[inactive
popover](#149226 appears
the first time after agents become inactive was broken\r\n(probably
because of a EUi upgrade) and wasn't dismissable anymore.\r\n\r\nI'm
adding a footer with button that makes it easily
dismissable.\r\n\r\n![Screenshot 2024-02-14 at 16
15\r\n36](https://github.com/elastic/kibana/assets/16084106/b4029aa2-e0f7-42d4-afe1-e810b7e88d23)\r\n\r\n###
Testing \r\n- In dev tools console, run the following. This removes from
the local\r\nstorage the key that signals that the tour was already ran
once.\r\n```\r\n
localStorage.removeItem(\"fleet.inactiveAgentsCalloutHasBeenDismissed\")\r\n```\r\n-
Enroll some agents and wait that at least one becomes inactive\r\n- The
popover should be visible and it should be possible to dismiss it\r\nby
clicking \"got it\".\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"851657c6f9fd0113f3a5900c100ce0f3e151841f"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"#177161
Fix inactive popover tour not resetting (#176929)\n\nFixes
#176124 Summary\r\nThe
[inactive
popover](#149226 appears
the first time after agents become inactive was broken\r\n(probably
because of a EUi upgrade) and wasn't dismissable anymore.\r\n\r\nI'm
adding a footer with button that makes it easily
dismissable.\r\n\r\n![Screenshot 2024-02-14 at 16
15\r\n36](https://github.com/elastic/kibana/assets/16084106/b4029aa2-e0f7-42d4-afe1-e810b7e88d23)\r\n\r\n###
Testing \r\n- In dev tools console, run the following. This removes from
the local\r\nstorage the key that signals that the tour was already ran
once.\r\n```\r\n
localStorage.removeItem(\"fleet.inactiveAgentsCalloutHasBeenDismissed\")\r\n```\r\n-
Enroll some agents and wait that at least one becomes inactive\r\n- The
popover should be visible and it should be possible to dismiss it\r\nby
clicking \"got it\".\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"851657c6f9fd0113f3a5900c100ce0f3e151841f"}}]}]
BACKPORT-->
kibanamachine added a commit that referenced this pull request Feb 21, 2024
…7161)

# Backport

This will backport the following commits from `main` to `8.13`:
- [[Fleet] Fix inactive popover tour not resetting
(#176929)](#176929)

<!--- 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-19T10:25:20Z","message":"[Fleet]
Fix inactive popover tour not resetting (#176929)\n\nFixes
#176124 Summary\r\nThe
[inactive
popover](#149226 appears
the first time after agents become inactive was broken\r\n(probably
because of a EUi upgrade) and wasn't dismissable anymore.\r\n\r\nI'm
adding a footer with button that makes it easily
dismissable.\r\n\r\n![Screenshot 2024-02-14 at 16
15\r\n36](https://github.com/elastic/kibana/assets/16084106/b4029aa2-e0f7-42d4-afe1-e810b7e88d23)\r\n\r\n###
Testing \r\n- In dev tools console, run the following. This removes from
the local\r\nstorage the key that signals that the tour was already ran
once.\r\n```\r\n
localStorage.removeItem(\"fleet.inactiveAgentsCalloutHasBeenDismissed\")\r\n```\r\n-
Enroll some agents and wait that at least one becomes inactive\r\n- The
popover should be visible and it should be possible to dismiss it\r\nby
clicking \"got it\".\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"851657c6f9fd0113f3a5900c100ce0f3e151841f","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","v8.13.0","v8.12.2","v8.14.0"],"title":"[Fleet]
Fix inactive popover tour not
resetting","number":176929,"url":"#176929
Fix inactive popover tour not resetting (#176929)\n\nFixes
#176124 Summary\r\nThe
[inactive
popover](#149226 appears
the first time after agents become inactive was broken\r\n(probably
because of a EUi upgrade) and wasn't dismissable anymore.\r\n\r\nI'm
adding a footer with button that makes it easily
dismissable.\r\n\r\n![Screenshot 2024-02-14 at 16
15\r\n36](https://github.com/elastic/kibana/assets/16084106/b4029aa2-e0f7-42d4-afe1-e810b7e88d23)\r\n\r\n###
Testing \r\n- In dev tools console, run the following. This removes from
the local\r\nstorage the key that signals that the tour was already ran
once.\r\n```\r\n
localStorage.removeItem(\"fleet.inactiveAgentsCalloutHasBeenDismissed\")\r\n```\r\n-
Enroll some agents and wait that at least one becomes inactive\r\n- The
popover should be visible and it should be possible to dismiss it\r\nby
clicking \"got it\".\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"851657c6f9fd0113f3a5900c100ce0f3e151841f"}},"sourceBranch":"main","suggestedTargetBranches":["8.13","8.12"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.12","label":"v8.12.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"#176929
Fix inactive popover tour not resetting (#176929)\n\nFixes
#176124 Summary\r\nThe
[inactive
popover](#149226 appears
the first time after agents become inactive was broken\r\n(probably
because of a EUi upgrade) and wasn't dismissable anymore.\r\n\r\nI'm
adding a footer with button that makes it easily
dismissable.\r\n\r\n![Screenshot 2024-02-14 at 16
15\r\n36](https://github.com/elastic/kibana/assets/16084106/b4029aa2-e0f7-42d4-afe1-e810b7e88d23)\r\n\r\n###
Testing \r\n- In dev tools console, run the following. This removes from
the local\r\nstorage the key that signals that the tour was already ran
once.\r\n```\r\n
localStorage.removeItem(\"fleet.inactiveAgentsCalloutHasBeenDismissed\")\r\n```\r\n-
Enroll some agents and wait that at least one becomes inactive\r\n- The
popover should be visible and it should be possible to dismiss it\r\nby
clicking \"got it\".\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"851657c6f9fd0113f3a5900c100ce0f3e151841f"}}]}]
BACKPORT-->

Co-authored-by: Cristina Amico <criamico@users.noreply.github.com>
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
Fixes elastic#176124

## Summary
The [inactive popover](elastic#149226)
that appears the first time after agents become inactive was broken
(probably because of a EUi upgrade) and wasn't dismissable anymore.

I'm adding a footer with button that makes it easily dismissable.

![Screenshot 2024-02-14 at 16 15
36](https://github.com/elastic/kibana/assets/16084106/b4029aa2-e0f7-42d4-afe1-e810b7e88d23)

### Testing 
- In dev tools console, run the following. This removes from the local
storage the key that signals that the tour was already ran once.
```
  localStorage.removeItem("fleet.inactiveAgentsCalloutHasBeenDismissed")
```
- Enroll some agents and wait that at least one becomes inactive
- The popover should be visible and it should be possible to dismiss it
by clicking "got it".

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:enhancement Team:Fleet Team label for Observability Data Collection Fleet team v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Inform user they have inactive or unenrolled agents
5 participants