-
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
[Synthetics] introduce new spaces field for synthetics api keys #211816
[Synthetics] introduce new spaces field for synthetics api keys #211816
Conversation
const { services } = useKibana<ClientPluginsStart>(); | ||
const [spacesList, setSpacesList] = React.useState<Array<{ id: string; label: string }>>([]); | ||
const data = services.spaces?.ui.useSpaces(); | ||
|
||
const HELP_TEXT = module === 'location' ? LOCATION_HELP_TEXT : API_KEY_HELP_TEXT; |
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.
Instead of passing the module name, I'd just pass the help text. That way the parent components can be responsible for defining the content.
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.
Agreed. Done ✅
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
e754327
to
a3e7d3c
Compare
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.
Can you please make sure to test one use-cases, so if user select * or ALL_SPACES, and if the user creating API key don't have access to * ALL SPACES, it should thrown an error.
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 !!
Seems like user can create an API key in all spaces or any spaces to which they don't have permission to, it would be nice to add a validation to inform user that they don't have permission to in a space they are creating an API key.
though could be a follow up issue as well.
💚 Build Succeeded
Metrics [docs]Async chunks
History
|
Starting backport for target branches: 8.x, 9.0 |
…tic#211816) ### Summary - Resolves elastic#211049 - Adds the ability for a user to create an API Key in synthetics settings that applies to specified space(s) - Reuses existing spaces combo box from private locations, enhances the component to incorporate a generic interface and help text prop to enable additional uses - Modifies functionality of Generate API Key button to consider a blank spaces field before creating the key - Currently, in private locations, if the spaces field is blank, the save button has no functionality, so this was copied here.   ### Release Notes Adds the ability for a user to create an API Key in synthetics settings that applies only to specified space(s) --------- Co-authored-by: Shahzad <shahzad31comp@gmail.com> (cherry picked from commit de7d33d)
…tic#211816) ### Summary - Resolves elastic#211049 - Adds the ability for a user to create an API Key in synthetics settings that applies to specified space(s) - Reuses existing spaces combo box from private locations, enhances the component to incorporate a generic interface and help text prop to enable additional uses - Modifies functionality of Generate API Key button to consider a blank spaces field before creating the key - Currently, in private locations, if the spaces field is blank, the save button has no functionality, so this was copied here.   ### Release Notes Adds the ability for a user to create an API Key in synthetics settings that applies only to specified space(s) --------- Co-authored-by: Shahzad <shahzad31comp@gmail.com> (cherry picked from commit de7d33d)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…#211816) (#212150) # Backport This will backport the following commits from `main` to `9.0`: - [[Synthetics] introduce new spaces field for synthetics api keys (#211816)](#211816) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Bailey Cash","email":"bailey.cash@elastic.co"},"sourceCommit":{"committedDate":"2025-02-21T19:25:54Z","message":"[Synthetics] introduce new spaces field for synthetics api keys (#211816)\n\n### Summary\n\n- Resolves #211049\n- Adds the ability for a user to create an API Key in synthetics\nsettings that applies to specified space(s)\n- Reuses existing spaces combo box from private locations, enhances the\ncomponent to incorporate a generic interface and help text prop to\nenable additional uses\n- Modifies functionality of Generate API Key button to consider a blank\nspaces field before creating the key\n- Currently, in private locations, if the spaces field is blank, the\nsave button has no functionality, so this was copied here.\n\n\n\n\n\n### Release Notes\nAdds the ability for a user to create an API Key in synthetics settings\nthat applies only to specified space(s)\n\n---------\n\nCo-authored-by: Shahzad <shahzad31comp@gmail.com>","sha":"de7d33dec296a491ae9abd9f3b74859c0c8e78c7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-minor","Team:obs-ux-management","v9.1.0","v8.19.0"],"title":"[Synthetics] introduce new spaces field for synthetics api keys","number":211816,"url":"https://github.com/elastic/kibana/pull/211816","mergeCommit":{"message":"[Synthetics] introduce new spaces field for synthetics api keys (#211816)\n\n### Summary\n\n- Resolves #211049\n- Adds the ability for a user to create an API Key in synthetics\nsettings that applies to specified space(s)\n- Reuses existing spaces combo box from private locations, enhances the\ncomponent to incorporate a generic interface and help text prop to\nenable additional uses\n- Modifies functionality of Generate API Key button to consider a blank\nspaces field before creating the key\n- Currently, in private locations, if the spaces field is blank, the\nsave button has no functionality, so this was copied here.\n\n\n\n\n\n### Release Notes\nAdds the ability for a user to create an API Key in synthetics settings\nthat applies only to specified space(s)\n\n---------\n\nCo-authored-by: Shahzad <shahzad31comp@gmail.com>","sha":"de7d33dec296a491ae9abd9f3b74859c0c8e78c7"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211816","number":211816,"mergeCommit":{"message":"[Synthetics] introduce new spaces field for synthetics api keys (#211816)\n\n### Summary\n\n- Resolves #211049\n- Adds the ability for a user to create an API Key in synthetics\nsettings that applies to specified space(s)\n- Reuses existing spaces combo box from private locations, enhances the\ncomponent to incorporate a generic interface and help text prop to\nenable additional uses\n- Modifies functionality of Generate API Key button to consider a blank\nspaces field before creating the key\n- Currently, in private locations, if the spaces field is blank, the\nsave button has no functionality, so this was copied here.\n\n\n\n\n\n### Release Notes\nAdds the ability for a user to create an API Key in synthetics settings\nthat applies only to specified space(s)\n\n---------\n\nCo-authored-by: Shahzad <shahzad31comp@gmail.com>","sha":"de7d33dec296a491ae9abd9f3b74859c0c8e78c7"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Bailey Cash <bailey.cash@elastic.co>
…#211816) (#212149) # Backport This will backport the following commits from `main` to `8.x`: - [[Synthetics] introduce new spaces field for synthetics api keys (#211816)](#211816) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Bailey Cash","email":"bailey.cash@elastic.co"},"sourceCommit":{"committedDate":"2025-02-21T19:25:54Z","message":"[Synthetics] introduce new spaces field for synthetics api keys (#211816)\n\n### Summary\n\n- Resolves #211049\n- Adds the ability for a user to create an API Key in synthetics\nsettings that applies to specified space(s)\n- Reuses existing spaces combo box from private locations, enhances the\ncomponent to incorporate a generic interface and help text prop to\nenable additional uses\n- Modifies functionality of Generate API Key button to consider a blank\nspaces field before creating the key\n- Currently, in private locations, if the spaces field is blank, the\nsave button has no functionality, so this was copied here.\n\n\n\n\n\n### Release Notes\nAdds the ability for a user to create an API Key in synthetics settings\nthat applies only to specified space(s)\n\n---------\n\nCo-authored-by: Shahzad <shahzad31comp@gmail.com>","sha":"de7d33dec296a491ae9abd9f3b74859c0c8e78c7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-minor","Team:obs-ux-management","v9.1.0","v8.19.0"],"title":"[Synthetics] introduce new spaces field for synthetics api keys","number":211816,"url":"https://github.com/elastic/kibana/pull/211816","mergeCommit":{"message":"[Synthetics] introduce new spaces field for synthetics api keys (#211816)\n\n### Summary\n\n- Resolves #211049\n- Adds the ability for a user to create an API Key in synthetics\nsettings that applies to specified space(s)\n- Reuses existing spaces combo box from private locations, enhances the\ncomponent to incorporate a generic interface and help text prop to\nenable additional uses\n- Modifies functionality of Generate API Key button to consider a blank\nspaces field before creating the key\n- Currently, in private locations, if the spaces field is blank, the\nsave button has no functionality, so this was copied here.\n\n\n\n\n\n### Release Notes\nAdds the ability for a user to create an API Key in synthetics settings\nthat applies only to specified space(s)\n\n---------\n\nCo-authored-by: Shahzad <shahzad31comp@gmail.com>","sha":"de7d33dec296a491ae9abd9f3b74859c0c8e78c7"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211816","number":211816,"mergeCommit":{"message":"[Synthetics] introduce new spaces field for synthetics api keys (#211816)\n\n### Summary\n\n- Resolves #211049\n- Adds the ability for a user to create an API Key in synthetics\nsettings that applies to specified space(s)\n- Reuses existing spaces combo box from private locations, enhances the\ncomponent to incorporate a generic interface and help text prop to\nenable additional uses\n- Modifies functionality of Generate API Key button to consider a blank\nspaces field before creating the key\n- Currently, in private locations, if the spaces field is blank, the\nsave button has no functionality, so this was copied here.\n\n\n\n\n\n### Release Notes\nAdds the ability for a user to create an API Key in synthetics settings\nthat applies only to specified space(s)\n\n---------\n\nCo-authored-by: Shahzad <shahzad31comp@gmail.com>","sha":"de7d33dec296a491ae9abd9f3b74859c0c8e78c7"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Bailey Cash <bailey.cash@elastic.co>
…tic#211816) ### Summary - Resolves elastic#211049 - Adds the ability for a user to create an API Key in synthetics settings that applies to specified space(s) - Reuses existing spaces combo box from private locations, enhances the component to incorporate a generic interface and help text prop to enable additional uses - Modifies functionality of Generate API Key button to consider a blank spaces field before creating the key - Currently, in private locations, if the spaces field is blank, the save button has no functionality, so this was copied here.   ### Release Notes Adds the ability for a user to create an API Key in synthetics settings that applies only to specified space(s) --------- Co-authored-by: Shahzad <shahzad31comp@gmail.com>
…elastic#211816) (elastic#212149) # Backport This will backport the following commits from `main` to `8.x`: - [[Synthetics] introduce new spaces field for synthetics api keys (elastic#211816)](elastic#211816) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Bailey Cash","email":"bailey.cash@elastic.co"},"sourceCommit":{"committedDate":"2025-02-21T19:25:54Z","message":"[Synthetics] introduce new spaces field for synthetics api keys (elastic#211816)\n\n### Summary\n\n- Resolves elastic#211049\n- Adds the ability for a user to create an API Key in synthetics\nsettings that applies to specified space(s)\n- Reuses existing spaces combo box from private locations, enhances the\ncomponent to incorporate a generic interface and help text prop to\nenable additional uses\n- Modifies functionality of Generate API Key button to consider a blank\nspaces field before creating the key\n- Currently, in private locations, if the spaces field is blank, the\nsave button has no functionality, so this was copied here.\n\n\n\n\n\n### Release Notes\nAdds the ability for a user to create an API Key in synthetics settings\nthat applies only to specified space(s)\n\n---------\n\nCo-authored-by: Shahzad <shahzad31comp@gmail.com>","sha":"de7d33dec296a491ae9abd9f3b74859c0c8e78c7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-minor","Team:obs-ux-management","v9.1.0","v8.19.0"],"title":"[Synthetics] introduce new spaces field for synthetics api keys","number":211816,"url":"https://github.com/elastic/kibana/pull/211816","mergeCommit":{"message":"[Synthetics] introduce new spaces field for synthetics api keys (elastic#211816)\n\n### Summary\n\n- Resolves elastic#211049\n- Adds the ability for a user to create an API Key in synthetics\nsettings that applies to specified space(s)\n- Reuses existing spaces combo box from private locations, enhances the\ncomponent to incorporate a generic interface and help text prop to\nenable additional uses\n- Modifies functionality of Generate API Key button to consider a blank\nspaces field before creating the key\n- Currently, in private locations, if the spaces field is blank, the\nsave button has no functionality, so this was copied here.\n\n\n\n\n\n### Release Notes\nAdds the ability for a user to create an API Key in synthetics settings\nthat applies only to specified space(s)\n\n---------\n\nCo-authored-by: Shahzad <shahzad31comp@gmail.com>","sha":"de7d33dec296a491ae9abd9f3b74859c0c8e78c7"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211816","number":211816,"mergeCommit":{"message":"[Synthetics] introduce new spaces field for synthetics api keys (elastic#211816)\n\n### Summary\n\n- Resolves elastic#211049\n- Adds the ability for a user to create an API Key in synthetics\nsettings that applies to specified space(s)\n- Reuses existing spaces combo box from private locations, enhances the\ncomponent to incorporate a generic interface and help text prop to\nenable additional uses\n- Modifies functionality of Generate API Key button to consider a blank\nspaces field before creating the key\n- Currently, in private locations, if the spaces field is blank, the\nsave button has no functionality, so this was copied here.\n\n\n\n\n\n### Release Notes\nAdds the ability for a user to create an API Key in synthetics settings\nthat applies only to specified space(s)\n\n---------\n\nCo-authored-by: Shahzad <shahzad31comp@gmail.com>","sha":"de7d33dec296a491ae9abd9f3b74859c0c8e78c7"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Bailey Cash <bailey.cash@elastic.co>
Summary
Release Notes
Adds the ability for a user to create an API Key in synthetics settings that applies only to specified space(s)