-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[KibanaReact] Use settings service in useUiSetting hook #154710
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
buildkite test this |
@elasticmachine merge upstream |
buildkite test this |
@elasticmachine merge upstream |
buildkite test this |
1 similar comment
buildkite test this |
buildkite test this |
buildkite test this |
I have the synthetics tests in the |
buildkite test this |
…-ref HEAD~1..HEAD --fix'
buildkite test this |
buildkite test this |
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
@elasticmachine run elasticsearch-ci/docs |
Thanx @patrykkopycinski 🙌 |
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.
Hope you're well @majagrubic !
Thank you @dgieselaar 🙇♀️ |
Thanx @majagrubic, kibana team loves you ❤️ |
## Summary Fixes: #149347 This PR replaces deprecated `uiSettings` client with `settings.client` in `useUiSetting` hook. As a result, all consumers of the hook need to provide `settings` service to Kibana context. The majority of this PR is providing the `settings` as a dependency to affected plugins. It would be great if sometime in the future we could get rid of `uiSettings` entirely. `CodeEditor` is one of the components relying on this hook, which caused a lot of the changes in this PR. If you have been tagged for review it means your code is using `useUiSetting` hook directly, or is consuming `CodeEditor` component. I have been focused on updating plugins that had failing functional tests, but would appreciate a manual pass on this as well. xoxo ### Checklist Delete any items that are not applicable to this PR. ~ [ ] 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)~ ~- [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials~ - [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 ~- [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/))~ ~- [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~ ~- [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~ ~- [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~ ~- [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~ ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Maja Grubic <maja.grubic@elastic.co> Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
## Summary Fix #158193 #154710 changed a bit the context type to work with the Monaco CodeEditor and this example was not updated to use it. This PR should fix it. ### Checklist Delete any items that are not applicable to this PR. - [ ] 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) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Risk Matrix Delete this section if it is not applicable to this PR. Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release. When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. | | Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. | | Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. | | [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
) ## Summary Fix elastic#158193 elastic#154710 changed a bit the context type to work with the Monaco CodeEditor and this example was not updated to use it. This PR should fix it. ### Checklist Delete any items that are not applicable to this PR. - [ ] 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) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Risk Matrix Delete this section if it is not applicable to this PR. Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release. When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. | | Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. | | Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. | | [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Fixes #158459 ## Summary This PR updates the `KibanaReactContextServices` type so that it corresponds to the context type that works with the Monaco CodeEditor and which was recently changed in #154710. **How to test** Verify that all CodeEditor components in Index Management work as expected: - `application/components/shared/components/wizard_steps/step_aliases.tsx` - `application/components/shared/components/wizard_steps/step_settings.tsx` - `application/components/component_templates/component_template_wizard/component_template_form/steps/step_logistics.tsx` - `application/components/mappings_editor/components/templates_form/templates_form.tsx` - `application/components/mappings_editor/components/load_mappings/load_mappings_provider.tsx` - `application/components/mappings_editor/components/document_fields/field_parameters/meta_parameter.tsx` - `application/components/mappings_editor/components/configuration_form/meta_field_section/meta_field_section.tsx` - [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 --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Fixes #158585 ## Summary This PR updates the context service type so that it corresponds to the context type that works with the Monaco CodeEditor and which was recently changed in #154710. **How to test** Verify that all CodeEditor components in Snapshot and Restore work as expected: - `application/components/restore_snapshot_form/steps/step_settings.tsx` - `application/components/repository_form/type_settings/hdfs_settings.tsx` <br> - [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 (Added e2e tests that would catch this behaviour in case of any future changes to CodeEditor) --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Closes #167062 ## Summary * Adds "Features" section to Infra settings screen * Hooks changes to `uiSettings` into existing form in order to use the current "Discard" and "Apply" buttons logic * Replaces usage of `uiSettings` with `settings.client` as `uiSettings` seems to be [deprecated](#154710. Observables exposed by `uiSettings` do not seem to work anymore. * Deletes the Hosts landing screen * Revives the logic for showing/hiding Hosts nav item depending on the settings toggle https://github.com/elastic/kibana/assets/793851/767e69cc-98b1-4fe9-93d9-f39c08ac5c83 ## How to test * Checkout locally and run in stateful mode * Go to Infra Setttings screen and make sure Features section is present * Make sure that the "Infrastructure Hosts view" toggle shows/hides the Hosts nav item * Make sure that "Infrastructure Hosts view" in "Anvanced Settings" is synced with the the one in Infra settings --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes elastic#167062 ## Summary * Adds "Features" section to Infra settings screen * Hooks changes to `uiSettings` into existing form in order to use the current "Discard" and "Apply" buttons logic * Replaces usage of `uiSettings` with `settings.client` as `uiSettings` seems to be [deprecated](elastic#154710. Observables exposed by `uiSettings` do not seem to work anymore. * Deletes the Hosts landing screen * Revives the logic for showing/hiding Hosts nav item depending on the settings toggle https://github.com/elastic/kibana/assets/793851/767e69cc-98b1-4fe9-93d9-f39c08ac5c83 ## How to test * Checkout locally and run in stateful mode * Go to Infra Setttings screen and make sure Features section is present * Make sure that the "Infrastructure Hosts view" toggle shows/hides the Hosts nav item * Make sure that "Infrastructure Hosts view" in "Anvanced Settings" is synced with the the one in Infra settings --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes elastic#167062 ## Summary * Adds "Features" section to Infra settings screen * Hooks changes to `uiSettings` into existing form in order to use the current "Discard" and "Apply" buttons logic * Replaces usage of `uiSettings` with `settings.client` as `uiSettings` seems to be [deprecated](elastic#154710. Observables exposed by `uiSettings` do not seem to work anymore. * Deletes the Hosts landing screen * Revives the logic for showing/hiding Hosts nav item depending on the settings toggle https://github.com/elastic/kibana/assets/793851/767e69cc-98b1-4fe9-93d9-f39c08ac5c83 ## How to test * Checkout locally and run in stateful mode * Go to Infra Setttings screen and make sure Features section is present * Make sure that the "Infrastructure Hosts view" toggle shows/hides the Hosts nav item * Make sure that "Infrastructure Hosts view" in "Anvanced Settings" is synced with the the one in Infra settings --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
Fixes: #149347
This PR replaces deprecated
uiSettings
client withsettings.client
inuseUiSetting
hook. As a result, all consumers of the hook need to providesettings
service to Kibana context. The majority of this PR is providing thesettings
as a dependency to affected plugins. It would be great if sometime in the future we could get rid ofuiSettings
entirely.CodeEditor
is one of the components relying on this hook, which caused a lot of the changes in this PR.If you have been tagged for review it means your code is using
useUiSetting
hook directly, or is consumingCodeEditor
component. I have been focused on updating plugins that had failing functional tests, but would appreciate a manual pass on this as well.xoxo
Checklist
Delete any items that are not applicable to this PR.
~ [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support~
- [ ] Documentation was added for features that require explanation or tutorials- [ ] Any UI touched in this PR is usable by keyboard only (learn more about keyboard accessibility)- [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: FF, Chrome)- [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list- [ ] This renders correctly on smaller devices using a responsive layout. (You can test this in your browser)- [ ] This was checked for cross-browser compatibilityFor maintainers