mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
25 commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
|
9aad9b7ed6
|
[8.16] [Vega] Fix highlight for HJSON (#208858) (#209286)
# Backport This will backport the following commits from `main` to `8.16`: - [[Vega] Fix highlight for HJSON (#208858)](https://github.com/elastic/kibana/pull/208858) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Marco Vettorello","email":"marco.vettorello@elastic.co"},"sourceCommit":{"committedDate":"2025-02-03T13:18:35Z","message":"[Vega] Fix highlight for HJSON (#208858)\n\n## Summary\r\n\r\nThis PR fixes the missing highlight theme for HJSON specs in Vega.\r\nThe issue https://github.com/elastic/kibana/issues/205711 was caused by\r\nhttps://github.com/elastic/kibana/pull/182348 that inadvertently\r\nspecified the code-editor package as sideEffect free. This cause the\r\ncompiler to exclude every import without exported and used methods.\r\nThis was the case for the code-editor that registered some language\r\nhighlighters in that way.\r\n\r\nThe solution adopted here is to mark the register_language.ts file as a\r\nfile with side effects, the alternative solution can be to register\r\nthese directly from within the code_editor component.\r\nA third option is to move these registration within the monaco package\r\nwhere other languages are also registered.\r\nI'd like to leave to @elastic/appex-sharedux the preference to followup\r\nwith a better fix for the future.\r\n\r\nI'd also like to have the opinion from @elastic/kibana-operations\r\nbecause the misconfigured package issue can be seen only in production\r\nand not in development mode. Is it possible that webpack doesn't apply\r\ntreeshaking when in development mode?\r\n\r\nfix https://github.com/elastic/kibana/issues/205711\r\nShould also fix the same issue but for TSVB Markdown\r\n\r\nThe fix was tested on CI by running at first only the CI FT with the\r\n`sideEffects:false` to verify the failure (see\r\n[build](https://buildkite.com/elastic/kibana-pull-request/builds/272375))\r\nand then with the fix specifying the actual file that contains side\r\neffects.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"7260564f6a9cd7da71a80e9bd57d836a0bea57c4","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:TSVB","release_note:fix","Feature:Vega","Team:Visualizations","backport:prev-major","v9.1.0"],"title":"[Vega] Fix highlight for HJSON","number":208858,"url":"https://github.com/elastic/kibana/pull/208858","mergeCommit":{"message":"[Vega] Fix highlight for HJSON (#208858)\n\n## Summary\r\n\r\nThis PR fixes the missing highlight theme for HJSON specs in Vega.\r\nThe issue https://github.com/elastic/kibana/issues/205711 was caused by\r\nhttps://github.com/elastic/kibana/pull/182348 that inadvertently\r\nspecified the code-editor package as sideEffect free. This cause the\r\ncompiler to exclude every import without exported and used methods.\r\nThis was the case for the code-editor that registered some language\r\nhighlighters in that way.\r\n\r\nThe solution adopted here is to mark the register_language.ts file as a\r\nfile with side effects, the alternative solution can be to register\r\nthese directly from within the code_editor component.\r\nA third option is to move these registration within the monaco package\r\nwhere other languages are also registered.\r\nI'd like to leave to @elastic/appex-sharedux the preference to followup\r\nwith a better fix for the future.\r\n\r\nI'd also like to have the opinion from @elastic/kibana-operations\r\nbecause the misconfigured package issue can be seen only in production\r\nand not in development mode. Is it possible that webpack doesn't apply\r\ntreeshaking when in development mode?\r\n\r\nfix https://github.com/elastic/kibana/issues/205711\r\nShould also fix the same issue but for TSVB Markdown\r\n\r\nThe fix was tested on CI by running at first only the CI FT with the\r\n`sideEffects:false` to verify the failure (see\r\n[build](https://buildkite.com/elastic/kibana-pull-request/builds/272375))\r\nand then with the fix specifying the actual file that contains side\r\neffects.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"7260564f6a9cd7da71a80e9bd57d836a0bea57c4"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208858","number":208858,"mergeCommit":{"message":"[Vega] Fix highlight for HJSON (#208858)\n\n## Summary\r\n\r\nThis PR fixes the missing highlight theme for HJSON specs in Vega.\r\nThe issue https://github.com/elastic/kibana/issues/205711 was caused by\r\nhttps://github.com/elastic/kibana/pull/182348 that inadvertently\r\nspecified the code-editor package as sideEffect free. This cause the\r\ncompiler to exclude every import without exported and used methods.\r\nThis was the case for the code-editor that registered some language\r\nhighlighters in that way.\r\n\r\nThe solution adopted here is to mark the register_language.ts file as a\r\nfile with side effects, the alternative solution can be to register\r\nthese directly from within the code_editor component.\r\nA third option is to move these registration within the monaco package\r\nwhere other languages are also registered.\r\nI'd like to leave to @elastic/appex-sharedux the preference to followup\r\nwith a better fix for the future.\r\n\r\nI'd also like to have the opinion from @elastic/kibana-operations\r\nbecause the misconfigured package issue can be seen only in production\r\nand not in development mode. Is it possible that webpack doesn't apply\r\ntreeshaking when in development mode?\r\n\r\nfix https://github.com/elastic/kibana/issues/205711\r\nShould also fix the same issue but for TSVB Markdown\r\n\r\nThe fix was tested on CI by running at first only the CI FT with the\r\n`sideEffects:false` to verify the failure (see\r\n[build](https://buildkite.com/elastic/kibana-pull-request/builds/272375))\r\nand then with the fix specifying the actual file that contains side\r\neffects.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"7260564f6a9cd7da71a80e9bd57d836a0bea57c4"}}]}] BACKPORT--> Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co> |
||
|
3ea6db6073
|
[8.x] [react@18] bump `styled-components` (#192368) (#193522)
# Backport This will backport the following commits from `main` to `8.x`: - [[react@18] bump `styled-components` (#192368)](https://github.com/elastic/kibana/pull/192368) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Anton Dosov","email":"anton.dosov@elastic.co"},"sourceCommit":{"committedDate":"2024-09-20T09:26:47Z","message":"[react@18] bump `styled-components` (#192368)\n\n## Summary\r\n\r\nPrep for https://github.com/elastic/kibana/issues/138222\r\n\r\n\r\nThis PR updates `styled-components` package to the latest v5 version. I\r\nwould like to do it for react@18 upgrade to suppress a noisy warning\r\nthat is coming from `styled-components` when it is used with react@18.\r\nHere is that PR\r\nhttps://github.com/styled-components/styled-components/pull/3564/files\r\n\r\n\r\nUpdates the failed snapshot tests.\r\n\r\n\r\nDear reviewers, could you please smoke-check your apps visually? This is\r\na minor upgrade, but I think it is worth to click around anyway.","sha":"b1434a446fecd1feae4230e0e9a4fbe0fea4d8f1","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:SharedUX","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services","apm:review"],"title":"[react@18] bump `styled-components`","number":192368,"url":"https://github.com/elastic/kibana/pull/192368","mergeCommit":{"message":"[react@18] bump `styled-components` (#192368)\n\n## Summary\r\n\r\nPrep for https://github.com/elastic/kibana/issues/138222\r\n\r\n\r\nThis PR updates `styled-components` package to the latest v5 version. I\r\nwould like to do it for react@18 upgrade to suppress a noisy warning\r\nthat is coming from `styled-components` when it is used with react@18.\r\nHere is that PR\r\nhttps://github.com/styled-components/styled-components/pull/3564/files\r\n\r\n\r\nUpdates the failed snapshot tests.\r\n\r\n\r\nDear reviewers, could you please smoke-check your apps visually? This is\r\na minor upgrade, but I think it is worth to click around anyway.","sha":"b1434a446fecd1feae4230e0e9a4fbe0fea4d8f1"}},"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/192368","number":192368,"mergeCommit":{"message":"[react@18] bump `styled-components` (#192368)\n\n## Summary\r\n\r\nPrep for https://github.com/elastic/kibana/issues/138222\r\n\r\n\r\nThis PR updates `styled-components` package to the latest v5 version. I\r\nwould like to do it for react@18 upgrade to suppress a noisy warning\r\nthat is coming from `styled-components` when it is used with react@18.\r\nHere is that PR\r\nhttps://github.com/styled-components/styled-components/pull/3564/files\r\n\r\n\r\nUpdates the failed snapshot tests.\r\n\r\n\r\nDear reviewers, could you please smoke-check your apps visually? This is\r\na minor upgrade, but I think it is worth to click around anyway.","sha":"b1434a446fecd1feae4230e0e9a4fbe0fea4d8f1"}}]}] BACKPORT--> --------- Co-authored-by: Anton Dosov <anton.dosov@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> |
||
|
b6287708f6
|
Adds AGPL 3.0 license (#192025)
Updates files outside of x-pack to be triple-licensed under Elastic License 2.0, AGPL 3.0, or SSPL 1.0. |
||
|
3c97fbaac5
|
[Monaco Editor] Add Search functionality (#188337)
Fixes https://github.com//elastic/kibana/issues/186635 ## Summary This PR adds the find action to the Monaco code editor, which enables the search bar functionality as it is needed for Console with Monaco. The functionality is disabled by default. <img width="1496" alt="Screenshot 2024-07-15 at 18 08 14" src="https://github.com/user-attachments/assets/a7476e4c-8ab8-4523-a815-1f7db483ddfa"> **How to test:** 1. Open Console and verify that Command/Ctrl + f opens the search bar (should work for both the editor and the output panel). 2. Open any other code editor in Kibana and verify that the search functionality is disabled. <!-- ### 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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] 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) --> |
||
|
5e346b2561
|
[Console] Enable monaco by default (#184862)
## Summary Closes https://github.com/elastic/kibana/issues/184025 This PR enables the migration from Ace to Monaco in Dev Tools Console by default in the main branch. All serverless projects will still have the migration disabled by default. After 8.15 is branched, the migration will be disabled there as well. The intended release version for this migration is 8.16. ### Functional tests This PR creates a copy of functional tests for Monaco Console and keeps the tests for Ace in a separate folder. When the migration is released, we can remove the code for Ace together with tests. The Monaco tests are not the exact copy of the Ace tests, since some functionality and autocomplete behaviour is slightly different in the migrated Console. For example, the auto-closing of brackets works in Monaco when typing something, but is not kicking in in the tests. Flaky test runner ### 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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] 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) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> |
||
|
f1c854b9db
|
[i18n][system upgrade] Upgrade Intl Packages from v2 to v6 (#179506)
## Summary Upgrading intl packages from v2 to v6 ### Packages upgrade: - [x] Add @formatJS packages - [x] `react-intl` Upgraded - [x] `intl-messageformat` Upgraded - [x] `intl-format-cache` removed - [x] `intl-relativeformat` removed - [x] `intl-messageformat-parser` removed ### Todo list: - [x] Refactor HTML tags - [x] Refactor Upgrade tags - [x] Refactor `kbn-i18n` - [x] Refactor `kbn-i18n-react` - [x] Refactor `FormattedRelative` to `FormattedRelativeTime` - [x] Refactor polyfills - [x] Refactor IntlShape types - [x] Rewrite Providers - [x] Rewrite tests using i18n - [x] Removed current pseudolocale implementation (tracker: https://github.com/elastic/kibana/issues/180244) - [x] Fix jest tests using rendered `Provider` - [x] Remove no longer valid i18n packages documentation (tracker: https://github.com/elastic/kibana/issues/180259) Closes https://github.com/elastic/kibana/issues/178968 Closes https://github.com/elastic/kibana/issues/38642 ## Notes to code reviewers For team other than the core team, please review your plugins code changes by filtering files by codeowners. ### Test Snapshot updates Most of the changes are refactors of renamed functions and changed ICU syntax. The main updates are snapshot changes where `FormattedMessage` is now memoized so snapshots capturing the html tree needed to be updated to use `<Memo(MemoizedFormattedMessage)` instead of `<FormattedMessage` ### ICU now supports HTML tags: before: ``` <FormattedMessage defaultMessage="To buy a shoe, { link } and { cta }" values={{ link: ( <a class="external_link" target="_blank" href="https://www.shoe.com/"> visit our website </a> ), cta: <strong class="important">eat a shoe</strong>, }} /> ``` after: ``` <FormattedMessage defaultMessage="To buy a shoe, <a>visit our website</a> and <cta>eat a shoe</cta>" values={{ a: msg => ( <a class="external_link" target="_blank" href="https://www.shoe.com/"> {msg} </a> ), cta: msg => <strong class="important">{msg}</strong>, }} /> ``` ### Escape character to prevent ICU parsing changed from double slashes to single quotes: before: `\\{escaped\\}` after: `'{escaped}'` ### No need for Intl Shape the new packages under formatJS are written in typescript and come with types support out of the box so no need to set types when using i18n. Renamed `InjectedIntlProps` with `WrappedComponentProps`. Removed `prop-types` and `intlShape` in favor of `IntlShape`. ### FormattedRelative has been renamed to FormattedRelativeTime and its API has changed significantly. See [FormattedRelativeTime](https://formatjs.io/docs/react-intl/upgrade-guide-3x#formattedrelativetime) for more details. ### All tags specified must have corresponding values and will throw error if it's missing All tags are now parsed and expected to be formatted properly (all opened tags must be closed). To skip this check you can use the `ignoreTag: true` property ``` i18n.translate('xpack.apm.agentConfig.captureJmxMetrics.description', { defaultMessage: 'This is not an HTML tag <JMX object name pattern>' + ignoreTag: true, }), ``` **When do I use ignore tags?** If your message has HTML tags, it is preferred not to ignore the Tag to have some string verification that the html tags you are adding are properly formatted and closed. If it the text between brackets is not an HTML tag and it is just a fomat preference then using `ignoreTag` makes sense. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tiago Costa <tiago.costa@elastic.co> |
||
|
83345c5ec8
|
Upgrade EUI to v94.5.0 (#183431) | ||
|
a6491ab360
|
Add treeshake to some core, ml and shared-ux modules (#182348)
## Summary While debugging another issue I've noticed there were few packages without treeshake enabled who could be optimized for bundle size, so I've enabled it for a few of them. This PR focuses only on `shared-ux`, `core` and `ml` packages for now. it relies on the tests to check if the treeshake broke anything deep. |
||
|
ec5b6fd214
|
[Code Editor] Move theme to kbn-monaco package (#181417)
## Summary This PR moves the Monaco themes used in the Code Editor component to the `kbn-monaco` package to prevent the circular dependency between the `kbn-monaco` and `code_editor` packages that occurs in https://github.com/elastic/kibana/pull/180321 (where the code editor theme is reused from inside the `kbn-monaco` package). <!-- ### 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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] 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) --> --------- Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co> |
||
|
12ecb70e18
|
[Console Monaco Migration] Handle editor resize (#180494)
Closes https://github.com/elastic/kibana/issues/180216
## Summary
This PR adds resize handling for the editor and the output panel in
Console Monaco.
|
||
|
758dafe59a
|
[Console] Apply console settings to new monaco editor (#178982)
Closes https://github.com/elastic/kibana/issues/178966 Closes https://github.com/elastic/kibana/issues/176799 ## Summary This PR applies the console settings to the new Monaco editor: - `fontSize` - `wrapMode` - `isAccessibilityOverlayEnabled` It also modifies the `CodeEditor` component to accept an `accessibilityOverlayEnabled` prop. **How to test:** 1. Create a `config/kibana.dev.yml` file (if one doesn't exist already) and add the line: `console.dev.enableMonaco: true` 2. Start Es and Kibana and navigate to Console 3. Click on Settings 4. Try changing the "Font size", "Wrap long lines", and "Accessibility overlay" settings and verify that the changes are correctly applied to the new monaco editor. <!-- ### 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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] 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) --> |
||
|
88992d0c73
|
Rebroadcast mouse event for mouse down event in monaco editor (#178622)
## Summary Closes https://github.com/elastic/kibana/issues/177756 Introduces a wrapper that will ~trap~ listen on `mousedown` events from the monaco editor and rebroadcast this event type so that when it's integrated, any component that needs interaction events still gets events related to the monaco but with the wrapper as the event target. The advantage of this approach is we keep the default behaviour for events propagated for monaco editor as is, also applying style of [`display:contents`](https://www.w3.org/TR/css-display-3/#box-generation) ensures this extra wrapper element does not modify the existing layout. <!-- ### 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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] 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) --> |
||
|
d6529e65fb
|
[CodeEditor] fix indent lines color issue in dark mode (#178885)
## Summary fix https://github.com/elastic/kibana/issues/178882 before (see the vertical nesting lines having incorrect color - white): <img width="749" alt="Screenshot 2024-03-18 at 16 32 29" src=" |
||
|
1c64038fe8
|
fix dark mode for CodeFieldEditor (#178851)
## Summary
Fix https://github.com/elastic/kibana/issues/178740
This fixed the background color for the `CodeFieldEditor` component, a
wrapper around `CodeEditor`. For the background color theme, we should
fallback to the eui theme context value if the explicit prop is missing,
the same way we do for the theme of the inner `CodeEditor` component

## Summary fix https://github.com/elastic/kibana/issues/175684 Refer to the issue https://github.com/elastic/kibana/issues/175684 for the problem and reproduction I tested that this fixes the issue using the story from the reproduction https://github.com/elastic/kibana/pull/175670 and the URL drilldown's placeholder issue explained in https://github.com/elastic/kibana/issues/175684 |
||
|
86e8bc197b
|
[CodeEditor/UrlDrilldown] Add fitToContent support, autoresize the url template editor (#175561)
## Summary This PR fixes the paper cut where the URL template editor in URL drilldown is unusably small. It now can expand as you type longer URLs fix https://github.com/elastic/kibana/issues/132513 The input box now expands from 5 to 15 lines. |
||
|
31026a0b65
|
[ES|QL] Add quick fixes feature to query validation errors (#175553)
## Summary This PR improves the UX of a query editing experience via the quick fix feature, typical of a full IDE. This is a bit of an experiment and a small enhancement already, but I'm curious on more use cases for this quick fixes option. I've addressed some simple ones here, but let me know if you think there are scenarios you would like to be covered. Spellchecks fixes are computed using a levenshtein distance of 3, same as on the ES counterpart. Current supported features: * index spellcheck quick fix 
## Summary This PR adds the ResizeObserver polyfill in Jest Tests reusing a polyfill already used in Kibana. The PR also removes all the mocks for the ResizeObserver used in tests. The polyfill is no longer needed in code running on a browser as the [ResizeObserver API is already available](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver#browser_compatibility) in every Kibana-supported browser. There is still one last polyfill to remove `@juggle/resize-observer` but this is used internally by the `use-resize-observer` hook. A following PR could probably replace that hook with a different hook that doesn't require that polyfill to cleanup a bit our dependencies |
||
|
b25407edba
|
Update Kibana code editor dependencies (#171720)
## Summary This PR started out as an attempt to resolve https://github.com/elastic/kibana/issues/166559; which it does, the appropriate colours for the message prompt displayed when an edit attempt on read only content is made in the code editor for both dark and light mode are now set; ### Light mode <img width="412" alt="Screenshot 2023-11-22 at 11 30 17" src=" |
||
|
d458b5382f
|
Remove legacy kibana react code editor (#171047)
## Summary
This PR removes the legacy kibana react code-editor, alongside replacing
all import declarations of this legacy component to the one offered by
shared-ux, i.e import declaration source of `'@kbn/kibana-react/public'`
is switched to `@kbn/code-editor`.
Also in this PR an helper for writing jest tests has been included
through the package `@kbn/code-editor-mock`, this would facilitate
mocking the editor, especially given that the code editor leverages
couple of APIs that are aren't included by default in jsdom, among them,
`matchMedia`, `ResizeObserver`. The provided mock is sufficient for most
use cases and can be setup in any package within kibana as a
[`node_module`
mock](https://jestjs.io/docs/manual-mocks#mocking-node-modules) without
having to repeatedly manually mock the editor within individual test
files. An example for how this might be done can be found here
|
||
|
3249c1a116
|
Consolidate <CodeEditor/> (#170313)
## Summary Fix https://github.com/elastic/kibana/issues/159719 - Remove duplicate of code_editor code from `kibana_react` and apply recent changes to the version in `packages/` - Fix code_editor styles in `packages/` https://github.com/elastic/kibana/pull/170313#discussion_r1378839369 - Revert setting default height to 100px (as it breaks in some places) https://github.com/elastic/kibana/pull/170313#discussion_r1378838788 ### Risks Ideally we should smoke check the code editor in all the places, I checked bunch of them. As of special custom features, I tested: - The theme switch - The placeholder - The a11y hint - Fullscreen mode |
||
|
8fb5a651a0
|
Extracted DiscoverGrid to a package named @kbn/unified-data-table as UnifiedDataTable component (#163211)
## Summary Current PR includes the next set of changes: 1. Moved `DiscoverGrid` component to a package `@kbn/unified-data-table` and added `@elastic/kibana-data-discovery` as code owners. 2. Changed `@kbn/unified-data-table` package naming for data grid related components and methods to correspond `UnifiedDataTable` instead of `Discover`. 3. Moved hooks `useColumns` and `useRowHeightsOptions` to a package as its logic belongs to `UnifiedDataTable`. 4. Renamed `DiscoverGridContext` to `UnifiedDataTableContext`. 5. Extended `UnifiedDataTable` interface and functionality with the next customization options: - `renderDocumentView?: (displayedRows: DataTableRecord[],displayedColumns: string[]) => JSX.Element | undefined;` - callback to render DocumentView when the document is expanded - `configRowHeight?: number;` - optional value for providing configuration setting for UnifiedDataTable rows height - `showMultiFields?: boolean;` - optional value for providing configuration setting for enabling to display the complex fields in the table. Default is true. - `maxDocFieldsDisplayed?: number;` - optional value for providing configuration setting for maximum number of document fields to display in the table. Default is 50. - `externalControlColumns?: EuiDataGridControlColumn[];` - optional value for providing EuiDataGridControlColumn list of the additional leading control columns. UnifiedDataTable includes two control columns: Open Details and Select. <img width="522" alt="Screenshot 2023-08-22 at 2 26 57 PM" src=" |
||
|
477505a2dd
|
[context] Unify Contexts, deprecate others (#161914)
> Pre-req for https://github.com/elastic/kibana/issues/56406
## Summary
We've had a long-standing problem in Kibana around our use of React
context, particularly with EUI and i18n. There hasn't existed an
idempotent context structure, and that has lead to a lot of unexpected
results, (e.g. missing translations, inconsistent dark mode, excess
context providers, etc).
The biggest change coming from this PR is knowing exactly which provider
to use in a particular use case. This means, for example,
`ReactDOM.render` calls won't be missing `i18n` or `theme` due to a
missing context. It also allows consumers to use `darkMode` without
having to read the `uiSetting` themselves, instead allowing the context
to do it for them.
We also haven't been honoring the intended [`EuiProvider`
API](https://eui.elastic.co/#/utilities/provider#theming-and-global-styles)...
in some cases we've been creating and re-creating the Emotion caches,
often by copy/paste of the cache code. We've also been nesting
`EuiThemeProvider` contexts unnecessarily-- thinking we need to render a
theme provider in an isolated component-- which renders an additional
`span` element into the DOM.
This PR attempts to address this inconsistency by creating a set of
context providers divided by use case:
 |