Skip to content

Comments

[8.14] [UII] Use local storage for tours in Fleet and Integrations (#183102)#183159

Merged
kibanamachine merged 1 commit intoelastic:8.14from
kibanamachine:backport/8.14/pr-183102
May 10, 2024
Merged

[8.14] [UII] Use local storage for tours in Fleet and Integrations (#183102)#183159
kibanamachine merged 1 commit intoelastic:8.14from
kibanamachine:backport/8.14/pr-183102

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.14:

Questions ?

Please refer to the Backport tool documentation

…183102)

## Summary

Resolves elastic#180659.

The original bug reported an error being throw when trying to dismiss
the agent activity tour while logged in as a user with limited access.

This was happening because the tour was backed by a `uiSetting` and
attempted to write a new value to `/internal/kibana/settings` after
dismissing the tour. `uiSettings` backs the global Kibana advanced
settings used by all users in an instance. Therefore only users with
access to Management > Advanced settings are allowed to write to it.

The tours that we use in Fleet and Integrations is not the right use
case for `uiSettings`. This PR changes the logic for the two tours
(agent activity and add agent) so that:

- If `uiSetting`'s `hideAnnouncements` is true, never show these tours -
this is a global setting intended to surpress these kind of tours and
messages, see elastic#135030
- Otherwise read from and write to local storage (using Kibana's
`storage` service) to determine whether to show these tours or not
- Never attempt to write to `uiSettings`
- Normalize the code pattern used by hooks related to the inactive
agents tour (they were already using local storage but not from
`useStartServices`)

You can test this by:

1. Opening actions menu in an agent list row, add a new tag to the
agent, and dismiss the Agent activity tour. Refresh the page, perform
the action again, and tour should not show
2. From Integrations, add an integration to a new policy without adding
an agent, after returning to the integration policies list, dismiss the
Add agent activity tour. Refresh the page, perform the action again, and
tour should not show

You can clear these `fleet.*` local settings to trigger the tours again,
or use another browser / incognito mode:

<img width="694" alt="image"
src="https://github.com/elastic/kibana/assets/1965714/817f48fc-2a6a-411d-8242-f855f862c622">

(cherry picked from commit 8cf79b7)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label May 10, 2024
@kibanamachine kibanamachine enabled auto-merge (squash) May 10, 2024 14:25
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label May 10, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kibana-ci
Copy link

💚 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.3MB 1.3MB +301.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 159.6KB 159.8KB +204.0B

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

cc @jen-huang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:Fleet Team label for Observability Data Collection Fleet team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants