Commit graph

106 commits

Author SHA1 Message Date
Tiago Costa
c7f893aebd
[8.18] chore(NA): upgrade to webpack 5 (#191106) (#211147)
# Backport

This will backport the following commits from `main` to `8.18`:
- [chore(NA): upgrade to webpack 5
(#191106)](https://github.com/elastic/kibana/pull/191106)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Tiago
Costa","email":"tiago.costa@elastic.co"},"sourceCommit":{"committedDate":"2025-02-14T03:01:36Z","message":"chore(NA):
upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes
#89741\r\n\r\nThis PR contains the resulting work of a massive effort
that ports our\r\non top bundler abstraction (called @kbn/optimizer)
from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term
maintenance since v4\r\nwas not receiving updates any longer but will
also unblock some new\r\nfeatures that could be beneficial for our
future DevEx endeavours.\r\n\r\nNext you can find a small list of all
the accomplished tasks on this\r\njourney.\r\n\r\n### Completed
Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n-
[x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix
file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix
`@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt
previous webpack v4 polyfill-all strategy
with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on
@kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options
on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest
resolver for file-loader cases\r\n- [x] Migrate public-path loader on
UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate
BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x]
Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate
BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work
(--profile flag)\r\n- [x] Recover if possible the previous webpack v4
cacheGroup chunks\r\nrename to something like
`data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our
first green CI, otherwise work\r\non the errors until we do\r\n- [x]
Profile and solve bottlenecks until we get a cold build\r\nperformance
similar to the one we had on webpack v4
(`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x]
OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n`
flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing
`NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin))
and\r\nadd each polyfill needed individually per each webpack config to
check\r\nif we get smaller bundles. If we do it's better to go with the
case by\r\ncase need approach instead of deploying a bunch of polyfills
with\r\nNodePolyfillPlugin. As another alternative, create a custom
smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x]
Evaluate if we want to touch the resolutions on mainFields
and\r\nconditionNames\r\n- [x] Understand why `@import
'src/core/public/mixins'` does not work\r\nanymore (not a problem, we
should use relative paths anyway but we want\r\nto track why it changed
from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden
and/or changed from\r\nerror to warning\r\n- [x] Fix license check
for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is
the\r\nlicense
for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis
package is a dependency
of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic
2.0 license is [classified
as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand
should only be used for dev dependencies.\r\n- [x] Make sure
`resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack
configs like storybook one\r\n- [x] Find what is being wrongly removed
by usedExports optimization;\r\nhint: I believe it is identifying a lot
of exports inside the sync entry\r\nof plugins as unused exports and
removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x]
Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue
to fix
sass-warnings\r\n[#190345](https://github.com/elastic/kibana/issues/190345)
or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse
rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console
override is needed\r\n- [x] Confirm react prod builds on ui shared deps
for distributable\r\n- [x] Remove customization
for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack
configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics
from stats are still aligned with what\r\nwe were collecting before;
also verify if the modules used for optimizer\r\ncaches etc are well
generated (@kbn/node-libs-browser)\r\n- [x] Fix watch
performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Brad White
<brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","Team:Fleet","v9.0.0","backport:all-open","ci:build-webpack-bundle-analyzer","Team:obs-ux-infra_services","v9.1.0"],"title":"chore(NA):
upgrade to webpack
5","number":191106,"url":"https://github.com/elastic/kibana/pull/191106","mergeCommit":{"message":"chore(NA):
upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes
#89741\r\n\r\nThis PR contains the resulting work of a massive effort
that ports our\r\non top bundler abstraction (called @kbn/optimizer)
from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term
maintenance since v4\r\nwas not receiving updates any longer but will
also unblock some new\r\nfeatures that could be beneficial for our
future DevEx endeavours.\r\n\r\nNext you can find a small list of all
the accomplished tasks on this\r\njourney.\r\n\r\n### Completed
Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n-
[x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix
file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix
`@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt
previous webpack v4 polyfill-all strategy
with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on
@kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options
on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest
resolver for file-loader cases\r\n- [x] Migrate public-path loader on
UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate
BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x]
Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate
BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work
(--profile flag)\r\n- [x] Recover if possible the previous webpack v4
cacheGroup chunks\r\nrename to something like
`data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our
first green CI, otherwise work\r\non the errors until we do\r\n- [x]
Profile and solve bottlenecks until we get a cold build\r\nperformance
similar to the one we had on webpack v4
(`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x]
OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n`
flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing
`NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin))
and\r\nadd each polyfill needed individually per each webpack config to
check\r\nif we get smaller bundles. If we do it's better to go with the
case by\r\ncase need approach instead of deploying a bunch of polyfills
with\r\nNodePolyfillPlugin. As another alternative, create a custom
smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x]
Evaluate if we want to touch the resolutions on mainFields
and\r\nconditionNames\r\n- [x] Understand why `@import
'src/core/public/mixins'` does not work\r\nanymore (not a problem, we
should use relative paths anyway but we want\r\nto track why it changed
from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden
and/or changed from\r\nerror to warning\r\n- [x] Fix license check
for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is
the\r\nlicense
for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis
package is a dependency
of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic
2.0 license is [classified
as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand
should only be used for dev dependencies.\r\n- [x] Make sure
`resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack
configs like storybook one\r\n- [x] Find what is being wrongly removed
by usedExports optimization;\r\nhint: I believe it is identifying a lot
of exports inside the sync entry\r\nof plugins as unused exports and
removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x]
Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue
to fix
sass-warnings\r\n[#190345](https://github.com/elastic/kibana/issues/190345)
or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse
rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console
override is needed\r\n- [x] Confirm react prod builds on ui shared deps
for distributable\r\n- [x] Remove customization
for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack
configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics
from stats are still aligned with what\r\nwe were collecting before;
also verify if the modules used for optimizer\r\ncaches etc are well
generated (@kbn/node-libs-browser)\r\n- [x] Fix watch
performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Brad White
<brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/211145","number":211145,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191106","number":191106,"mergeCommit":{"message":"chore(NA):
upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes
#89741\r\n\r\nThis PR contains the resulting work of a massive effort
that ports our\r\non top bundler abstraction (called @kbn/optimizer)
from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term
maintenance since v4\r\nwas not receiving updates any longer but will
also unblock some new\r\nfeatures that could be beneficial for our
future DevEx endeavours.\r\n\r\nNext you can find a small list of all
the accomplished tasks on this\r\njourney.\r\n\r\n### Completed
Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n-
[x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix
file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix
`@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt
previous webpack v4 polyfill-all strategy
with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on
@kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options
on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest
resolver for file-loader cases\r\n- [x] Migrate public-path loader on
UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate
BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x]
Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate
BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work
(--profile flag)\r\n- [x] Recover if possible the previous webpack v4
cacheGroup chunks\r\nrename to something like
`data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our
first green CI, otherwise work\r\non the errors until we do\r\n- [x]
Profile and solve bottlenecks until we get a cold build\r\nperformance
similar to the one we had on webpack v4
(`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x]
OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n`
flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing
`NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin))
and\r\nadd each polyfill needed individually per each webpack config to
check\r\nif we get smaller bundles. If we do it's better to go with the
case by\r\ncase need approach instead of deploying a bunch of polyfills
with\r\nNodePolyfillPlugin. As another alternative, create a custom
smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x]
Evaluate if we want to touch the resolutions on mainFields
and\r\nconditionNames\r\n- [x] Understand why `@import
'src/core/public/mixins'` does not work\r\nanymore (not a problem, we
should use relative paths anyway but we want\r\nto track why it changed
from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden
and/or changed from\r\nerror to warning\r\n- [x] Fix license check
for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is
the\r\nlicense
for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis
package is a dependency
of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic
2.0 license is [classified
as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand
should only be used for dev dependencies.\r\n- [x] Make sure
`resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack
configs like storybook one\r\n- [x] Find what is being wrongly removed
by usedExports optimization;\r\nhint: I believe it is identifying a lot
of exports inside the sync entry\r\nof plugins as unused exports and
removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x]
Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue
to fix
sass-warnings\r\n[#190345](https://github.com/elastic/kibana/issues/190345)
or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse
rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console
override is needed\r\n- [x] Confirm react prod builds on ui shared deps
for distributable\r\n- [x] Remove customization
for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack
configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics
from stats are still aligned with what\r\nwe were collecting before;
also verify if the modules used for optimizer\r\ncaches etc are well
generated (@kbn/node-libs-browser)\r\n- [x] Fix watch
performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Brad White
<brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1"}},{"url":"https://github.com/elastic/kibana/pull/211146","number":211146,"branch":"8.x","state":"OPEN"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-14 13:36:18 +00:00
Catherine Liu
6fdd9fc9d7
[8.x] [Embeddable] EUI Visual Refresh Integration (#204452) (#208565)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Embeddable] EUI Visual Refresh Integration
(#204452)](https://github.com/elastic/kibana/pull/204452)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Catherine
Liu","email":"catherine.liu@elastic.co"},"sourceCommit":{"committedDate":"2024-12-19T18:12:09Z","message":"[Embeddable]
EUI Visual Refresh Integration (#204452)\n\n## Summary\r\n\r\nRelated to
https://github.com/elastic/kibana/issues/203132.\r\nPart of
[#204596](https://github.com/elastic/kibana/issues/204596).\r\n\r\nThis
replaces all references to euiThemeVars in favor of the
useEuiTheme\r\nhook.\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies
following conditions. \r\n\r\nReviewers should verify this PR satisfies
this list as well.\r\n\r\n- [ ] 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-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [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- [ ] If a plugin
configuration key changed, check if it needs to be\r\nallowlisted in the
cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\r\nchanges have been approved by the breaking-change committee.
The\r\n`release_note:breaking` label should be applied in these
situations.\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] 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###
Identify risks\r\n\r\nDoes this PR introduce any risks? For example,
consider risks like hard\r\nto test bugs, performance regression,
potential of data loss.\r\n\r\nDescribe the risk, its severity, and
mitigation for each identified\r\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\r\n\r\n- [ ] [See some
risk\r\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\r\n-
[ ] ...\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"b80980694a30f957fbd97dc57f16334daf59850d","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:skip","backport:skip","v9.0.0","Feature:Embeddables","backport:version"],"title":"[Embeddable]
EUI Visual Refresh
Integration","number":204452,"url":"https://github.com/elastic/kibana/pull/204452","mergeCommit":{"message":"[Embeddable]
EUI Visual Refresh Integration (#204452)\n\n## Summary\r\n\r\nRelated to
https://github.com/elastic/kibana/issues/203132.\r\nPart of
[#204596](https://github.com/elastic/kibana/issues/204596).\r\n\r\nThis
replaces all references to euiThemeVars in favor of the
useEuiTheme\r\nhook.\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies
following conditions. \r\n\r\nReviewers should verify this PR satisfies
this list as well.\r\n\r\n- [ ] 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-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [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- [ ] If a plugin
configuration key changed, check if it needs to be\r\nallowlisted in the
cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\r\nchanges have been approved by the breaking-change committee.
The\r\n`release_note:breaking` label should be applied in these
situations.\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] 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###
Identify risks\r\n\r\nDoes this PR introduce any risks? For example,
consider risks like hard\r\nto test bugs, performance regression,
potential of data loss.\r\n\r\nDescribe the risk, its severity, and
mitigation for each identified\r\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\r\n\r\n- [ ] [See some
risk\r\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\r\n-
[ ] ...\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"b80980694a30f957fbd97dc57f16334daf59850d"}},"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/204452","number":204452,"mergeCommit":{"message":"[Embeddable]
EUI Visual Refresh Integration (#204452)\n\n## Summary\r\n\r\nRelated to
https://github.com/elastic/kibana/issues/203132.\r\nPart of
[#204596](https://github.com/elastic/kibana/issues/204596).\r\n\r\nThis
replaces all references to euiThemeVars in favor of the
useEuiTheme\r\nhook.\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies
following conditions. \r\n\r\nReviewers should verify this PR satisfies
this list as well.\r\n\r\n- [ ] 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-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [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- [ ] If a plugin
configuration key changed, check if it needs to be\r\nallowlisted in the
cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\r\nchanges have been approved by the breaking-change committee.
The\r\n`release_note:breaking` label should be applied in these
situations.\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] 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###
Identify risks\r\n\r\nDoes this PR introduce any risks? For example,
consider risks like hard\r\nto test bugs, performance regression,
potential of data loss.\r\n\r\nDescribe the risk, its severity, and
mitigation for each identified\r\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\r\n\r\n- [ ] [See some
risk\r\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\r\n-
[ ] ...\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"b80980694a30f957fbd97dc57f16334daf59850d"}}]}]
BACKPORT-->
2025-01-29 14:47:30 -05:00
Nathan Reese
c39e129298
[8.x] [embeddable] make presentation interface names consistent (#205279) (#207881)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[embeddable] make presentation interface names consistent
(#205279)](https://github.com/elastic/kibana/pull/205279)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2025-01-22T16:46:01Z","message":"[embeddable]
make presentation interface names consistent (#205279)\n\nPR cleans up
presentation interface names for consistentency\r\n* adds `# Backport

This will backport the following commits from `main` to `8.x`:
- [[embeddable] make presentation interface names consistent
(#205279)](https://github.com/elastic/kibana/pull/205279)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT suffix to all observables. For example, `dataLoading`
=>\r\n`dataLoading# Backport

This will backport the following commits from `main` to `8.x`:
- [[embeddable] make presentation interface names consistent
(#205279)](https://github.com/elastic/kibana/pull/205279)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT \r\n* removes `Panel` naming convention from interface
names since an api\r\nmay not be a panel, an api may be a dashboard. For
example,\r\n`PublisesPanelTitle` => `PublishesTitle`\r\n\r\n#### Note to
Reviewers\r\nPay special attention to any place where your application
creates an\r\nuntyped API. In the example below, there is no typescript
violation when\r\nthe parent returns `dataLoading` instead of
`dataLoading# Backport

This will backport the following commits from `main` to `8.x`:
- [[embeddable] make presentation interface names consistent
(#205279)](https://github.com/elastic/kibana/pull/205279)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT since the\r\nparent is not typed as `PublishesDataLoading`.
Please check for\r\ninstances like
these.\r\n\r\n```\r\n<ReactEmbeddableRenderer\r\n getParentApi={() =>
{\r\n dataLoading: new BehaviorSubject()\r\n
}}\r\n/>\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"05916056cdc84c0f59392046aa4ffc7d16e083f9","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Embedding","Team:Presentation","release_note:skip","Feature:Drilldowns","v9.0.0","Team:obs-ux-infra_services","Team:obs-ux-management","project:embeddableRebuild","backport:version","v8.18.0"],"title":"[embeddable]
make presentation interface names
consistent","number":205279,"url":"https://github.com/elastic/kibana/pull/205279","mergeCommit":{"message":"[embeddable]
make presentation interface names consistent (#205279)\n\nPR cleans up
presentation interface names for consistentency\r\n* adds `# Backport

This will backport the following commits from `main` to `8.x`:
- [[embeddable] make presentation interface names consistent
(#205279)](https://github.com/elastic/kibana/pull/205279)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT suffix to all observables. For example, `dataLoading`
=>\r\n`dataLoading# Backport

This will backport the following commits from `main` to `8.x`:
- [[embeddable] make presentation interface names consistent
(#205279)](https://github.com/elastic/kibana/pull/205279)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT \r\n* removes `Panel` naming convention from interface
names since an api\r\nmay not be a panel, an api may be a dashboard. For
example,\r\n`PublisesPanelTitle` => `PublishesTitle`\r\n\r\n#### Note to
Reviewers\r\nPay special attention to any place where your application
creates an\r\nuntyped API. In the example below, there is no typescript
violation when\r\nthe parent returns `dataLoading` instead of
`dataLoading# Backport

This will backport the following commits from `main` to `8.x`:
- [[embeddable] make presentation interface names consistent
(#205279)](https://github.com/elastic/kibana/pull/205279)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT since the\r\nparent is not typed as `PublishesDataLoading`.
Please check for\r\ninstances like
these.\r\n\r\n```\r\n<ReactEmbeddableRenderer\r\n getParentApi={() =>
{\r\n dataLoading: new BehaviorSubject()\r\n
}}\r\n/>\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"05916056cdc84c0f59392046aa4ffc7d16e083f9"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205279","number":205279,"mergeCommit":{"message":"[embeddable]
make presentation interface names consistent (#205279)\n\nPR cleans up
presentation interface names for consistentency\r\n* adds `# Backport

This will backport the following commits from `main` to `8.x`:
- [[embeddable] make presentation interface names consistent
(#205279)](https://github.com/elastic/kibana/pull/205279)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT suffix to all observables. For example, `dataLoading`
=>\r\n`dataLoading# Backport

This will backport the following commits from `main` to `8.x`:
- [[embeddable] make presentation interface names consistent
(#205279)](https://github.com/elastic/kibana/pull/205279)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT \r\n* removes `Panel` naming convention from interface
names since an api\r\nmay not be a panel, an api may be a dashboard. For
example,\r\n`PublisesPanelTitle` => `PublishesTitle`\r\n\r\n#### Note to
Reviewers\r\nPay special attention to any place where your application
creates an\r\nuntyped API. In the example below, there is no typescript
violation when\r\nthe parent returns `dataLoading` instead of
`dataLoading# Backport

This will backport the following commits from `main` to `8.x`:
- [[embeddable] make presentation interface names consistent
(#205279)](https://github.com/elastic/kibana/pull/205279)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT since the\r\nparent is not typed as `PublishesDataLoading`.
Please check for\r\ninstances like
these.\r\n\r\n```\r\n<ReactEmbeddableRenderer\r\n getParentApi={() =>
{\r\n dataLoading: new BehaviorSubject()\r\n
}}\r\n/>\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"05916056cdc84c0f59392046aa4ffc7d16e083f9"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
2025-01-22 18:26:52 +00:00
Devon Thomson
13d328677e
[8.x] [Serialized state only] Update Library Transforms and Duplicate (#206140) (#207455)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Serialized state only] Update Library Transforms and Duplicate
(#206140)](https://github.com/elastic/kibana/pull/206140)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Devon
Thomson","email":"devon.thomson@elastic.co"},"sourceCommit":{"committedDate":"2025-01-21T18:43:43Z","message":"[Serialized
state only] Update Library Transforms and Duplicate (#206140)\n\nUnifies
the various `LibraryTransforms` interfaces, updates all by reference
capable embeddables to use them in the same way, and migrates the clone
functionality to use only serialized
state.","sha":"3719be0144d0f5b1fc71d1c564a41446c8ef3133","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Embedding","release_note:fix","Team:Presentation","v9.0.0","backport:prev-minor","Feature:Embeddables","project:embeddableRebuild"],"title":"[Serialized
state only] Update Library Transforms and
Duplicate","number":206140,"url":"https://github.com/elastic/kibana/pull/206140","mergeCommit":{"message":"[Serialized
state only] Update Library Transforms and Duplicate (#206140)\n\nUnifies
the various `LibraryTransforms` interfaces, updates all by reference
capable embeddables to use them in the same way, and migrates the clone
functionality to use only serialized
state.","sha":"3719be0144d0f5b1fc71d1c564a41446c8ef3133"}},"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/206140","number":206140,"mergeCommit":{"message":"[Serialized
state only] Update Library Transforms and Duplicate (#206140)\n\nUnifies
the various `LibraryTransforms` interfaces, updates all by reference
capable embeddables to use them in the same way, and migrates the clone
functionality to use only serialized
state.","sha":"3719be0144d0f5b1fc71d1c564a41446c8ef3133"}}]}]
BACKPORT-->
2025-01-21 23:35:16 +00:00
Nathan Reese
d3b8955f0b
[8.x] [uiActions] make trigger action registry async (#205512) (#206480)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[uiActions] make trigger action registry async
(#205512)](https://github.com/elastic/kibana/pull/205512)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2025-01-13T16:57:34Z","message":"[uiActions]
make trigger action registry async (#205512)\n\nCloses
https://github.com/elastic/kibana/issues/191642, part
of\r\nhttps://github.com/elastic/kibana/pull/205512\r\n\r\nPR makes the
following changes to uiActions API.\r\n* Deprecates `registerAction` and
`addTriggerAction` and replaces them\r\nwith `registerActionAsync` and
`addTriggerActionAsync`\r\n* Makes all registry consumption methods
async, such as `getAction`,\r\n`getTriggerActions` and
`getFrequentlyChangingActionsForTrigger`\r\n\r\nPR updates
presentation_panel plugin to use `registerActionAsync`. With\r\nactions
behind async import, page load bundle size has been reduced
by\r\n21.1KB.\r\n\r\n<img width=\"500\" alt=\"Screenshot 2025-01-08 at 2
14
23 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/34a2cae9-dc5e-429b-bbdb-ffd9dfe1cce3\"\r\n/>\r\n\r\nAlso,
async exports are [contained in a single
file\r\n`panel_module`](https://github.com/elastic/kibana/issues/206117).
This\r\nresults in dashboard only loading one
`presentationPanel.chunk`.\r\n\r\n<img width=\"500\" alt=\"Screenshot
2025-01-08 at 2 15
02 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/e083b852-b50d-4fa7-8ebd-e2f56f85e998\"\r\n/>\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"1bd8c97982146a4643d6eca1e21b525a5c8d456f","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:skip","v9.0.0","backport:version","v8.18.0"],"number":205512,"url":"https://github.com/elastic/kibana/pull/205512","mergeCommit":{"message":"[uiActions]
make trigger action registry async (#205512)\n\nCloses
https://github.com/elastic/kibana/issues/191642, part
of\r\nhttps://github.com/elastic/kibana/pull/205512\r\n\r\nPR makes the
following changes to uiActions API.\r\n* Deprecates `registerAction` and
`addTriggerAction` and replaces them\r\nwith `registerActionAsync` and
`addTriggerActionAsync`\r\n* Makes all registry consumption methods
async, such as `getAction`,\r\n`getTriggerActions` and
`getFrequentlyChangingActionsForTrigger`\r\n\r\nPR updates
presentation_panel plugin to use `registerActionAsync`. With\r\nactions
behind async import, page load bundle size has been reduced
by\r\n21.1KB.\r\n\r\n<img width=\"500\" alt=\"Screenshot 2025-01-08 at 2
14
23 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/34a2cae9-dc5e-429b-bbdb-ffd9dfe1cce3\"\r\n/>\r\n\r\nAlso,
async exports are [contained in a single
file\r\n`panel_module`](https://github.com/elastic/kibana/issues/206117).
This\r\nresults in dashboard only loading one
`presentationPanel.chunk`.\r\n\r\n<img width=\"500\" alt=\"Screenshot
2025-01-08 at 2 15
02 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/e083b852-b50d-4fa7-8ebd-e2f56f85e998\"\r\n/>\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"1bd8c97982146a4643d6eca1e21b525a5c8d456f"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205512","number":205512,"mergeCommit":{"message":"[uiActions]
make trigger action registry async (#205512)\n\nCloses
https://github.com/elastic/kibana/issues/191642, part
of\r\nhttps://github.com/elastic/kibana/pull/205512\r\n\r\nPR makes the
following changes to uiActions API.\r\n* Deprecates `registerAction` and
`addTriggerAction` and replaces them\r\nwith `registerActionAsync` and
`addTriggerActionAsync`\r\n* Makes all registry consumption methods
async, such as `getAction`,\r\n`getTriggerActions` and
`getFrequentlyChangingActionsForTrigger`\r\n\r\nPR updates
presentation_panel plugin to use `registerActionAsync`. With\r\nactions
behind async import, page load bundle size has been reduced
by\r\n21.1KB.\r\n\r\n<img width=\"500\" alt=\"Screenshot 2025-01-08 at 2
14
23 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/34a2cae9-dc5e-429b-bbdb-ffd9dfe1cce3\"\r\n/>\r\n\r\nAlso,
async exports are [contained in a single
file\r\n`panel_module`](https://github.com/elastic/kibana/issues/206117).
This\r\nresults in dashboard only loading one
`presentationPanel.chunk`.\r\n\r\n<img width=\"500\" alt=\"Screenshot
2025-01-08 at 2 15
02 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/e083b852-b50d-4fa7-8ebd-e2f56f85e998\"\r\n/>\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"1bd8c97982146a4643d6eca1e21b525a5c8d456f"}},{"branch":"8.x","label":"v8.18.0","labelRegex":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
2025-01-13 18:53:38 +00:00
Kibana Machine
0862bdef38
[8.x] [Embeddables Rebuild] Make Serialize Function Synchronous (#203662) (#204470)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Embeddables Rebuild] Make Serialize Function Synchronous
(#203662)](https://github.com/elastic/kibana/pull/203662)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Devon
Thomson","email":"devon.thomson@elastic.co"},"sourceCommit":{"committedDate":"2024-12-13T02:25:03Z","message":"[Embeddables
Rebuild] Make Serialize Function Synchronous (#203662)\n\nchanges the
signature of the `serializeState` function so that\r\nit no longer
returns
MaybePromise","sha":"abfd590d4d6420da63d129757120e08278ac3211","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Embedding","Team:Presentation","loe:medium","release_note:skip","impact:high","v9.0.0","backport:prev-minor","Feature:Embeddables","project:embeddableRebuild"],"title":"[Embeddables
Rebuild] Make Serialize Function
Synchronous","number":203662,"url":"https://github.com/elastic/kibana/pull/203662","mergeCommit":{"message":"[Embeddables
Rebuild] Make Serialize Function Synchronous (#203662)\n\nchanges the
signature of the `serializeState` function so that\r\nit no longer
returns
MaybePromise","sha":"abfd590d4d6420da63d129757120e08278ac3211"}},"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/203662","number":203662,"mergeCommit":{"message":"[Embeddables
Rebuild] Make Serialize Function Synchronous (#203662)\n\nchanges the
signature of the `serializeState` function so that\r\nit no longer
returns
MaybePromise","sha":"abfd590d4d6420da63d129757120e08278ac3211"}}]}]
BACKPORT-->

Co-authored-by: Devon Thomson <devon.thomson@elastic.co>
2024-12-17 12:33:00 -07:00
Kibana Machine
6e12acb428
[8.x] Preparation for High Contrast Mode, Analytics Experience domains (#202608) (#204120)
# Backport

This will backport the following commits from `main` to `8.x`:
- [Preparation for High Contrast Mode, Analytics Experience domains
(#202608)](https://github.com/elastic/kibana/pull/202608)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Tim
Sullivan","email":"tsullivan@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-12-12T19:16:07Z","message":"Preparation
for High Contrast Mode, Analytics Experience domains (#202608)\n\n##
Summary\r\n\r\n**Reviewers: Please test the code paths affected by this
PR. See the\r\n\"Risks\" section below.**\r\n\r\nPart of work for
enabling \"high contrast mode\" in Kibana.
See\r\nhttps://github.com/elastic/kibana/issues/176219.\r\n\r\n**Background:**\r\nKibana
will soon have a user profile setting to allow users to enable\r\n\"high
contrast mode.\" This setting will activate a flag
with\r\n`<EuiProvider>` that causes EUI components to render with
higher\r\ncontrast visual elements. Consumer plugins and packages need
to be\r\nupdated selected places where `<EuiProvider>` is wrapped, to
pass the\r\n`UserProfileService` service dependency from the CoreStart
contract.\r\n\r\n**NOTE:** **EUI currently does not yet support the
high-contrast mode\r\nflag**, but support for that is expected to come
in around 2 weeks.\r\nThese first PRs are simply preparing the code by
wiring up the\r\n`UserProvideService`.\r\n\r\n### Checklist\r\n\r\nCheck
the PR satisfies following conditions. \r\n\r\nReviewers should verify
this PR satisfies this list as well.\r\n\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###
Risks\r\n\r\nDoes this PR introduce any risks? For example, consider
risks like hard\r\nto test bugs, performance regression, potential of
data loss.\r\n\r\nDescribe the risk, its severity, and mitigation for
each identified\r\nrisk. Invite stakeholders and evaluate how to proceed
before merging.\r\n\r\n- [ ] [medium/high] The implementor of this
change did not manually test\r\nthe affected code paths and relied on
type-checking and functional tests\r\nto drive the changes. Code owners
for this PR need to manually test the\r\naffected code paths.\r\n- [ ]
[medium] The `UserProfileService` dependency comes from the\r\nCoreStart
contract. If acquiring the service causes synchronous code to\r\nbecome
asynchronous, check for race conditions or errors in rendering\r\nReact
components. Code owners for this PR need to manually test
the\r\naffected code paths.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"99aa884fa08beafd801588c0b38194ec03039008","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","Team:Visualizations","release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-minor","v8.18.0"],"title":"Preparation
for High Contrast Mode, Analytics Experience
domains","number":202608,"url":"https://github.com/elastic/kibana/pull/202608","mergeCommit":{"message":"Preparation
for High Contrast Mode, Analytics Experience domains (#202608)\n\n##
Summary\r\n\r\n**Reviewers: Please test the code paths affected by this
PR. See the\r\n\"Risks\" section below.**\r\n\r\nPart of work for
enabling \"high contrast mode\" in Kibana.
See\r\nhttps://github.com/elastic/kibana/issues/176219.\r\n\r\n**Background:**\r\nKibana
will soon have a user profile setting to allow users to enable\r\n\"high
contrast mode.\" This setting will activate a flag
with\r\n`<EuiProvider>` that causes EUI components to render with
higher\r\ncontrast visual elements. Consumer plugins and packages need
to be\r\nupdated selected places where `<EuiProvider>` is wrapped, to
pass the\r\n`UserProfileService` service dependency from the CoreStart
contract.\r\n\r\n**NOTE:** **EUI currently does not yet support the
high-contrast mode\r\nflag**, but support for that is expected to come
in around 2 weeks.\r\nThese first PRs are simply preparing the code by
wiring up the\r\n`UserProvideService`.\r\n\r\n### Checklist\r\n\r\nCheck
the PR satisfies following conditions. \r\n\r\nReviewers should verify
this PR satisfies this list as well.\r\n\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###
Risks\r\n\r\nDoes this PR introduce any risks? For example, consider
risks like hard\r\nto test bugs, performance regression, potential of
data loss.\r\n\r\nDescribe the risk, its severity, and mitigation for
each identified\r\nrisk. Invite stakeholders and evaluate how to proceed
before merging.\r\n\r\n- [ ] [medium/high] The implementor of this
change did not manually test\r\nthe affected code paths and relied on
type-checking and functional tests\r\nto drive the changes. Code owners
for this PR need to manually test the\r\naffected code paths.\r\n- [ ]
[medium] The `UserProfileService` dependency comes from the\r\nCoreStart
contract. If acquiring the service causes synchronous code to\r\nbecome
asynchronous, check for race conditions or errors in rendering\r\nReact
components. Code owners for this PR need to manually test
the\r\naffected code paths.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"99aa884fa08beafd801588c0b38194ec03039008"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202608","number":202608,"mergeCommit":{"message":"Preparation
for High Contrast Mode, Analytics Experience domains (#202608)\n\n##
Summary\r\n\r\n**Reviewers: Please test the code paths affected by this
PR. See the\r\n\"Risks\" section below.**\r\n\r\nPart of work for
enabling \"high contrast mode\" in Kibana.
See\r\nhttps://github.com/elastic/kibana/issues/176219.\r\n\r\n**Background:**\r\nKibana
will soon have a user profile setting to allow users to enable\r\n\"high
contrast mode.\" This setting will activate a flag
with\r\n`<EuiProvider>` that causes EUI components to render with
higher\r\ncontrast visual elements. Consumer plugins and packages need
to be\r\nupdated selected places where `<EuiProvider>` is wrapped, to
pass the\r\n`UserProfileService` service dependency from the CoreStart
contract.\r\n\r\n**NOTE:** **EUI currently does not yet support the
high-contrast mode\r\nflag**, but support for that is expected to come
in around 2 weeks.\r\nThese first PRs are simply preparing the code by
wiring up the\r\n`UserProvideService`.\r\n\r\n### Checklist\r\n\r\nCheck
the PR satisfies following conditions. \r\n\r\nReviewers should verify
this PR satisfies this list as well.\r\n\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###
Risks\r\n\r\nDoes this PR introduce any risks? For example, consider
risks like hard\r\nto test bugs, performance regression, potential of
data loss.\r\n\r\nDescribe the risk, its severity, and mitigation for
each identified\r\nrisk. Invite stakeholders and evaluate how to proceed
before merging.\r\n\r\n- [ ] [medium/high] The implementor of this
change did not manually test\r\nthe affected code paths and relied on
type-checking and functional tests\r\nto drive the changes. Code owners
for this PR need to manually test the\r\naffected code paths.\r\n- [ ]
[medium] The `UserProfileService` dependency comes from the\r\nCoreStart
contract. If acquiring the service causes synchronous code to\r\nbecome
asynchronous, check for race conditions or errors in rendering\r\nReact
components. Code owners for this PR need to manually test
the\r\naffected code paths.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"99aa884fa08beafd801588c0b38194ec03039008"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
2024-12-12 15:08:55 -06:00
Kibana Machine
d223cd7df5
[8.x] [Dashboard] [Collapsable Panels] Add embeddable support (#198413) (#203652)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Dashboard] [Collapsable Panels] Add embeddable support
(#198413)](https://github.com/elastic/kibana/pull/198413)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Hannah
Mudge","email":"Heenawter@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-12-10T17:14:31Z","message":"[Dashboard]
[Collapsable Panels] Add embeddable support (#198413)\n\nCloses
https://github.com/elastic/kibana/issues/190379\r\n\r\n##
Summary\r\n\r\nThis PR switches the example grid layout app to render
embeddables as\r\npanels rather than the simplified mock panel we were
using previously.\r\nIn doing so, I had to add the ability for custom
panels to add a custom\r\ndrag handle via the `renderPanelContents`
callback - this required\r\nadding a `setDragHandles` callback to the
`ReactEmbeddableRenderer` that\r\ncould be passed down to the
`PresentationPanel`
component.\r\n\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/9e2c68f9-34af-4360-a978-9113701a5ea2\r\n\r\n\r\n\r\n####
New scroll behaviour\r\n\r\nIn
https://github.com/elastic/kibana/pull/201867, I introduced a
small\r\n\"ease\" to the auto-scroll effect that happens when you drag a
panel to\r\nthe top or bottom of the window. However, in that PR, I was
using the\r\n`smooth` scrolling behaviour, which unfortunately became
**very**\r\njittery once I switched to embeddables rather than simple
panels\r\n(specifically in Chrome - it worked fine in
Firefox).\r\n\r\nThe only way to prevent this jittery scroll was to
switch to the default\r\nscroll behaviour, but this lead to a very
**abrupt** stop when the\r\nscrollbar reached the top and/or bottom of
the page - so, to give the\r\nsame \"gentle\" stop that the `smooth`
scroll had, I decided to recreate\r\nthis effect by adding a slow down
\"ease\" when close to the top or bottom\r\nof the
page:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/cb7bf03f-4a9e-4446-be4f-8f54c0bc88ac\r\n\r\nThis
effect is accomplished via the parabola formula `y = a(x-h)2 + k`\r\nand
can be roughly visualized with the following, which shows that
the\r\n\"speed up\" ease happens at a much slower pace than the \"slow
down\"
ease:\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/02b4389c-fe78-448d-9c02-c4ec5e722d5e)\r\n\r\n\r\n\r\n\r\n####
Notes about parent changes\r\nAs I investigated improving the efficiency
of the grid layout with\r\nembeddables, one of the main things I noticed
was that the grid panel\r\nwas **always** remounted when moving a panel
from one collapsible\r\nsection to another. This lead me (and
@ThomThomson) down a rabbit hole\r\nof React-reparenting, and we
explored a few different options to see if\r\nwe could change the parent
of a component **without** having it remount.\r\n\r\nIn summary, after
various experiments and a whole bunch of research, we\r\ndetermined
that, due to the reconciliation of the React tree, this
is\r\nunfortunately impossible. So our priorities will instead have to
move to\r\nmaking the remount of `ReactEmbeddableRenderer` **as
efficient as\r\npossible** via caching, since the remount is
inevitable.\r\n\r\n### Checklist\r\n\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###
Identify risks\r\n\r\nThere are no risks to this PR, since the most
significant work is\r\ncontained in the `examples` plugin. Some changes
were made to the\r\npresentation panel to allow for custom drag handles,
but this isn't\r\nactually used in Dashboard - so for now, this code is
only called in the\r\nexample plugin, as
well.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"2a76fe3ee432d0b6746eae660cfe31fc71d15547","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Dashboard","Feature:Embedding","Team:Presentation","loe:medium","release_note:skip","impact:high","v9.0.0","backport:prev-minor","Project:Collapsable
Panels"],"title":"[Dashboard] [Collapsable Panels] Add embeddable
support","number":198413,"url":"https://github.com/elastic/kibana/pull/198413","mergeCommit":{"message":"[Dashboard]
[Collapsable Panels] Add embeddable support (#198413)\n\nCloses
https://github.com/elastic/kibana/issues/190379\r\n\r\n##
Summary\r\n\r\nThis PR switches the example grid layout app to render
embeddables as\r\npanels rather than the simplified mock panel we were
using previously.\r\nIn doing so, I had to add the ability for custom
panels to add a custom\r\ndrag handle via the `renderPanelContents`
callback - this required\r\nadding a `setDragHandles` callback to the
`ReactEmbeddableRenderer` that\r\ncould be passed down to the
`PresentationPanel`
component.\r\n\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/9e2c68f9-34af-4360-a978-9113701a5ea2\r\n\r\n\r\n\r\n####
New scroll behaviour\r\n\r\nIn
https://github.com/elastic/kibana/pull/201867, I introduced a
small\r\n\"ease\" to the auto-scroll effect that happens when you drag a
panel to\r\nthe top or bottom of the window. However, in that PR, I was
using the\r\n`smooth` scrolling behaviour, which unfortunately became
**very**\r\njittery once I switched to embeddables rather than simple
panels\r\n(specifically in Chrome - it worked fine in
Firefox).\r\n\r\nThe only way to prevent this jittery scroll was to
switch to the default\r\nscroll behaviour, but this lead to a very
**abrupt** stop when the\r\nscrollbar reached the top and/or bottom of
the page - so, to give the\r\nsame \"gentle\" stop that the `smooth`
scroll had, I decided to recreate\r\nthis effect by adding a slow down
\"ease\" when close to the top or bottom\r\nof the
page:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/cb7bf03f-4a9e-4446-be4f-8f54c0bc88ac\r\n\r\nThis
effect is accomplished via the parabola formula `y = a(x-h)2 + k`\r\nand
can be roughly visualized with the following, which shows that
the\r\n\"speed up\" ease happens at a much slower pace than the \"slow
down\"
ease:\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/02b4389c-fe78-448d-9c02-c4ec5e722d5e)\r\n\r\n\r\n\r\n\r\n####
Notes about parent changes\r\nAs I investigated improving the efficiency
of the grid layout with\r\nembeddables, one of the main things I noticed
was that the grid panel\r\nwas **always** remounted when moving a panel
from one collapsible\r\nsection to another. This lead me (and
@ThomThomson) down a rabbit hole\r\nof React-reparenting, and we
explored a few different options to see if\r\nwe could change the parent
of a component **without** having it remount.\r\n\r\nIn summary, after
various experiments and a whole bunch of research, we\r\ndetermined
that, due to the reconciliation of the React tree, this
is\r\nunfortunately impossible. So our priorities will instead have to
move to\r\nmaking the remount of `ReactEmbeddableRenderer` **as
efficient as\r\npossible** via caching, since the remount is
inevitable.\r\n\r\n### Checklist\r\n\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###
Identify risks\r\n\r\nThere are no risks to this PR, since the most
significant work is\r\ncontained in the `examples` plugin. Some changes
were made to the\r\npresentation panel to allow for custom drag handles,
but this isn't\r\nactually used in Dashboard - so for now, this code is
only called in the\r\nexample plugin, as
well.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"2a76fe3ee432d0b6746eae660cfe31fc71d15547"}},"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/198413","number":198413,"mergeCommit":{"message":"[Dashboard]
[Collapsable Panels] Add embeddable support (#198413)\n\nCloses
https://github.com/elastic/kibana/issues/190379\r\n\r\n##
Summary\r\n\r\nThis PR switches the example grid layout app to render
embeddables as\r\npanels rather than the simplified mock panel we were
using previously.\r\nIn doing so, I had to add the ability for custom
panels to add a custom\r\ndrag handle via the `renderPanelContents`
callback - this required\r\nadding a `setDragHandles` callback to the
`ReactEmbeddableRenderer` that\r\ncould be passed down to the
`PresentationPanel`
component.\r\n\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/9e2c68f9-34af-4360-a978-9113701a5ea2\r\n\r\n\r\n\r\n####
New scroll behaviour\r\n\r\nIn
https://github.com/elastic/kibana/pull/201867, I introduced a
small\r\n\"ease\" to the auto-scroll effect that happens when you drag a
panel to\r\nthe top or bottom of the window. However, in that PR, I was
using the\r\n`smooth` scrolling behaviour, which unfortunately became
**very**\r\njittery once I switched to embeddables rather than simple
panels\r\n(specifically in Chrome - it worked fine in
Firefox).\r\n\r\nThe only way to prevent this jittery scroll was to
switch to the default\r\nscroll behaviour, but this lead to a very
**abrupt** stop when the\r\nscrollbar reached the top and/or bottom of
the page - so, to give the\r\nsame \"gentle\" stop that the `smooth`
scroll had, I decided to recreate\r\nthis effect by adding a slow down
\"ease\" when close to the top or bottom\r\nof the
page:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/cb7bf03f-4a9e-4446-be4f-8f54c0bc88ac\r\n\r\nThis
effect is accomplished via the parabola formula `y = a(x-h)2 + k`\r\nand
can be roughly visualized with the following, which shows that
the\r\n\"speed up\" ease happens at a much slower pace than the \"slow
down\"
ease:\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/02b4389c-fe78-448d-9c02-c4ec5e722d5e)\r\n\r\n\r\n\r\n\r\n####
Notes about parent changes\r\nAs I investigated improving the efficiency
of the grid layout with\r\nembeddables, one of the main things I noticed
was that the grid panel\r\nwas **always** remounted when moving a panel
from one collapsible\r\nsection to another. This lead me (and
@ThomThomson) down a rabbit hole\r\nof React-reparenting, and we
explored a few different options to see if\r\nwe could change the parent
of a component **without** having it remount.\r\n\r\nIn summary, after
various experiments and a whole bunch of research, we\r\ndetermined
that, due to the reconciliation of the React tree, this
is\r\nunfortunately impossible. So our priorities will instead have to
move to\r\nmaking the remount of `ReactEmbeddableRenderer` **as
efficient as\r\npossible** via caching, since the remount is
inevitable.\r\n\r\n### Checklist\r\n\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###
Identify risks\r\n\r\nThere are no risks to this PR, since the most
significant work is\r\ncontained in the `examples` plugin. Some changes
were made to the\r\npresentation panel to allow for custom drag handles,
but this isn't\r\nactually used in Dashboard - so for now, this code is
only called in the\r\nexample plugin, as
well.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"2a76fe3ee432d0b6746eae660cfe31fc71d15547"}}]}]
BACKPORT-->

Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
2024-12-10 13:12:29 -06:00
Kibana Machine
b935f644f1
[8.x] [dashboard] Do not reset panel to undefined or empty last saved state (#203158) (#203512)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[dashboard] Do not reset panel to undefined or empty last saved state
(#203158)](https://github.com/elastic/kibana/pull/203158)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2024-12-10T03:04:15Z","message":"[dashboard]
Do not reset panel to undefined or empty last saved state
(#203158)\n\nPart of
https://github.com/elastic/kibana/issues/201627\r\n\r\nThis is a short
term fix for serverless and 8.x branches (long term fix\r\nis an
architectural change that will only be merged into 9.0 and
8.18\r\nbranches).\r\n\r\nFix prevents users from reseting a panel
edited via embeddable transfer\r\nservice. This prevents panel from
getting into an invalid state.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"e103a253d9b756605dbeb92955ff517597055970","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","v9.0.0","project:embeddableRebuild","backport:version","v8.18.0","v8.16.2","v8.15.6","v8.17.1"],"title":"[dashboard]
Do not reset panel to undefined or empty last saved
state","number":203158,"url":"https://github.com/elastic/kibana/pull/203158","mergeCommit":{"message":"[dashboard]
Do not reset panel to undefined or empty last saved state
(#203158)\n\nPart of
https://github.com/elastic/kibana/issues/201627\r\n\r\nThis is a short
term fix for serverless and 8.x branches (long term fix\r\nis an
architectural change that will only be merged into 9.0 and
8.18\r\nbranches).\r\n\r\nFix prevents users from reseting a panel
edited via embeddable transfer\r\nservice. This prevents panel from
getting into an invalid state.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"e103a253d9b756605dbeb92955ff517597055970"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16","8.15","8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203158","number":203158,"mergeCommit":{"message":"[dashboard]
Do not reset panel to undefined or empty last saved state
(#203158)\n\nPart of
https://github.com/elastic/kibana/issues/201627\r\n\r\nThis is a short
term fix for serverless and 8.x branches (long term fix\r\nis an
architectural change that will only be merged into 9.0 and
8.18\r\nbranches).\r\n\r\nFix prevents users from reseting a panel
edited via embeddable transfer\r\nservice. This prevents panel from
getting into an invalid state.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"e103a253d9b756605dbeb92955ff517597055970"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
2024-12-09 22:52:12 -06:00
Kibana Machine
8bce4806ac
[8.x] [embeddable] remove legacy embeddable factories from &#x27;Add from library&#x27; flyout (#202823) (#203181)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[embeddable] remove legacy embeddable factories from &#x27;Add from
library&#x27; flyout
(#202823)](https://github.com/elastic/kibana/pull/202823)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2024-12-05T19:55:40Z","message":"[embeddable]
remove legacy embeddable factories from 'Add from library' flyout
(#202823)\n\nPart of
https://github.com/elastic/kibana/issues/180059\r\n\r\nPR removes legacy
embeddable factory support from Canvas and Dashboard\r\n`Add from
library` flyout\r\n\r\nPR also does the following clean-ups\r\n1)
Renames folder, files, and component from `add_panel_flyout`
to\r\n`add_from_library_flyout`. When component was originally
created,\r\ndashboard `Add panel` button did not exist, and `Add from
library`\r\nbutton was called `Add panel`. Now that dashboard contains
`Add panel`\r\nand `Add from library` buttons, the old naming convention
is super\r\nconfusing and not longer lines up with the current UI.\r\n2)
moves registry to `add_from_library` folder so that the registry
is\r\nin closer proximity to its usage.\r\n2) Renames
`registerReactEmbeddableSavedObject` to\r\n`registerAddFromLibraryType`
because\r\n`registerReactEmbeddableSavedObject` does not clearly
specifying what\r\nthe registry
enables.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"d508b5da9ce4664565c1594d23688663eff66522","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Embedding","Team:Presentation","release_note:skip","v9.0.0","ci:project-deploy-observability","project:embeddableRebuild","backport:version","v8.18.0"],"title":"[embeddable]
remove legacy embeddable factories from 'Add from library'
flyout","number":202823,"url":"https://github.com/elastic/kibana/pull/202823","mergeCommit":{"message":"[embeddable]
remove legacy embeddable factories from 'Add from library' flyout
(#202823)\n\nPart of
https://github.com/elastic/kibana/issues/180059\r\n\r\nPR removes legacy
embeddable factory support from Canvas and Dashboard\r\n`Add from
library` flyout\r\n\r\nPR also does the following clean-ups\r\n1)
Renames folder, files, and component from `add_panel_flyout`
to\r\n`add_from_library_flyout`. When component was originally
created,\r\ndashboard `Add panel` button did not exist, and `Add from
library`\r\nbutton was called `Add panel`. Now that dashboard contains
`Add panel`\r\nand `Add from library` buttons, the old naming convention
is super\r\nconfusing and not longer lines up with the current UI.\r\n2)
moves registry to `add_from_library` folder so that the registry
is\r\nin closer proximity to its usage.\r\n2) Renames
`registerReactEmbeddableSavedObject` to\r\n`registerAddFromLibraryType`
because\r\n`registerReactEmbeddableSavedObject` does not clearly
specifying what\r\nthe registry
enables.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"d508b5da9ce4664565c1594d23688663eff66522"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202823","number":202823,"mergeCommit":{"message":"[embeddable]
remove legacy embeddable factories from 'Add from library' flyout
(#202823)\n\nPart of
https://github.com/elastic/kibana/issues/180059\r\n\r\nPR removes legacy
embeddable factory support from Canvas and Dashboard\r\n`Add from
library` flyout\r\n\r\nPR also does the following clean-ups\r\n1)
Renames folder, files, and component from `add_panel_flyout`
to\r\n`add_from_library_flyout`. When component was originally
created,\r\ndashboard `Add panel` button did not exist, and `Add from
library`\r\nbutton was called `Add panel`. Now that dashboard contains
`Add panel`\r\nand `Add from library` buttons, the old naming convention
is super\r\nconfusing and not longer lines up with the current UI.\r\n2)
moves registry to `add_from_library` folder so that the registry
is\r\nin closer proximity to its usage.\r\n2) Renames
`registerReactEmbeddableSavedObject` to\r\n`registerAddFromLibraryType`
because\r\n`registerReactEmbeddableSavedObject` does not clearly
specifying what\r\nthe registry
enables.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"d508b5da9ce4664565c1594d23688663eff66522"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
2024-12-05 15:52:24 -06:00
Kibana Machine
0a6ce8b153
[8.x] Fix various EuiFormControlLayout usages (#192779) (#193925)
# Backport

This will backport the following commits from `main` to `8.x`:
- [Fix various EuiFormControlLayout usages
(#192779)](https://github.com/elastic/kibana/pull/192779)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Cee
Chen","email":"549407+cee-chen@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-09-24T20:55:59Z","message":"Fix
various EuiFormControlLayout usages (#192779)\n\n## Summary\r\n\r\nThis
is a follow up to EUI's Emotion conversion
of\r\n**EuiFormControlLayout/Delimited**
(see\r\nhttps://github.com/elastic/kibana/pull/190752,\r\nhttps://github.com/elastic/eui/pull/7954,
and\r\nhttps://github.com/elastic/eui/pull/7957).\r\n\r\n> [!note]\r\n>
Please manually QA your team's affected form control(s) to
confirm\r\nthey still look and behave as expected and are non-broken.
The EUI team\r\nis not familiar enough with each plugin's setups to pull
down and QA\r\nthis PR ourselves.\r\n\r\nWhile QA testing the upgrade, I
noticed a few incorrect usages of\r\n**EuiFormControlLayout** but wanted
to wait until after the upgrade to\r\npush out fixes (to prevent
delaying the PR further). In general, here is\r\nEUI's [recommended
usage of
the\r\ncomponent](https://eui.elastic.co/#/forms/form-controls#form-control-layout):\r\n\r\n-
Where possible, **simply don't use it**. Almost all form controls
are\r\n**already** automatically wrapped in any EuiFormControlLayout
by\r\ndefault, and should accept a large majority of the props that the
layout\r\naccepts.\r\n- If you **must** use it, set the `controlOnly`
prop on the child\r\ninput/control to avoid buggy styling (e.g.
duplicate borders).\r\n- If you can't do either of the above for any
reason (e.g. missing prop\r\nsupport), reach out to the EUI team to ask
for your UX as a feature\r\nrequest!\r\n\r\n### Checklist\r\n\r\nDelete
any items that are not applicable to this PR.\r\n\r\n- [x] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[x] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[x] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[x] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"fd7b86e209e7133f3d9b7bd4e9fd6542f8a3aaad","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","EUI","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services","Team:obs-ux-management","apm:review","v8.16.0"],"title":"Fix
various EuiFormControlLayout
usages","number":192779,"url":"https://github.com/elastic/kibana/pull/192779","mergeCommit":{"message":"Fix
various EuiFormControlLayout usages (#192779)\n\n## Summary\r\n\r\nThis
is a follow up to EUI's Emotion conversion
of\r\n**EuiFormControlLayout/Delimited**
(see\r\nhttps://github.com/elastic/kibana/pull/190752,\r\nhttps://github.com/elastic/eui/pull/7954,
and\r\nhttps://github.com/elastic/eui/pull/7957).\r\n\r\n> [!note]\r\n>
Please manually QA your team's affected form control(s) to
confirm\r\nthey still look and behave as expected and are non-broken.
The EUI team\r\nis not familiar enough with each plugin's setups to pull
down and QA\r\nthis PR ourselves.\r\n\r\nWhile QA testing the upgrade, I
noticed a few incorrect usages of\r\n**EuiFormControlLayout** but wanted
to wait until after the upgrade to\r\npush out fixes (to prevent
delaying the PR further). In general, here is\r\nEUI's [recommended
usage of
the\r\ncomponent](https://eui.elastic.co/#/forms/form-controls#form-control-layout):\r\n\r\n-
Where possible, **simply don't use it**. Almost all form controls
are\r\n**already** automatically wrapped in any EuiFormControlLayout
by\r\ndefault, and should accept a large majority of the props that the
layout\r\naccepts.\r\n- If you **must** use it, set the `controlOnly`
prop on the child\r\ninput/control to avoid buggy styling (e.g.
duplicate borders).\r\n- If you can't do either of the above for any
reason (e.g. missing prop\r\nsupport), reach out to the EUI team to ask
for your UX as a feature\r\nrequest!\r\n\r\n### Checklist\r\n\r\nDelete
any items that are not applicable to this PR.\r\n\r\n- [x] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[x] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[x] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[x] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"fd7b86e209e7133f3d9b7bd4e9fd6542f8a3aaad"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192779","number":192779,"mergeCommit":{"message":"Fix
various EuiFormControlLayout usages (#192779)\n\n## Summary\r\n\r\nThis
is a follow up to EUI's Emotion conversion
of\r\n**EuiFormControlLayout/Delimited**
(see\r\nhttps://github.com/elastic/kibana/pull/190752,\r\nhttps://github.com/elastic/eui/pull/7954,
and\r\nhttps://github.com/elastic/eui/pull/7957).\r\n\r\n> [!note]\r\n>
Please manually QA your team's affected form control(s) to
confirm\r\nthey still look and behave as expected and are non-broken.
The EUI team\r\nis not familiar enough with each plugin's setups to pull
down and QA\r\nthis PR ourselves.\r\n\r\nWhile QA testing the upgrade, I
noticed a few incorrect usages of\r\n**EuiFormControlLayout** but wanted
to wait until after the upgrade to\r\npush out fixes (to prevent
delaying the PR further). In general, here is\r\nEUI's [recommended
usage of
the\r\ncomponent](https://eui.elastic.co/#/forms/form-controls#form-control-layout):\r\n\r\n-
Where possible, **simply don't use it**. Almost all form controls
are\r\n**already** automatically wrapped in any EuiFormControlLayout
by\r\ndefault, and should accept a large majority of the props that the
layout\r\naccepts.\r\n- If you **must** use it, set the `controlOnly`
prop on the child\r\ninput/control to avoid buggy styling (e.g.
duplicate borders).\r\n- If you can't do either of the above for any
reason (e.g. missing prop\r\nsupport), reach out to the EUI team to ask
for your UX as a feature\r\nrequest!\r\n\r\n### Checklist\r\n\r\nDelete
any items that are not applicable to this PR.\r\n\r\n- [x] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[x] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[x] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[x] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"fd7b86e209e7133f3d9b7bd4e9fd6542f8a3aaad"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
2024-09-24 17:21:13 -05:00
Kibana Machine
77f711b4eb
[8.x] [dashboard] remove DashboardExternallyAccessibleApi and DashboardPluginInternalFunctions types (#193440) (#193487)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[dashboard] remove DashboardExternallyAccessibleApi and
DashboardPluginInternalFunctions types
(#193440)](https://github.com/elastic/kibana/pull/193440)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2024-09-19T21:05:27Z","message":"[dashboard]
remove DashboardExternallyAccessibleApi and
DashboardPluginInternalFunctions types (#193440)\n\nConsolidate to only
exposing `DashboardApi` by
removing\r\n`DashboardExternallyAccessibleApi`
and\r\n`DashboardPluginInternalFunctions`
types.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"885dfe30173fe15120f957cf6cbd836404c355f9","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:skip","v9.0.0","project:embeddableRebuild","v8.16.0","backport:version"],"title":"[dashboard]
remove DashboardExternallyAccessibleApi and
DashboardPluginInternalFunctions
types","number":193440,"url":"https://github.com/elastic/kibana/pull/193440","mergeCommit":{"message":"[dashboard]
remove DashboardExternallyAccessibleApi and
DashboardPluginInternalFunctions types (#193440)\n\nConsolidate to only
exposing `DashboardApi` by
removing\r\n`DashboardExternallyAccessibleApi`
and\r\n`DashboardPluginInternalFunctions`
types.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"885dfe30173fe15120f957cf6cbd836404c355f9"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193440","number":193440,"mergeCommit":{"message":"[dashboard]
remove DashboardExternallyAccessibleApi and
DashboardPluginInternalFunctions types (#193440)\n\nConsolidate to only
exposing `DashboardApi` by
removing\r\n`DashboardExternallyAccessibleApi`
and\r\n`DashboardPluginInternalFunctions`
types.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"885dfe30173fe15120f957cf6cbd836404c355f9"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
2024-09-19 17:29:01 -05:00
Nathan Reese
32c9913c2f
[embeddables] state management example (#192587)
Extend embeddable examples with a state management example. PR also
refactors embeddable examples to use side nav instead of tabs.

<img width="800" alt="Screenshot 2024-09-11 at 8 38 28 AM"
src="https://github.com/user-attachments/assets/ac46600f-2c45-4f9e-b4f8-a5c03f4eef2f">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-09-12 09:50:27 -06:00
Luke Elmers
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.
2024-09-06 19:02:41 -06:00
Nathan Reese
832bc99181
[embeddables] PresentationContainer example (#191891)
PR adds PresentationContainer to embeddable examples. This example shows
developers how to create a dashboard like experience with embeddable
registry and PresentationContainer interfaces

### Test instructions
1. start kibana with `yarn start --run-examples`
2. install web logs sample data
3. navigate to `http://localhost:5601/app/embeddablesApp`
4. Select `PresentationContainer example` tab

### Presentation container example

Example starts with empty display and users can add embeddables
<img width="800" alt="Screenshot 2024-09-05 at 1 58 55 PM"
src="https://github.com/user-attachments/assets/406651ca-e611-4a3e-8b2d-4207eb5011b1">

Editing time range, adding or removing panels, or changing panel state
by adding custom time ranges will show unsaved changes and allow user to
reset changes or save changes
<img width="800" alt="Screenshot 2024-09-05 at 1 59 51 PM"
src="https://github.com/user-attachments/assets/cd84e39c-6de0-4ac6-832f-7d8e3682610b">


After adding an embeddable, user can use panel actions to remove the
embeddable
<img width="800" alt="Screenshot 2024-09-05 at 2 00 50 PM"
src="https://github.com/user-attachments/assets/63a2515c-f378-419f-b2f5-db71712fdffc">

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
2024-09-06 14:14:45 -06:00
Larry Gregory
74d88580a5
Migrate codebase to use Object.hasOwn instead of Object.hasOwnProperty (#186829)
## Summary

This PR has breadth, but not depth. This adds 3 new `eslint` rules. The
first two protect against the use of code generated from strings (`eval`
and friends), which will not work client-side due to our CSP, and is not
something we wish to support server-side. The last rule aims to prevent
a subtle class of bugs, and to defend against a subset of prototype
pollution exploits:

- `no-new-func` to be compliant with our CSP, and to prevent code
execution from strings server-side:
https://eslint.org/docs/latest/rules/no-new-func
- `no-implied-eval` to be compliant with our CSP, and to prevent code
execution from strings server-side:
https://eslint.org/docs/latest/rules/no-implied-eval. Note that this
function implies that it prevents no-new-func, but I don't see [test
cases](https://github.com/eslint/eslint/blob/main/tests/lib/rules/no-implied-eval.js)
covering this behavior, so I think we should play it safe and enable
both rules.
- `no-prototype-builtins` to prevent accessing shadowed properties:
https://eslint.org/docs/latest/rules/no-prototype-builtins


In order to be compliant with `no-prototype-builtins`, I've migrated all
usages and variants of `Object.hasOwnProperty` to use the newer
[`Object.hasOwn`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn).
2024-08-13 10:30:19 -05:00
Alejandro Fernández Haro
11b750b10a
Minimize shared-common everywhere (#188606)
## Summary


![8xfggo](https://github.com/user-attachments/assets/f3d9312f-2ad3-4fa2-9daf-01e2b1ad6cac)

At the moment, our package generator creates all packages with the type
`shared-common`. This means that we cannot enforce boundaries between
server-side-only code and the browser, and vice-versa.

- [x] I started fixing `packages/core/*`
- [x] It took me to fixing `src/core/` type to be identified by the
`plugin` pattern (`public` and `server` directories) vs. a package
(either common, or single-scoped)
- [x] Unsurprisingly, this extended to packages importing core packages
hitting the boundaries eslint rules. And other packages importing the
latter.
- [x] Also a bunch of `common` logic that shouldn't be so _common_ 🙃 

### For maintainers

- [x] 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>
2024-07-29 12:47:46 -06:00
Ahmad Bamieh
7c6aa3fc8a
[i18n][system upgrade] Upgrade i18n tooling (#186519)
Update i18n tools after the main packages upgrade. This upgrade makes
use of formatJS tooling instead of fully implementing the parsers
ourselves. It also changes our custom AST parsing from babel to the
typescript compiler.
- [x] i18n exrtract
- [x] i18n check
- [x] i18n integrate
- [x] add test cases for formatjs runner
- [x] Make sure all CLI flags are handled properly
- [x] Update tooling readme

Closes https://github.com/elastic/kibana/issues/180616
Closes https://github.com/elastic/kibana/issues/187703

### Note to reviewers

Teams outside operations and core are probably requested to review
because the `i18n_check` fixed malformed i18n messages in your plugins.
Please check and approve :elasticheart:
2024-07-16 21:47:54 +01:00
Devon Thomson
1140cae77e
[Embeddables Rebuild] Create & copy panels with runtime state (#188039)
Makes the new Embeddable framework use runtime state for creating new panels, and for passing panel state around in the state transfer service.
2024-07-15 18:59:09 -04:00
Eyo O. Eyo
22e0545d0e
Redesign the "Add Panel" Experience (#183764)
## Summary

Closes https://github.com/elastic/kibana/issues/144418

This PR introduces changes to the dashboard add panel selection
functionality, so that panel selection would now happen from within a
flyout, and as such panels are now grouped together logically.

With this implementation any panel that is intended to show up within
this new flyout is required to have either been registered leveraging
the ui action trigger `ADD_PANEL_TRIGGER` and have it's `grouping` value
defined or belong to a subset of visualization types (`PROMOTED`,
`TOOLS`, and `LEGACY`) that would automatically get grouped.

It's worth pointing out that because we can't control the order at which
UI actions gets registered, we won't always get the the panel groups in
the same order, for this specific reason ~a new optional property
(`placementPriority`) has been added in~ the property `order` is now
leveraged such that it allows a user registering a UI action define a
relative weight for where they'd like their group to show up. All
registered actions would be rendered in descending order considering all
`order` defined, in the case where no order is defined `0` is assumed
for the group. In addition an action which is registered without a
group, would automatically get assigned into a default group titled
"Other".

The search implemented within the add panel is rudimentary, checking if
the group titles and group item titles contain the input character; when
a group title is matched the entire group is remains highlighted, in the
case that the group isn't matched and it's just the group item, only
said item is highlighted within it's group.

## Visuals

#### Default view
<img width="2560" alt="Screenshot 2024-06-10 at 17 44 17"
src="90aadf82-684a-4263-aecd-2843c3eff3c1">


#### Search match view
<img width="2560" alt="Screenshot 2024-06-10 at 17 45 11"
src="5a766f29-a3b7-40e3-b1f7-8b423073cd87">


##### P.S.

This changes also includes changes to the display of certain panels;
- ML group has a new title i.e. *Machine Learning and Analytics*
- In serverless, the observability panels (SLO*) only shows as a
selection choice in the observability project type.


### Checklist

Delete any items that are not applicable to this PR.

- [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)
<!--
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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)
-->
- [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] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] 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))
- [x] 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))
- [x] 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&mdash;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&mdash;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: Catherine Liu <catherine.liu@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-26 13:55:28 -07:00
Devon Thomson
7e19cc5660
[Embeddables Rebuild] Clone panels with runtime state (#186052)
Makes the clone operation use runtime state rather than serialized state.
2024-06-20 10:18:42 -04:00
Devon Thomson
6d39b8a432
[Embeddables Rebuild] Fix runtime state types. (#186194)
Fixes runtime state types, requiring them to be specified twice.
2024-06-19 10:05:27 -04:00
Lukas Olson
f20b8d5d14
[data.search] Improve SearchSource types (part 1) (#184531)
## Summary

Minor improvements to types in `SearchSource`.

### Checklist

- [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
2024-06-01 08:23:55 -07:00
Nathan Reese
f8c582da25
[canvas] fix parent API should implement unified search interface with react embeddables (#183772)
Closes https://github.com/elastic/kibana/issues/183766

### test instructions
1. start kibana with `yarn start --run-examples`
2. install sample web logs data set
3. create new canvas work pad
4. Click "Add element" -> "Filter" -> "Dropdown select"
5. Select "data" tab and configure filter to pull from logs sample data
and `machine.os.keyword` field.
6. Select "display" tab and "Value column" and "Filter column" to
`machine.os.keyword`.
7. Click "Add element" -> "Filter" -> "Time filter"
9. Click "Select type" -> "Search example"
10. Click panel context menu -> "Settings" and turn off custom time
range
11. Click "Expression editor" button in lower right corner to open the
expression editor for the map and prefix the expression with `kibana |
selectFilter | embeddable`
<img width="500" alt="Screenshot 2024-05-17 at 11 50 42 AM"
src="453096d5-c254-4f43-a09c-386586aa05a1">
12. Interact with drop down filter and time range filter. Verify Search
react embeddable updates as expected
2024-05-22 11:01:29 -06:00
Devon Thomson
53435eace3
[Embeddables rebuild] Support for by reference embeddables (#182523)
Adds first-class by reference support to the new Embeddable framework and adds an example of how a new-styled by reference embeddable could work.
2024-05-21 16:37:31 -04:00
Nathan Reese
3ecd73c2e5
embeddable overview guiding principles and best practices (#183099)
Paired with @ThomThomson to expand Embeddable documentation with
"Guiding principles" and "Best practices"

PR also moves overview to src/plugins/embeddables/README.md. Then, this
markdown is displayed in the embeddable example application as well.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Devon Thomson <devon.thomson@elastic.co>
2024-05-14 12:03:45 -06:00
Devon Thomson
6584663bf6
[Embeddable] Move registries (#182621)
Moves the React Embeddable registry, and saved object to panel registries onto the embeddable start / setup contracts
2024-05-10 12:42:34 -04:00
Nick Peihl
0c0cf0a8e0
Move panel placement register to dashboard start contract (#182571)
Part of #182585

## Summary

Puts the `registerDashboardPanelPlacementSetting` function on the
Dashboard start contract.

Rather than importing the module directly, consumers will need to
include `dashboard` in their plugin's start dependencies.
2024-05-06 16:20:20 -04:00
Nick Peihl
83ac34201d
[Embeddable rebuild] Add panel placement registry (#182120)
Fixes #182113

## Summary

Adds a registry for plugins to specify the width, height, and placement
strategy for their embeddables.

To test this: 
1. Run `yarn start --run-examples`
2. Load the Kibana sample data logs dataset
3. Start editing the [Logs] Web Traffic dashboard
4. In the "Add panel" dropdown, select the "Field list" subitem under
the "Embeddable examples" group

This also adds some additional documentation to the "Embeddables"
Developer examples.
2024-05-02 06:27:20 -07:00
Devon Thomson
102c207025
[Embeddables Rebuild] Example aesthetics (#181920)
Slight aesthetic changes to the example embeddables
2024-04-29 15:28:48 -04:00
Devon Thomson
89b7a65426
[Embeddables Rebuild] Restrict types & remove per panel versioning (#181751)
Removes per-panel versioning and makes a few changes to further lock down types to make the new embeddable system more consistent and less error-prone.
2024-04-29 13:43:17 -04:00
Devon Thomson
98d2ab2e1a
[Embeddables Rebuild] Data table example (#181768)
Adds a new data table example that shows how embeddables can interact with their siblings
2024-04-26 16:12:30 -04:00
Nathan Reese
438f623f3d
Add "Register new embeddable type" to Embeddable tutorial (#181761)
PR adds "Register new embeddable type" section to Embeddable tutorial
<img width="600" alt="Screenshot 2024-04-25 at 12 25 59 PM"
src="075c534b-0b1b-4600-a057-d601d09da5d1">

PR also groups example embeddables to make them easier to find
<img width="600" alt="Screenshot 2024-04-25 at 12 26 12 PM"
src="82d55fca-bbe8-4b63-a80e-dd052307d7e5">

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-26 12:02:48 -06:00
Nathan Reese
f39dc96f83
[Embeddables Rebuild] Remove legacy examples (#181635)
PR does the following
1. removes legacy example embeddables
2. Replaces FilterDebugger legacy embeddable with react embeddable
3. Moves FilterDebugger react embeddable to portable_dashboards_example
since that is where its used
4. Fixes DashboardContainer.addNewPanel to return ApiType for react
embeddables.

### test instructions
1. start kibana `yarn start --run-examples`
2. Open kibana menu and click "Developer examples"
3. Use developer examples search bar to find "Portable Dashboards"
example and click on the card
4. Verify first example that shows control filters works

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-26 08:53:28 -06:00
Nathan Reese
60ab2cfe95
PresentationPanel props hidePanelChrome (#181473)
### Changes
1. adds `hidePanelChrome` parameter to `ReactEmbeddableRenderer`. When
true, embeddable is rendered without `PresentationPanel` wrapper
2. Removes `embeddable-explorer` plugin
3. Moves Embeddable developer example into embeddable_examples plugin
4. Creates new examples that demonstrate how to use
`ReactEmbeddableRenderer`
<img width="600" alt="Screenshot 2024-04-23 at 5 19 18 PM"
src="5167a2a4-1968-42e6-92f7-4577c9cda3c6">

Follow-up work to narrow scope of this PR
1. add key concepts to embeddable overview
2. add "Register new embeddable type" tab that details how to create a
new embeddable and shows how you can add embeddable examples to
dashboard
3. group embeddable examples into a single item in "Add panel" menu - to
show best practices of how to keep menu clean
4. remove class based example embeddables

### Test instructions
1. start kibana with `yarn start --run-examples`
5. Open kibana menu and click "Developer examples"
6. Click "Embeddables" card and run examples

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-24 14:05:19 -06:00
Nathan Reese
46cb23a80d
Update SearchReactEmbeddable example to use sessionId and abortSignal (#181249)
Fixes https://github.com/elastic/kibana/issues/181199

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-23 08:07:33 -06:00
Nathan Reese
1c38891dfc
[embeddable rebuild] change onFetchContextChanged from accepting callback to returning an observable (#180410)
Closes https://github.com/elastic/kibana/issues/180363

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-11 13:45:22 -06:00
Devon Thomson
3a1936f81f
[Embeddables Rebuild] Clean up parenting structure (#179769)
Significantly cleans up the PresentationContainer interface by adding a `children$` publishing subject.
2024-04-05 13:37:53 -04:00
Nathan Reese
e23335ba8b
[embeddable refactor] complete fetch context interface (#179776)
Closes https://github.com/elastic/kibana/issues/179838

1. define `PublishesSearchSource` interface
2. define `PublishesReload` interface
3. Add optional `timeslice$` to `PublishesTimeRange` interface
4. Update `DashboardContainer` to implement `PublishesSearchSource`,
`PublishesReload`, and `PublishesTimeRange` interfaces
5. `onFetchContextChanged` utility method created to consolidate fetch
context logic into a single re-usable component.

### Test instructions
1. Start kibana with `yarn start --run-examples`
2. Install sample web logs data set
3. create new dashboard, add `Unified search example` panel
4. Change time range, filters, search and verify panel fetches count for
narrowed data range
5. add timeslider control and advance timeslider, verify panel fetches
count for timeslice
6. Click reload, verify panel reloads count

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-04 20:57:03 -06:00
Hannah Mudge
4cc61b98e1
[Embeddable Rebuild] Make React embeddables work in Canvas (#179667)
Closes https://github.com/elastic/kibana/issues/179548

## Summary

This PR makes it so that React embeddables will now work in Canvas. It
does so by doing two main things:

1. It ensures that the `ReactEmbeddableRenderer` is used in Canvas when
an embeddable exists in the React embeddable registry - if it does not
exist, it continues to use the legacy embeddable factory's `render`
method.

Since Canvas auto-applies all changes and doesn't have save
functionality like Dashboard does, we must keep track of changes **as
they happen** and update the expression to match the new Embeddable
input - therefore, I had to add a `onAnyStateChange` callback to the
`ReactEmbeddableRenderer` as a backdoor for Canvas. As a bonus to this,
embeddables that **previously** didn't respect inline editing (such as
the Image embeddable) will start to work once they are converted!


3. It adds a new trigger (`ADD_CANVAS_ELEMENT_TRIGGER`) specifically for
registering an embeddable to the **Canvas** add panel menu. This trigger
can be attached to the **same action** that the Dashboard
`ADD_PANEL_TRIGGER` is attached to - this makes it super simple to add
React embeddables to Canvas:
    
    ```typescript
    uiActions.registerAction<EmbeddableApiContext>({
      id: ADD_EMBEDDABLE_ACTION_ID,
      isCompatible: async ({ embeddable }) => { ... },
      execute: async ({ embeddable }) => { ... },
      getDisplayName: () => { ... },
    });

    // register this action to the Dashboard add panel menu:
uiActions.attachAction('ADD_PANEL_TRIGGER', ADD_EMBEDDABLE_ACTION_ID);

    // register this action to the Canvas add panel menu:
uiActions.attachAction('ADD_CANVAS_ELEMENT_TRIGGER',
ADD_EMBEDDABLE_ACTION_ID);
    ```

As a small cleanup, I also replaced some inline embeddable expressions
with `embeddableInputToExpression` - this is because I was originally
missing `| render` at the end of my expression, and I didn't catch it
because the expressions I was comparing it to were all declared inline.
This should help keep things more consistent.

### How to Test
I attached the `ADD_EUI_MARKDOWN_ACTION_ID` action to the new
`ADD_CANVAS_ELEMENT_TRIGGER`, so the new EUI Markdown React embeddable
should show up in the Canvas add panel menu. Ensure that this React
embeddable can be added to a workpad, and make sure it responds to edits
as expected:



d9062949-9c61-4c9e-8a8e-08042753eab6



### Checklist

- [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] 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>
2024-04-03 15:29:07 -07:00
Nathan Reese
61047aead0
[embeddable refactor] initializeTimeRange utility (#179379)
Move timeRange$ logic into reusable `initializeTimeRange` method.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-03-25 18:18:17 -06:00
Devon Thomson
b4e0a04af9
[Embeddables Rebuild] Async factories (#179302)
Changes the new Embeddable factory definition to take an async function instead of the factory object directly.
2024-03-25 15:44:57 -04:00
Devon Thomson
59b1f8ae94
[Embeddables Rebuild] Move titles API (#179202)
Moves the titles API and state comparators away from the embeddable plugin and to the presentation-publishing package.
2024-03-22 12:28:20 -04:00
Nathan Reese
85d243a059
[embeddable refactor] search react embeddable example (#178681)
Closes [178630](https://github.com/elastic/kibana/issues/178630)

To run examples, start kibana with `yarn start --run-examples`

PR adds "Unified search example" to Dashboard "Add panel" menu
<img width="400" alt="Screenshot 2024-03-13 at 9 33 22 PM"
src="d1edb4f5-ac1e-49bd-ad03-f624af74fff1">

Embeddable displays count with unified search context from dashboard.
Changing unified search and global time picker will cause search to
update
<img width="400" alt="Screenshot 2024-03-13 at 9 34 09 PM"
src="675b2c7d-9fc0-4173-aa67-354483593c09">

Embeddable also allows for setting custom time range on the panel
<img width="418" alt="Screenshot 2024-03-13 at 9 34 52 PM"
src="a79ea546-c4ce-4af5-8bb3-7be9cac7c02c">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-03-21 19:54:55 -06:00
Devon Thomson
fa799d7a08
[Embeddable Rebuild] Change Parenting Structure (#178426)
Changes the structure of the React Embeddable system's factories to reduce boilerplate and potential for bugs.
2024-03-13 12:38:08 -04:00
Devon Thomson
6827db46d5
[Embeddable rebuild] Allow Dashboard to provide references (#176455)
Adds the ability for the Dashboard to provide references for its React Embeddable children to inject, and adds the ability for the React Embeddable children to provide extracted references back to the Dashboard.
2024-02-12 14:55:16 -05:00
Devon Thomson
23b4b538f8
[Embeddables rebuild] Decouple add panel trigger (#176110)
Decouples the `ADD_PANEL_TRIGGER` from the Embeddables framework  by making it take a `PresentationContainer` as context instead.
2024-02-07 09:57:58 -05:00
Devon Thomson
435680612e
[Embeddables rebuild] Add new registry (#176018)
Creates a new registry for `React Embeddables` and allows the Dashboard to render them.
2024-02-02 15:10:19 -05:00
Alejandro Fernández Haro
fd09c26d15
async-import plugins in the server side (#170856)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-15 00:55:56 -07:00
Devon Thomson
26389e5014
[Embeddable] Clientside migration system (#162986)
Changes the versioning scheme used by Dashboard Panels and by value Embeddables, and introduces a new clientside system that can migrate Embeddable Inputs to their latest versions.
2023-08-22 15:08:27 -04:00