-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Handle unavailable spaces in agent policy space selector #201251
[Fleet] Handle unavailable spaces in agent policy space selector #201251
Conversation
This looks a good solution to me, we should probably remove the |
Good catch, thanks! I pushed a fix. I kept it local to the component instead of centralising the One general concern I had is that this fix relies on the Saved Objects API returning |
Pinging @elastic/fleet (Team:Fleet) |
It seems pretty reliable, the space plugin seems to use that behavior frequently in their code, it seems also they expose a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Cheers 👍 I pushed a commit to use the constant. |
Is there anything preventing us from hiding the spaces entirely instead of displaying "unavailable space"? This badge isn't actionable for users with limited space access, and seems like it's adding UI noise for them. |
Nothing preventing, it's a small change. My thinking was that this shows more clearly why the input is disabled, but with the tooltip it shouldn't be a concern. If showing how many unavailable spaces are assigned is a concern, then I'm definitely happy to hide them instead. |
If we're relying on spaces as an information/data isolation mechanism, I think a user with permissions to only 2 spaces should not know there are 12 available spaces in Kibana. Hiding the spaces entirely seems like the more "proper" thing to do when it comes to data isolation. I'd be in favor of making this change here. |
Thank you, agreed and done. I've updated the PR description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
History
|
Starting backport for target branches: 8.x |
…stic#201251) ## Summary Closes elastic#193827 This PR improves the space selector in agent policy setting to handle the case where the user does not have access to all policy spaces. In this case: * Space selection is disabled * The "Create space" link is hidden * A tooltip is shown to inform the user why the input is disabled * The inaccessible space badges are given an `Unavailable space` badge ### Screenshots For a user with access to all policy spaces (no change): ![Screenshot 2024-11-21 at 17 11 00](https://github.com/user-attachments/assets/79c4fcc5-17d5-4273-912c-07eecfd73715) For a user with access to only a subset of policy spaces: ![Screenshot 2024-11-21 at 17 11 09](https://github.com/user-attachments/assets/19ca162a-7ed6-45fd-8ecc-98e6e085af27) ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit db49418)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
#201251) (#201580) # Backport This will backport the following commits from `main` to `8.x`: - [[Fleet] Handle unavailable spaces in agent policy space selector (#201251)](#201251) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jill Guyonnet","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-25T12:49:23Z","message":"[Fleet] Handle unavailable spaces in agent policy space selector (#201251)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/193827\r\n\r\nThis PR improves the space selector in agent policy setting to handle\r\nthe case where the user does not have access to all policy spaces.\r\n\r\nIn this case:\r\n* Space selection is disabled\r\n* The \"Create space\" link is hidden\r\n* A tooltip is shown to inform the user why the input is disabled\r\n* The inaccessible space badges are given an `Unavailable space` badge\r\n\r\n### Screenshots\r\n\r\nFor a user with access to all policy spaces (no change):\r\n![Screenshot 2024-11-21 at 17 11\r\n00](https://github.com/user-attachments/assets/79c4fcc5-17d5-4273-912c-07eecfd73715)\r\n\r\nFor a user with access to only a subset of policy spaces:\r\n![Screenshot 2024-11-21 at 17 11\r\n09](https://github.com/user-attachments/assets/19ca162a-7ed6-45fd-8ecc-98e6e085af27)\r\n\r\n### Checklist\r\n\r\n- [x] 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- [x] [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- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"db494181e37a3f3477361fc1c1919fc7ed3a1329","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-minor"],"title":"[Fleet] Handle unavailable spaces in agent policy space selector","number":201251,"url":"https://github.com/elastic/kibana/pull/201251","mergeCommit":{"message":"[Fleet] Handle unavailable spaces in agent policy space selector (#201251)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/193827\r\n\r\nThis PR improves the space selector in agent policy setting to handle\r\nthe case where the user does not have access to all policy spaces.\r\n\r\nIn this case:\r\n* Space selection is disabled\r\n* The \"Create space\" link is hidden\r\n* A tooltip is shown to inform the user why the input is disabled\r\n* The inaccessible space badges are given an `Unavailable space` badge\r\n\r\n### Screenshots\r\n\r\nFor a user with access to all policy spaces (no change):\r\n![Screenshot 2024-11-21 at 17 11\r\n00](https://github.com/user-attachments/assets/79c4fcc5-17d5-4273-912c-07eecfd73715)\r\n\r\nFor a user with access to only a subset of policy spaces:\r\n![Screenshot 2024-11-21 at 17 11\r\n09](https://github.com/user-attachments/assets/19ca162a-7ed6-45fd-8ecc-98e6e085af27)\r\n\r\n### Checklist\r\n\r\n- [x] 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- [x] [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- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"db494181e37a3f3477361fc1c1919fc7ed3a1329"}},"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/201251","number":201251,"mergeCommit":{"message":"[Fleet] Handle unavailable spaces in agent policy space selector (#201251)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/193827\r\n\r\nThis PR improves the space selector in agent policy setting to handle\r\nthe case where the user does not have access to all policy spaces.\r\n\r\nIn this case:\r\n* Space selection is disabled\r\n* The \"Create space\" link is hidden\r\n* A tooltip is shown to inform the user why the input is disabled\r\n* The inaccessible space badges are given an `Unavailable space` badge\r\n\r\n### Screenshots\r\n\r\nFor a user with access to all policy spaces (no change):\r\n![Screenshot 2024-11-21 at 17 11\r\n00](https://github.com/user-attachments/assets/79c4fcc5-17d5-4273-912c-07eecfd73715)\r\n\r\nFor a user with access to only a subset of policy spaces:\r\n![Screenshot 2024-11-21 at 17 11\r\n09](https://github.com/user-attachments/assets/19ca162a-7ed6-45fd-8ecc-98e6e085af27)\r\n\r\n### Checklist\r\n\r\n- [x] 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- [x] [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- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"db494181e37a3f3477361fc1c1919fc7ed3a1329"}}]}] BACKPORT--> Co-authored-by: Jill Guyonnet <[email protected]>
…stic#201251) ## Summary Closes elastic#193827 This PR improves the space selector in agent policy setting to handle the case where the user does not have access to all policy spaces. In this case: * Space selection is disabled * The "Create space" link is hidden * A tooltip is shown to inform the user why the input is disabled * The inaccessible space badges are given an `Unavailable space` badge ### Screenshots For a user with access to all policy spaces (no change): ![Screenshot 2024-11-21 at 17 11 00](https://github.com/user-attachments/assets/79c4fcc5-17d5-4273-912c-07eecfd73715) For a user with access to only a subset of policy spaces: ![Screenshot 2024-11-21 at 17 11 09](https://github.com/user-attachments/assets/19ca162a-7ed6-45fd-8ecc-98e6e085af27) ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <[email protected]>
…stic#201251) ## Summary Closes elastic#193827 This PR improves the space selector in agent policy setting to handle the case where the user does not have access to all policy spaces. In this case: * Space selection is disabled * The "Create space" link is hidden * A tooltip is shown to inform the user why the input is disabled * The inaccessible space badges are given an `Unavailable space` badge ### Screenshots For a user with access to all policy spaces (no change): ![Screenshot 2024-11-21 at 17 11 00](https://github.com/user-attachments/assets/79c4fcc5-17d5-4273-912c-07eecfd73715) For a user with access to only a subset of policy spaces: ![Screenshot 2024-11-21 at 17 11 09](https://github.com/user-attachments/assets/19ca162a-7ed6-45fd-8ecc-98e6e085af27) ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <[email protected]>
Summary
Closes #193827
This PR improves the space selector in agent policy setting to handle the case where the user does not have access to all policy spaces.
In this case:
Unavailable space
badgeScreenshots
For a user with access to all policy spaces (no change):
For a user with access to only a subset of policy spaces:
Checklist
release_note:*
label is applied per the guidelines