Commit graph

6608 commits

Author SHA1 Message Date
Philippe Oberti
708789102f
[Security Solution] - remove styled-components and cleanup for event viewer and data table components (#206523)
## Summary

This PR originally aimed at replacing the usages `styled-components`
with `@emotion/react` in the
`security_solution/public/common/components/events_viewer` folder. I
quickly realized removing some of these would require a small refactor.
This lead to making a few more changes, as many properties were actually
unused so a cleanup was welcome.

Only 2 small UI changes are introduced in this PR:
- the inspect icon on the top right corner of the tables are now always
visible instead of only visible on hover. I'm aware that this is a
different behavior from the alerts table in the alerts page, but we also
have other tables (like the one on threat intelligence page) where the
icon is always shown. Waiting on @codearos for confirmation here
- the `Grid view` and `Additional filters` button are reversed due to
the simplification of the code

No other UI changes are introduced. No behavior logic has been changed
either.

The biggest code cleanup are:
- removal of a bunch of unused properties and logic
- deletion of the RightTopMenu component: it was used in both
`StatefulEventsViewerComponent` and `getPersistentControlsHook` but none
of the internal logic was overlapping. I don't know how we got there but
its current implementation was overly complex and completely
unnecessary...

#### Alerts page

![Screenshot 2025-01-13 at 4 33
36 PM](https://github.com/user-attachments/assets/c6c588c1-16f1-49f8-bcc0-246fb05f7e10)

#### Rule creation page

![Screenshot 2025-01-13 at 4 34
14 PM](https://github.com/user-attachments/assets/ea2332c3-425a-4960-8bd6-f2d7395cdf34)

#### Host/User/Network events tab

![Screenshot 2025-01-13 at 4 34
27 PM](https://github.com/user-attachments/assets/4194e406-6bff-4a46-bc99-aadd1aea88d7)

#### Host session view tab

![Screenshot 2025-01-13 at 4 34
42 PM](https://github.com/user-attachments/assets/045b3bb2-2681-4089-a303-a77f797f9b90)

### 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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-15 09:18:19 -06:00
Philippe Oberti
d9b9425372
[Security Solution] - remove styled-components and cleanup for timeline header actions (#206694)
## Summary

Similar to [this previous
PR](https://github.com/elastic/kibana/pull/206523), this PR originally
aimed at replacing the usages styled-components with @emotion/react in
the security_solution/public/common/components/header_actions folder. I
quickly realized that a lot of props and event components were actually
not used at all, so a cleanup was welcome.

Absolutely no UI or behavior logic changes should be introduced by this
PR.

This PR will impact the tables in timeline, and the markdown use in
osquery.

The biggest code cleanup are:
- removing a couple of components related to the header actions used in
timeline
- removing random unused translations, constants or helper functions

#### Timeline query, correlation and pinned tabs

![Screenshot 2025-01-14 at 5 29
49 PM](https://github.com/user-attachments/assets/8c06c0f3-c323-4dd7-96d1-14357abc551d)

![Screenshot 2025-01-14 at 5 30
05 PM](https://github.com/user-attachments/assets/7332fbe2-8744-46d5-a5e8-bd056fba0375)

![Screenshot 2025-01-14 at 5 30
27 PM](https://github.com/user-attachments/assets/86053a20-f0e4-4f0a-8bdd-0c2678194903)

### 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
2025-01-15 09:14:28 -06:00
Faisal Kanout
b0973cf26c
[Exploratory View] Audit new EUI Borealis theme (#205212)
## Summary

It fixes #205051 

<del>
Files are excluded because of `euiScrollBar` and `euiScrollBarCorner`
replacement (TBD)
-
x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/series_editor.tsx

-
x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/components/filter_values_list.tsx
</del>
  DONE
2025-01-15 15:53:49 +01:00
Hannah Mudge
686571547f
[Dashboard][Collapsable Panels] Swap react-grid-layout for kbn-grid-layout (#205341)
Closes https://github.com/elastic/kibana/issues/190446

## Summary

This PR swaps out `react-grid-layout` for the new internal
`kbn-grid-layout` in the Dashboard plugin. This is the first major step
in making collapsible sections possible in Dashboard.

- **`react-grid-layout` (before)**:


https://github.com/user-attachments/assets/ca6ec059-7f4a-43fb-890e-7b72b781e50b

- **`kbn-grid-layout` (after)**:


https://github.com/user-attachments/assets/3d3de1f3-1afc-4e6b-93d6-9cc31a46e2cf

### Notable Improvements

- Better handling of resizing panels near the bottom of the screen
   
  | `react-grid-layout` | `kbn-grid-layout` |
  |--------|--------|
| ![Jan-09-2025
09-59-00](https://github.com/user-attachments/assets/75854b76-3ad7-4f06-9745-b03bde15f87a)
| ![Jan-09-2025
09-26-24](https://github.com/user-attachments/assets/f0fbc0bf-9208-4866-b7eb-988c7abc3e50)
|


- Auto-scroll when dragging / resizing panels near the top and bottom of
the screen, making it much easier to move panels around by larger
distances

  | `react-grid-layout` | `kbn-grid-layout` |
  |--------|--------|
| ![Jan-09-2025
10-01-30](https://github.com/user-attachments/assets/e3457e5e-3647-4024-b6e6-c594d6d3e1d7)
| ![Jan-09-2025
09-25-35](https://github.com/user-attachments/assets/3252bdec-2bbc-4793-b089-346866d4589b)
|

- More reliable panel positioning due to the use of CSS grid rather than
absolute positioning via pixels

  | `react-grid-layout` | `kbn-grid-layout` |
  |--------|--------|
| ![Screenshot 2025-01-09 at 9 32
52 AM](https://github.com/user-attachments/assets/06bd31a4-0a9f-4561-84c3-4cd96ba297b0)
| ![Screenshot 2025-01-09 at 9 35
14 AM](https://github.com/user-attachments/assets/573dab98-3fb9-4ef6-9f37-c4cf4d03ce52)
|

- Better performance when dragging and resizing (see
https://github.com/elastic/kibana/pull/204134 for a more thorough
explanation) and a smaller bundle size than `react-grid-layout`

### 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] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

This PR contains a significant change to the Dashboard layout engine,
which means that it carries a decent amount of risk for introducing new,
uncaught bugs with dragging / resizing panels and collision resolution.
That being said, `kbn-grid-layout` has been built **iteratively** with
plenty of testing along the way to reduce this risk.

## Release note
Improves Dashboard layout engine by switching to the internally
developed `kbn-grid-layout`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
2025-01-14 14:51:14 -07:00
Gerard Soldevila
7cf4ee8121
SKA: Cleanup and follow-up tasks (1 of many) (#206420)
## Summary

* Cleanup duplicate CODEOWNERS entries (introduced in
https://github.com/elastic/kibana/pull/203682).
* Update `node scripts/generate package` to support sustainable folders.
* Rescue orphan `.mdx` files belonging to shared-ux
* Update broken link
2025-01-14 19:03:58 +01:00
Candace Park
4162fe07ef
[Defend Workflows][Eui Visual Refresh] Basic theme update (#204892)
## Summary

For the most part, all of our colors translated fine into Borealis when
testing our pages. There will be more changes needed in the future to
completely replace all of the `euiThemeVars` usages, especially in
components that are shared with other teams. There are also quite a few
exported custom styled components that can't easily use the
`useEuiTheme` hook since they are not inside a react component. I didn't
want to touch those at this time.

- [x] Replace deprecated tokens to use new naming scheme ( like
successText --> textSuccess)
- [x] Use the hook `useEuiTheme()` over other methods

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-14 09:54:30 -05:00
Faisal Kanout
ac584159e0
[UX Plugin] Audit new EUI Borealis theme (#205195)
## Summary

It fixes #205051

---------
2025-01-14 14:05:43 +01:00
Agustina Nahir Ruidiaz
487be325c0
[Security Solution] [EUI Visual Refresh] update deprecated usage of "success" color (#205679)
## Summary

Resolves EUI Visual Refresh issue #202491
This PR is part of a list of PRs to perform the changes necessary to get
the new Borealis theme working correctly. It focuses on replacing the
deprecated color "success" colors have been updated to
"accentSecondary".

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-14 13:56:50 +01:00
Eyo O. Eyo
e6e4eda151
[Authz] Migrate outstanding SharedUX routes with access tags (#206260)
## Summary

Relates to https://github.com/elastic/kibana-team/issues/1235, this PR
tackles routes could not have been migrated automatically by the
security team. Following the guidance by the security provided in the
aforementioned issue instances where the tag approach had been
previously used to configure access have been migrated to use the
`requiredPrivilege` property on `security.authz` for route definitions.

### Checklist
<!--
Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] 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] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.

<!--
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

-->

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-13 14:52:06 +01:00
Gerard Soldevila
683a768941
SKA: Relocate remaining modules (#206103)
## Summary

This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
> * Manually review
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that
any CI pipeline customizations continue to be correctly applied after
the changed path names
> * Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below, as some of them contain relative paths
that have been updated.
> * Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
>     * customised eslint rules
>     * docs pointing to source code

> [!NOTE]
> * This PR has been auto-generated.
> * Any manual contributions will be lost if the 'relocate' script is
re-run.
> * Try to obtain the missing reviews / approvals before applying manual
fixes, and/or keep your changes in a .patch / git stash.
> * Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.

Are you trying to rebase this PR to solve merge conflicts? Please follow
the steps describe
[here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E).

#### 2 plugin(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/entities-data-access-plugin` |
`x-pack/solutions/observability/plugins/entities_data_access` |
| `@kbn/entityManager-app-plugin` |
`x-pack/solutions/observability/plugins/entity_manager_app` |




#### 10 packages(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/core-user-settings-server` |
`src/core/packages/user-settings/server` |
| `@kbn/core-user-settings-server-internal` |
`src/core/packages/user-settings/server-internal` |
| `@kbn/core-user-settings-server-mocks` |
`src/core/packages/user-settings/server-mocks` |
| `@kbn/calculate-auto` |
`src/platform/packages/shared/kbn-calculate-auto` |
| `@kbn/charts-theme` | `src/platform/packages/shared/kbn-charts-theme`
|
| `@kbn/palettes` | `src/platform/packages/shared/kbn-palettes` |
| `@kbn/saved-search-component` |
`src/platform/packages/shared/kbn-saved-search-component` |
| `@kbn/use-tracked-promise` |
`src/platform/packages/shared/kbn-use-tracked-promise` |
| `@kbn/response-ops-rule-form` |
`src/platform/packages/shared/response-ops/rule_form` |
| `@kbn/streams-schema` |
`x-pack/solutions/observability/packages/kbn-streams-schema` |


<details >
<summary>Updated references</summary>

```
./.i18nrc.json
./docs/developer/plugin-list.asciidoc
./package.json
./packages/kbn-ts-projects/config-paths.json
./src/core/packages/user-settings/server-internal/jest.config.js
./src/core/packages/user-settings/server-mocks/jest.config.js
./src/platform/packages/private/kbn-repo-packages/package-map.json
./src/platform/packages/shared/kbn-calculate-auto/jest.config.js
./src/platform/packages/shared/kbn-charts-theme/jest.config.js
./src/platform/packages/shared/kbn-palettes/jest.config.js
./src/platform/packages/shared/kbn-saved-search-component/jest.config.js
./src/platform/packages/shared/kbn-use-tracked-promise/jest.config.js
./src/platform/packages/shared/response-ops/rule_form/jest.config.js
./tsconfig.base.json
./x-pack/solutions/observability/packages/kbn-streams-schema/jest.config.js
./x-pack/solutions/observability/plugins/entities_data_access/jest.config.js
./x-pack/solutions/observability/plugins/entity_manager_app/jest.config.js
./yarn.lock
.github/CODEOWNERS
```

</details><details >
<summary>Updated relative paths</summary>

```
src/core/packages/user-settings/server-internal/jest.config.js:12
src/core/packages/user-settings/server-internal/tsconfig.json:2
src/core/packages/user-settings/server-mocks/jest.config.js:12
src/core/packages/user-settings/server-mocks/tsconfig.json:2
src/core/packages/user-settings/server/tsconfig.json:2
src/platform/packages/shared/kbn-calculate-auto/jest.config.js:12
src/platform/packages/shared/kbn-calculate-auto/tsconfig.json:2
src/platform/packages/shared/kbn-charts-theme/jest.config.js:12
src/platform/packages/shared/kbn-charts-theme/tsconfig.json:2
src/platform/packages/shared/kbn-palettes/jest.config.js:12
src/platform/packages/shared/kbn-palettes/tsconfig.json:2
src/platform/packages/shared/kbn-saved-search-component/jest.config.js:12
src/platform/packages/shared/kbn-saved-search-component/tsconfig.json:2
src/platform/packages/shared/kbn-use-tracked-promise/jest.config.js:12
src/platform/packages/shared/kbn-use-tracked-promise/tsconfig.json:2
src/platform/packages/shared/response-ops/rule_form/jest.config.js:12
src/platform/packages/shared/response-ops/rule_form/tsconfig.json:2
x-pack/solutions/observability/packages/kbn-streams-schema/jest.config.js:10
x-pack/solutions/observability/packages/kbn-streams-schema/tsconfig.json:2
x-pack/solutions/observability/plugins/entities_data_access/jest.config.js:12
x-pack/solutions/observability/plugins/entities_data_access/tsconfig.json:2
x-pack/solutions/observability/plugins/entity_manager_app/jest.config.js:12
x-pack/solutions/observability/plugins/entity_manager_app/tsconfig.json:2
x-pack/solutions/observability/plugins/entity_manager_app/tsconfig.json:7
```

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-13 09:12:28 +01:00
Tomasz Kajtoch
93935619de
Make Borealis the default theme in non-serverless (#203840) 2025-01-11 14:23:45 +01:00
Nick Partridge
481b8037d6
[kbn-test] Jest run script should use testPathPattern to lookup config (#206341)
Adds logic to support the jest vscode extension by reading the
`--testPathPattern` arg for the purpose of config lookup. This enables
running tests easily in the vscode jest extension.
2025-01-10 17:27:05 -06:00
Mark Hopkin
80baa2cd9e
[Entity Analytics][9.0] Remove all legacy risk engine code and features (#201810) 2025-01-10 21:51:32 +00:00
Zacqary Adam Xeper
d8b0b6e926
[ResponseOps] [Rule Form] Move rule form steps to hook with progress tracking (#205944)
## Summary

Part of #195211 

In preparation for the horizontal rule form layout, move the generation
of the rule form steps into three hooks:

- `useCommonRuleFormSteps`: private hook that generates a series of
objects specifying the rule form steps, how to display them, and what
order to display them in
- `useRuleFormSteps`: hook that calls `useCommonRuleFormSteps` and
transforms them into data for the standard vertical `EuiSteps`, along
with progress tracking based on `onBlur` events
- `useRuleFormHorizontalSteps`: hook that calls hook that calls
`useCommonRuleFormSteps` and transforms them into data for
`EuiStepsHorizontal`, plus navigation functions. ***These will be used
in the smaller rule form flyout in a second PR***

Because `EuiStepsHorizontal` rely more heavily on the `EuiSteps`
`status` property, I took this opportunity to improve progress tracking
in the standard vertical steps. Most rule types will load the create
page with Step 1: Rule Definition already being in a `danger` state,
because an incomplete rule definition component immediately sends
errors, and the error API doesn't distinguish between invalid data or
incomplete data.

This PR wraps each step in a `reportOnBlur` higher-order component,
which will report the first time a step triggers an `onBlur` event.
Steps with errors will now report `incomplete` until they first trigger
an `onBlur`. The result:

1. The user loads the Create Rule page. Rule Definition is marked
`incomplete`
2. The user interacts with Rule Definition, but does not yet complete
the definition.
3. The user interacts with the Actions step, the Rule Details step, or
another part of the page. The Rule Definition is now marked `danger`.

This is inelegant compared to an error API that can actually distinguish
between an incomplete form and an invalid form, but it's an improvement
for now.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-10 15:08:14 -06:00
Dzmitry Lemechko
ecf1818608
[kbn-test] export fleet package registry image (#206234)
## Summary

Should fix TS check error `Project references may not form a circular
graph` by removing `@kbn/test-suites-xpack` from `kbn-scout` dependency
list.

Since dockerImage for Fleet package registry is just a constant, that is
used across different FTR and Scout configurations, it makes sense to
export it from `kbn-test`
2025-01-10 17:44:06 +01:00
Lola
473eb721bc
[Cloud Security] Feature Flag Support for Cloud Security Posture Plugin (#205438)
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.

## Changes

* Adds `enableExperimental` to server `configSchema`
* Makes feature flags configurable via
`xpack.cloudSecurityPosture.enableExperimental` in `kibana.dev.yml`
* Implements `ExperimentFeatureService.get()` for accessing feature
flags
* Add passing `initliaterContext` to plugin in order to access our
plugin config

## Benefits

* Avoids circular dependency with Security Solution
`useIsExperimentalFeatureEnabled` and prop drilling feature flags from
Fleet plugin `PackagePolicyReplaceDefineStepExtensionComponentProps`
* Provides server-side configuration support
* Enables pre-release feature testing
* Creates centralized feature flag management

This allows controlled testing of new features before release through
configuration rather than code changes.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-10 10:55:06 -05:00
Anton Dosov
64b6a1a5e7
Sustainable Kibana Architecture: Move the rest of shared-ux modules (#205924)
## Summary

This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
> * Manually review
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that
any CI pipeline customizations continue to be correctly applied after
the changed path names
> * Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below, as some of them contain relative paths
that have been updated.
> * Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
>     * customised eslint rules
>     * docs pointing to source code

> [!NOTE]
> * This PR has been auto-generated.
> * Any manual contributions will be lost if the 'relocate' script is
re-run.
> * Try to obtain the missing reviews / approvals before applying manual
fixes, and/or keep your changes in a .patch / git stash.
> * Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.

Are you trying to rebase this PR to solve merge conflicts? Please follow
the steps describe
[here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E).

#### 1 plugin(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/url-drilldown-plugin` |
`x-pack/platform/plugins/private/drilldowns/url_drilldown` |




#### 21 packages(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/core-chrome-browser` | `src/core/packages/chrome/browser` |
| `@kbn/deeplinks-shared` |
`src/platform/packages/shared/deeplinks/shared` |
| `@kbn/home-sample-data-card` |
`src/platform/packages/shared/home/sample_data_card` |
| `@kbn/home-sample-data-tab` |
`src/platform/packages/shared/home/sample_data_tab` |
| `@kbn/home-sample-data-types` |
`src/platform/packages/shared/home/sample_data_types` |
| `@kbn/guided-onboarding` |
`src/platform/packages/shared/kbn-guided-onboarding` |
| `@kbn/item-buffer` | `src/platform/packages/private/kbn-item-buffer` |
| `@kbn/management-settings-section-registry` |
`src/platform/packages/shared/kbn-management/settings/section_registry`
|
| `@kbn/management-settings-ids` |
`src/platform/packages/shared/kbn-management/settings/setting_ids` |
| `@kbn/react-mute-legacy-root-warning` |
`src/platform/packages/private/kbn-react-mute-legacy-root-warning` |
| `@kbn/saved-objects-settings` |
`src/platform/packages/private/kbn-saved-objects-settings` |
| `@kbn/react-kibana-context-common` |
`src/platform/packages/shared/react/kibana_context/common` |
| `@kbn/react-kibana-context-render` |
`src/platform/packages/shared/react/kibana_context/render` |
| `@kbn/react-kibana-context-root` |
`src/platform/packages/shared/react/kibana_context/root` |
| `@kbn/react-kibana-context-styled` |
`src/platform/packages/shared/react/kibana_context/styled` |
| `@kbn/react-kibana-context-theme` |
`src/platform/packages/shared/react/kibana_context/theme` |
| `@kbn/react-kibana-mount` |
`src/platform/packages/shared/react/kibana_mount` |
| `@kbn/serverless-project-switcher` |
`src/platform/packages/private/serverless/project_switcher` |
| `@kbn/serverless-common-settings` |
`src/platform/packages/private/serverless/settings/common` |
| `@kbn/serverless-observability-settings` |
`src/platform/packages/shared/serverless/settings/observability_project`
|
| `@kbn/serverless-types` |
`src/platform/packages/private/serverless/types` |


<details >
<summary>Updated relative paths</summary>

```
src/core/packages/chrome/browser/jest.config.js:12
src/core/packages/chrome/browser/tsconfig.json:2
src/core/packages/chrome/browser/tsconfig.type_check.json:2
src/core/packages/chrome/browser/tsconfig.type_check.json:21
src/core/packages/chrome/browser/tsconfig.type_check.json:24
src/core/packages/chrome/browser/tsconfig.type_check.json:27
src/core/packages/chrome/browser/tsconfig.type_check.json:30
src/core/packages/chrome/browser/tsconfig.type_check.json:33
src/core/packages/chrome/browser/tsconfig.type_check.json:36
src/core/packages/chrome/browser/tsconfig.type_check.json:39
src/core/packages/chrome/browser/tsconfig.type_check.json:42
src/core/packages/chrome/browser/tsconfig.type_check.json:45
src/core/packages/chrome/browser/tsconfig.type_check.json:48
src/core/packages/chrome/browser/tsconfig.type_check.json:51
src/core/packages/chrome/browser/tsconfig.type_check.json:54
src/platform/packages/private/kbn-item-buffer/jest.config.js:12
src/platform/packages/private/kbn-item-buffer/tsconfig.json:2
src/platform/packages/private/kbn-react-mute-legacy-root-warning/jest.config.js:12
src/platform/packages/private/kbn-react-mute-legacy-root-warning/tsconfig.json:2
src/platform/packages/private/kbn-saved-objects-settings/jest.config.js:12
src/platform/packages/private/kbn-saved-objects-settings/tsconfig.json:2
src/platform/packages/private/kbn-saved-objects-settings/tsconfig.type_check.json:2
src/platform/packages/private/serverless/project_switcher/jest.config.js:12
src/platform/packages/private/serverless/project_switcher/tsconfig.json:2
src/platform/packages/private/serverless/project_switcher/tsconfig.type_check.json:2
src/platform/packages/private/serverless/project_switcher/tsconfig.type_check.json:23
src/platform/packages/private/serverless/settings/common/tsconfig.json:2
src/platform/packages/private/serverless/settings/common/tsconfig.type_check.json:2
src/platform/packages/private/serverless/settings/common/tsconfig.type_check.json:20
src/platform/packages/private/serverless/types/tsconfig.json:2
src/platform/packages/private/serverless/types/tsconfig.type_check.json:2
src/platform/packages/shared/deeplinks/shared/jest.config.js:12
src/platform/packages/shared/deeplinks/shared/tsconfig.json:2
src/platform/packages/shared/deeplinks/shared/tsconfig.type_check.json:2
src/platform/packages/shared/home/sample_data_card/jest.config.js:12
src/platform/packages/shared/home/sample_data_card/tsconfig.json:2
src/platform/packages/shared/home/sample_data_card/tsconfig.type_check.json:2
src/platform/packages/shared/home/sample_data_card/tsconfig.type_check.json:23
src/platform/packages/shared/home/sample_data_card/tsconfig.type_check.json:29
src/platform/packages/shared/home/sample_data_tab/jest.config.js:12
src/platform/packages/shared/home/sample_data_tab/tsconfig.json:2
src/platform/packages/shared/home/sample_data_tab/tsconfig.type_check.json:2
src/platform/packages/shared/home/sample_data_tab/tsconfig.type_check.json:23
src/platform/packages/shared/home/sample_data_types/jest.config.js:12
src/platform/packages/shared/home/sample_data_types/tsconfig.json:2
src/platform/packages/shared/home/sample_data_types/tsconfig.type_check.json:2
src/platform/packages/shared/kbn-guided-onboarding/jest.config.js:12
src/platform/packages/shared/kbn-guided-onboarding/tsconfig.json:2
src/platform/packages/shared/kbn-guided-onboarding/tsconfig.type_check.json:2
src/platform/packages/shared/kbn-management/settings/section_registry/tsconfig.json:2
src/platform/packages/shared/kbn-management/settings/section_registry/tsconfig.type_check.json:2
src/platform/packages/shared/kbn-management/settings/section_registry/tsconfig.type_check.json:22
src/platform/packages/shared/kbn-management/settings/section_registry/tsconfig.type_check.json:25
src/platform/packages/shared/kbn-management/settings/setting_ids/tsconfig.json:2
src/platform/packages/shared/kbn-management/settings/setting_ids/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_context/common/jest.config.js:12
src/platform/packages/shared/react/kibana_context/common/tsconfig.json:2
src/platform/packages/shared/react/kibana_context/common/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_context/render/jest.config.js:12
src/platform/packages/shared/react/kibana_context/render/tsconfig.json:2
src/platform/packages/shared/react/kibana_context/render/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_context/render/tsconfig.type_check.json:25
src/platform/packages/shared/react/kibana_context/root/jest.config.js:12
src/platform/packages/shared/react/kibana_context/root/tsconfig.json:2
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:22
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:28
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:31
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:34
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:37
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:40
src/platform/packages/shared/react/kibana_context/styled/jest.config.js:12
src/platform/packages/shared/react/kibana_context/styled/tsconfig.json:2
src/platform/packages/shared/react/kibana_context/styled/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_context/styled/tsconfig.type_check.json:22
src/platform/packages/shared/react/kibana_context/theme/jest.config.js:12
src/platform/packages/shared/react/kibana_context/theme/tsconfig.json:2
src/platform/packages/shared/react/kibana_context/theme/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_context/theme/tsconfig.type_check.json:22
src/platform/packages/shared/react/kibana_mount/jest.config.js:12
src/platform/packages/shared/react/kibana_mount/tsconfig.json:2
src/platform/packages/shared/react/kibana_mount/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_mount/tsconfig.type_check.json:22
src/platform/packages/shared/react/kibana_mount/tsconfig.type_check.json:25
src/platform/packages/shared/react/kibana_mount/tsconfig.type_check.json:28
src/platform/packages/shared/react/kibana_mount/tsconfig.type_check.json:34
src/platform/packages/shared/serverless/settings/observability_project/tsconfig.json:2
src/platform/packages/shared/serverless/settings/observability_project/tsconfig.type_check.json:2
src/platform/packages/shared/serverless/settings/observability_project/tsconfig.type_check.json:20
x-pack/platform/plugins/private/drilldowns/url_drilldown/tsconfig.json:2
```

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-10 11:30:37 +00:00
Gerard Soldevila
3b42b80bce
SKA: Relocate Script v7.1 (#206233)
## Summary

* Fix an issue with the `--list` command failing the 1st run.
* Allow passing in no filters, and relocate "incorrect" modules (aka
modules that are not in the correct folder) in that case.
2025-01-10 10:47:47 +00:00
Alex Szabo
b3b81331b5
[ci] Work around docosaurus errors (#206097)
## Summary
This workaround removes the folder that needs to be built differently
after cloning the repos.

See: https://github.com/elastic/kibana/issues/206077
2025-01-09 16:33:30 -06:00
Larry Gregory
a9f5f432ad
Dependency ownership refinements (#205937)
## Summary

This PR assigns owners for dependencies that are not yet claimed. These
assignments were a "best effort", and will likely need tweaking once
downstream teams start receiving renovate PRs.
2025-01-09 18:33:38 +00:00
Janki Salvi
a56227bf37
[ResponseOps][Rules] Allow to set notify when and throttle at rule level (#203235)
## Summary

Fixes https://github.com/elastic/kibana/issues/199494

This PR allows to create and update rule with `notify_when` and
`throttle` attributes at rule level instead of `action.frequency` level.

### How to test
- create a rule via api where `notify_when` and `throttle` attributes
are at rule level
  <details><summary>Example</summary>
  Note: use your existing connector for action
  
  ```typescript
  POST kbn:/api/alerting/rule
  {
    "tags": [],
    "params": {
      "searchConfiguration": {
        "query": {
          "query": "",
          "language": "kuery"
        },
        "index": "ff959d40-b880-11e8-a6d9-e546fe2bba5f"
      },
      "timeField": "order_date",
      "searchType": "searchSource",
      "timeWindowSize": 5,
      "timeWindowUnit": "d",
      "threshold": [
        10
      ],
      "thresholdComparator": ">",
      "size": 100,
      "aggType": "count",
      "groupBy": "all",
      "termSize": 5,
      "excludeHitsFromPreviousRun": false,
      "sourceFields": []
    },
    "schedule": {
      "interval": "1m"
    },
    "consumer": "stackAlerts",
    "name": "ES query rule from devtools",
    "rule_type_id": ".es-query",
    "notify_when": "onThrottleInterval",
    "throttle": "1h",
    "actions": [
      {
        "group": "query matched",
        "id": "ad923c8a-d27d-41a9-8c71-d33d94db4abb",
        "params": {
          "documents": [
            {
              "name": "{{rule.name}}"
            }
          ]
        }
      }
    ],
    "alert_delay": {
      "active": 1
    }
  }
  ``` 
  </details> 

- open the created rule
- go to `settings` tab 
- verify that dropdowns reflect notify_when and throttle value correctly
- update the rule via UI and verify the same
- update the rule via API and verify the same

### Flaky test runner: 
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7684

### Checklist

Check the PR satisfies following conditions. 

- [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
2025-01-09 16:18:28 +00:00
Alberto Blázquez
1e9606de9c
Turn AssetInventory sub-plugin into a Security solution page (#205363)
## Summary

Turn AssetInventory plugin into a simple Security solution page based on
this conversation:
- https://github.com/elastic/security-team/issues/10346

Follow-up of this work, where we initially developed the Asset Inventory
bare-bones as a plugin:
- https://github.com/elastic/kibana/issues/201704

Part of this work stream though not originally planned:
- https://github.com/elastic/security-team/issues/11247?reload=1

### Motivation

Reasoning behind is enabling fast development changes without any major
refactors in other packages/components that need to be reused, which
seems impossible as of now with the current codebase.

### Checklist

- [x] 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] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

In the future, we'll probably have to turn AssetInventory into a
sub-plugin again. Doing so doesn't bring any risk in the present, and
should only involve the re-generation of the deleted files in this PR.

---------

Co-authored-by: Paulo Henrique <paulo.henrique@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-09 13:53:31 +01:00
Angela Chuang
78dfe5f81e
[Security Solution][threat hunting explore] EUI refresh: Remove custom color hex (#204631)
## Summary

https://github.com/elastic/kibana/issues/202498
https://github.com/elastic/kibana/issues/202503

1. This PR does **Not** include the severity color change. It will be
implemented in a follow up PR once color tokens have been decided.
2. This PR updates the type `GetLensAttributes` to accept `euiTheme`, so
all the functions in this type are updated accordingly.

https://github.com/elastic/kibana/pull/204631/files#diff-abe20658865cad59eadcff945552b40832d96da0264ed89ddd5ab25ded1420a3R30

----

## To test:

Please verify if visualizations are displayed properly.

### Running Kibana with the Borealis theme
In order to run Kibana with `Borealis`, you'll need to do the following:

1. Set the following in kibana.dev.yml:
`uiSettings.experimental.themeSwitcherEnabled: true`
4. Run Kibana with the following environment variable set: 
```KBN_OPTIMIZER_THEMES="borealislight,borealisdark,v8light,v8dark" yarn start```

5. This will expose a toggle under Stack Management > Advanced Settings > Theme version, which you can use to toggle between Amsterdam and Borealis.


![Image](https://github.com/user-attachments/assets/78d64946-43fc-4400-bbb1-229d900b7f05)

----


### Explore


<img width="2557" alt="host_after" src="https://github.com/user-attachments/assets/f69b6e2a-58f6-4ed4-9f38-dcdbcf9919ed" />
<img width="1281" alt="users_after" src="https://github.com/user-attachments/assets/0eec8e9c-e678-4a66-83ee-4b8d11380b8e" />
<img width="2552" alt="network_dns" src="https://github.com/user-attachments/assets/19f06d2a-6e51-419b-9f89-233bfa5727ba" />
<img width="2557" alt="network_after" src="https://github.com/user-attachments/assets/3b90c5e2-23a1-4f15-a2d0-f9290a39af30" />

----

### Dashboards

<img width="2557" alt="dashboard_overview" src="https://github.com/user-attachments/assets/c1873359-fee9-42c6-addd-fe2bc1c98aee" />
<img width="2558" alt="dashboard_detection_response_2" src="https://github.com/user-attachments/assets/f6853710-0938-402b-b326-fa00d586b5d6" />
<img width="2559" alt="dashboard_detection_response_1" src="https://github.com/user-attachments/assets/4eb75526-9a57-46e9-b090-b53353956ea1" />

----


### Alerts
<img width="2555" alt="alerts_chart_collapsed" src="https://github.com/user-attachments/assets/6ecf5dd5-a785-4701-900b-0454f024b36d" />
<img width="2554" alt="summary" src="https://github.com/user-attachments/assets/1731a6ea-ef2b-4d7d-bf21-4041e59f0ad4" />
<img width="2559" alt="trend" src="https://github.com/user-attachments/assets/b9a741d1-a359-4273-9555-850cdcbc8932" />
<img width="2557" alt="counts" src="https://github.com/user-attachments/assets/a6193ccc-86b8-4974-ad9f-9417e200e859" />
<img width="1281" alt="treemap" src="https://github.com/user-attachments/assets/7b6e163a-a660-4bb1-a6de-88e21934b98a" />

----

### Rules preview
<img width="2556" alt="Screenshot 2024-12-18 at 13 45 33" src="https://github.com/user-attachments/assets/47099c18-86ee-455a-a5af-ebd6a29904a5" />


----

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-09 12:46:55 +00:00
Marta Bondyra
ea6d7bef93
[Dashboard][Collapsable Panels] Respond to touch events (#204225)
## Summary

Adds support to touch events. The difference between these ones and
mouse events is that once they are active, the scroll is off (just like
in the current Dashboard)


https://github.com/user-attachments/assets/4cdcc850-7391-441e-ab9a-0abbe70e4e56

Fixes https://github.com/elastic/kibana/issues/202014
2025-01-08 23:59:46 +00:00
Gerard Soldevila
2be928c489
SKA: Categorise remaining packages (#205875)
## Summary

* Delete unused package `@kbn/formatters`
* Delete unused package `@kbn/response-ops-feature-flag-service`
* Flag `@kbn/generate-console-definitions` as `devOnly: true`
* Flag `@kbn/plugin-check` as `devOnly: true`
* Flag `@kbn/set-map` as `devOnly: true`
* Flag `@kbn/synthetics-private-location` as `devOnly: true`
* Categorise `@kbn/calculate-auto` as `platform/shared`
* Categorise `@kbn/charts-theme` as `platform/shared`
* Categorise `@kbn/saved-search-component` as `platform/shared`
* Categorise `@kbn/use-tracked-promise` as `platform/shared`
* Categorise `@kbn/charts-theme` as `platform/shared`
* Categorise `@kbn/response-ops-rule-form` as `platform/shared`
2025-01-08 22:20:14 +01:00
Anton Dosov
3b2ab7b413
Sustainable Kibana Architecture: Move CodeEditor related packages #205587 (#205738)
## Summary

This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
> * Manually review
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that
any CI pipeline customizations continue to be correctly applied after
the changed path names
> * Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below, as some of them contain relative paths
that have been updated.
> * Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
>     * customised eslint rules
>     * docs pointing to source code

> [!NOTE]
> * This PR has been auto-generated.
> * Any manual contributions will be lost if the 'relocate' script is
re-run.
> * Try to obtain the missing reviews / approvals before applying manual
fixes, and/or keep your changes in a .patch / git stash.
> * Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.

Are you trying to rebase this PR to solve merge conflicts? Please follow
the steps describe
[here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E).

#### 3 packages(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/code-editor` |
`src/platform/packages/shared/shared-ux/code_editor/impl` |
| `@kbn/code-editor-mock` |
`src/platform/packages/shared/shared-ux/code_editor/mocks` |
| `@kbn/monaco` | `src/platform/packages/shared/kbn-monaco` |


<details >
<summary>Updated relative paths</summary>

```
src/platform/packages/shared/kbn-monaco/jest.config.js:12
src/platform/packages/shared/kbn-monaco/tsconfig.json:2
src/platform/packages/shared/kbn-monaco/tsconfig.type_check.json:2
src/platform/packages/shared/shared-ux/code_editor/impl/jest.config.js:12
src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.json:16
src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.json:2
src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:18
src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:2
src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:25
src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:28
src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:31
src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:34
src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:37
src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:40
src/platform/packages/shared/shared-ux/code_editor/mocks/tsconfig.json:16
src/platform/packages/shared/shared-ux/code_editor/mocks/tsconfig.json:2
src/platform/packages/shared/shared-ux/code_editor/mocks/tsconfig.type_check.json:18
src/platform/packages/shared/shared-ux/code_editor/mocks/tsconfig.type_check.json:2
src/platform/packages/shared/shared-ux/code_editor/mocks/tsconfig.type_check.json:25
```

</details>
2025-01-08 15:25:47 +01:00
Gerard Soldevila
a382d35dd2
Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-visualizations (#202754)
## Summary

This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
> * Manually review
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that
any CI pipeline customizations continue to be correctly applied after
the changed path names
> * Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below, as some of them contain relative paths
that have been updated.
> * Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
>     * customised eslint rules
>     * docs pointing to source code

> [!NOTE]
> * This PR has been auto-generated.
> * Any manual contributions will be lost if the 'relocate' script is
re-run.
> * Try to obtain the missing reviews / approvals before applying manual
fixes, and/or keep your changes in a .patch / git stash.
> * Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.

Are you trying to rebase this PR to solve merge conflicts? Please follow
the steps describe
[here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E).

#### 29 plugin(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/charts-plugin` | `src/platform/plugins/shared/charts` |
| `@kbn/data-plugin` | `src/platform/plugins/shared/data` |
| `@kbn/event-annotation-listing-plugin` |
`src/platform/plugins/private/event_annotation_listing` |
| `@kbn/event-annotation-plugin` |
`src/platform/plugins/private/event_annotation` |
| `@kbn/expression-gauge-plugin` |
`src/platform/plugins/shared/chart_expressions/expression_gauge` |
| `@kbn/expression-heatmap-plugin` |
`src/platform/plugins/shared/chart_expressions/expression_heatmap` |
| `@kbn/expression-legacy-metric-vis-plugin` |
`src/platform/plugins/shared/chart_expressions/expression_legacy_metric`
|
| `@kbn/expression-metric-vis-plugin` |
`src/platform/plugins/shared/chart_expressions/expression_metric` |
| `@kbn/expression-partition-vis-plugin` |
`src/platform/plugins/shared/chart_expressions/expression_partition_vis`
|
| `@kbn/expression-tagcloud-plugin` |
`src/platform/plugins/shared/chart_expressions/expression_tagcloud` |
| `@kbn/expression-xy-plugin` |
`src/platform/plugins/shared/chart_expressions/expression_xy` |
| `@kbn/expressions-plugin` | `src/platform/plugins/shared/expressions`
|
| `@kbn/graph-plugin` | `x-pack/platform/plugins/private/graph` |
| `@kbn/lens-plugin` | `x-pack/platform/plugins/shared/lens` |
| `@kbn/unified-search-plugin` |
`src/platform/plugins/shared/unified_search` |
| `@kbn/url-forwarding-plugin` |
`src/platform/plugins/private/url_forwarding` |
| `@kbn/vis-default-editor-plugin` |
`src/platform/plugins/private/vis_default_editor` |
| `@kbn/vis-type-gauge-plugin` |
`src/platform/plugins/private/vis_types/gauge` |
| `@kbn/vis-type-heatmap-plugin` |
`src/platform/plugins/private/vis_types/heatmap` |
| `@kbn/vis-type-metric-plugin` |
`src/platform/plugins/private/vis_types/metric` |
| `@kbn/vis-type-pie-plugin` |
`src/platform/plugins/private/vis_types/pie` |
| `@kbn/vis-type-table-plugin` |
`src/platform/plugins/private/vis_types/table` |
| `@kbn/vis-type-tagcloud-plugin` |
`src/platform/plugins/private/vis_types/tagcloud` |
| `@kbn/vis-type-timelion-plugin` |
`src/platform/plugins/private/vis_types/timelion` |
| `@kbn/vis-type-timeseries-plugin` |
`src/platform/plugins/shared/vis_types/timeseries` |
| `@kbn/vis-type-vega-plugin` |
`src/platform/plugins/private/vis_types/vega` |
| `@kbn/vis-type-vislib-plugin` |
`src/platform/plugins/private/vis_types/vislib` |
| `@kbn/vis-type-xy-plugin` |
`src/platform/plugins/private/vis_types/xy` |
| `@kbn/visualizations-plugin` |
`src/platform/plugins/shared/visualizations` |




#### 18 packages(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/calculate-width-from-char-count` |
`src/platform/packages/shared/kbn-calculate-width-from-char-count` |
| `@kbn/chart-expressions-common` |
`src/platform/packages/shared/chart-expressions-common` |
| `@kbn/chart-icons` | `src/platform/packages/shared/kbn-chart-icons` |
| `@kbn/coloring` | `src/platform/packages/shared/kbn-coloring` |
| `@kbn/data-service` | `src/platform/packages/shared/kbn-data-service`
|
| `@kbn/dom-drag-drop` |
`src/platform/packages/shared/kbn-dom-drag-drop` |
| `@kbn/event-annotation-common` |
`src/platform/packages/shared/kbn-event-annotation-common` |
| `@kbn/event-annotation-components` |
`src/platform/packages/shared/kbn-event-annotation-components` |
| `@kbn/interpreter` | `src/platform/packages/shared/kbn-interpreter` |
| `@kbn/lens-formula-docs` |
`src/platform/packages/private/kbn-lens-formula-docs` |
| `@kbn/managed-content-badge` |
`src/platform/packages/private/kbn-managed-content-badge` |
| `@kbn/random-sampling` |
`x-pack/platform/packages/private/kbn-random-sampling` |
| `@kbn/sort-predicates` |
`src/platform/packages/shared/kbn-sort-predicates` |
| `@kbn/timelion-grammar` |
`src/platform/packages/private/kbn-timelion-grammar` |
| `@kbn/tinymath` | `src/platform/packages/private/kbn-tinymath` |
| `@kbn/transpose-utils` |
`src/platform/packages/private/kbn-transpose-utils` |
| `@kbn/visualization-ui-components` |
`src/platform/packages/shared/kbn-visualization-ui-components` |
| `@kbn/visualization-utils` |
`src/platform/packages/shared/kbn-visualization-utils` |


<details >
<summary>Updated references</summary>

```
./.eslintignore
./.eslintrc.js
./.github/paths-labeller.yml
./.i18nrc.json
./docs/developer/architecture/core/elasticsearch-service.asciidoc
./docs/developer/architecture/development-visualize-index.asciidoc
./docs/developer/best-practices/index.asciidoc
./docs/developer/plugin-list.asciidoc
./examples/search_examples/public/plugin.ts
./package.json
./packages/kbn-docs-utils/src/build_api_declarations/extract_import_refs.test.ts
./packages/kbn-docs-utils/src/utils.ts
./packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.test.ts
./packages/kbn-repo-source-classifier/src/repo_source_classifier.ts
./packages/kbn-ts-projects/config-paths.json
./src/dev/build/tasks/package_json/find_used_dependencies.ts
./src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js
./src/dev/code_coverage/ingest_coverage/__tests__/mocks/team_assign_mock.txt
./src/dev/code_coverage/ingest_coverage/__tests__/transforms.test.js
./src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/bulk-data.json
./src/dev/storybook/aliases.ts
./src/platform/packages/private/kbn-lens-formula-docs/jest.config.js
./src/platform/packages/private/kbn-managed-content-badge/jest.config.js
./src/platform/packages/private/kbn-repo-packages/package-map.json
./src/platform/packages/private/kbn-tinymath/README.md
./src/platform/packages/private/kbn-tinymath/jest.config.js
./src/platform/packages/private/kbn-transpose-utils/jest.config.js
./src/platform/packages/shared/chart-expressions-common/jest.config.js
./src/platform/packages/shared/kbn-calculate-width-from-char-count/jest.config.js
./src/platform/packages/shared/kbn-chart-icons/jest.config.js
./src/platform/packages/shared/kbn-coloring/jest.config.js
./src/platform/packages/shared/kbn-data-service/jest.config.js
./src/platform/packages/shared/kbn-dom-drag-drop/jest.config.js
./src/platform/packages/shared/kbn-event-annotation-common/jest.config.js
./src/platform/packages/shared/kbn-event-annotation-components/jest.config.js
./src/platform/packages/shared/kbn-interpreter/jest.config.js
./src/platform/packages/shared/kbn-sort-predicates/jest.config.js
./src/platform/packages/shared/kbn-visualization-ui-components/jest.config.js
./src/platform/packages/shared/kbn-visualization-utils/jest.config.js
./src/platform/plugins/private/event_annotation/jest.config.js
./src/platform/plugins/private/event_annotation_listing/jest.config.js
./src/platform/plugins/private/url_forwarding/jest.config.js
./src/platform/plugins/private/vis_default_editor/jest.config.js
./src/platform/plugins/private/vis_types/gauge/jest.config.js
./src/platform/plugins/private/vis_types/heatmap/jest.config.js
./src/platform/plugins/private/vis_types/metric/jest.config.js
./src/platform/plugins/private/vis_types/pie/jest.config.js
./src/platform/plugins/private/vis_types/table/jest.config.js
./src/platform/plugins/private/vis_types/tagcloud/jest.config.js
./src/platform/plugins/private/vis_types/timelion/jest.config.js
./src/platform/plugins/private/vis_types/vega/jest.config.js
./src/platform/plugins/private/vis_types/vislib/jest.config.js
./src/platform/plugins/private/vis_types/xy/jest.config.js
./src/platform/plugins/shared/chart_expressions/expression_gauge/jest.config.js
./src/platform/plugins/shared/chart_expressions/expression_heatmap/jest.config.js
./src/platform/plugins/shared/chart_expressions/expression_legacy_metric/jest.config.js
./src/platform/plugins/shared/chart_expressions/expression_metric/jest.config.js
./src/platform/plugins/shared/chart_expressions/expression_partition_vis/jest.config.js
./src/platform/plugins/shared/chart_expressions/expression_tagcloud/jest.config.js
./src/platform/plugins/shared/chart_expressions/expression_xy/jest.config.js
./src/platform/plugins/shared/charts/jest.config.js
./src/platform/plugins/shared/custom_integrations/jest.config.js
./src/platform/plugins/shared/data/jest.config.js
./src/platform/plugins/shared/expressions/README.asciidoc
./src/platform/plugins/shared/expressions/jest.config.js
./src/platform/plugins/shared/unified_search/jest.config.js
./src/platform/plugins/shared/vis_types/timeseries/jest.config.js
./src/platform/plugins/shared/visualizations/jest.config.js
./src/plugins/vis_types/timeseries/public/application/components/aggs/math.js
./tsconfig.base.json
./tsconfig.base.type_check.json
./tsconfig.refs.json
./x-pack/.i18nrc.json
./x-pack/platform/packages/private/kbn-random-sampling/jest.config.js
./x-pack/platform/packages/private/ml/date_utils/src/date_utils.ts
./x-pack/platform/plugins/private/graph/README.md
./x-pack/platform/plugins/private/graph/jest.config.js
./x-pack/platform/plugins/private/graph/public/components/venn_diagram/vennjs/index.ts
./x-pack/platform/plugins/private/watcher/public/legacy/time_buckets.js
./x-pack/platform/plugins/shared/cases/public/components/markdown_editor/use_plugins.ts
./x-pack/platform/plugins/shared/lens/jest.config.js
./x-pack/platform/plugins/shared/lens/readme.md
./x-pack/platform/plugins/shared/lens/server/embeddable/make_lens_embeddable_factory.ts
./x-pack/platform/plugins/shared/lens/server/migrations/saved_object_migrations.ts
./x-pack/platform/plugins/shared/lens/tsconfig.type_check.json
./x-pack/platform/plugins/shared/ml/public/application/explorer/explorer_charts/explorer_charts_container.js
./x-pack/platform/plugins/shared/ml/public/application/services/field_format_service.ts
./x-pack/platform/plugins/shared/ml/public/application/util/chart_utils.js
./x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts
./x-pack/solutions/observability/plugins/observability_shared/common/utils/get_inspect_response.ts
./x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/autocomplete/index.mock.ts
./x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/fields/index.mock.ts
./x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.ts
./x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.test.ts
./x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts
./x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/helpers/index.ts
./x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts
./x-pack/solutions/security/plugins/security_solution/server/lib/timeline/constants.ts
./x-pack/solutions/security/plugins/timelines/public/hooks/use_app_toasts.ts
./yarn.lock
.github/CODEOWNERS
```

</details><details >
<summary>Updated relative paths</summary>

```
src/platform/packages/private/kbn-lens-formula-docs/jest.config.js:12
src/platform/packages/private/kbn-lens-formula-docs/tsconfig.json:2
src/platform/packages/private/kbn-managed-content-badge/jest.config.js:12
src/platform/packages/private/kbn-managed-content-badge/tsconfig.json:2
src/platform/packages/private/kbn-timelion-grammar/tsconfig.json:2
src/platform/packages/private/kbn-tinymath/jest.config.js:12
src/platform/packages/private/kbn-tinymath/tsconfig.json:2
src/platform/packages/private/kbn-transpose-utils/jest.config.js:12
src/platform/packages/private/kbn-transpose-utils/tsconfig.json:2
src/platform/packages/shared/chart-expressions-common/jest.config.js:12
src/platform/packages/shared/chart-expressions-common/tsconfig.json:2
src/platform/packages/shared/kbn-calculate-width-from-char-count/jest.config.js:12
src/platform/packages/shared/kbn-calculate-width-from-char-count/tsconfig.json:2
src/platform/packages/shared/kbn-chart-icons/jest.config.js:12
src/platform/packages/shared/kbn-chart-icons/tsconfig.json:2
src/platform/packages/shared/kbn-coloring/jest.config.js:12
src/platform/packages/shared/kbn-coloring/tsconfig.json:2
src/platform/packages/shared/kbn-data-service/jest.config.js:12
src/platform/packages/shared/kbn-data-service/tsconfig.json:2
src/platform/packages/shared/kbn-dom-drag-drop/jest.config.js:12
src/platform/packages/shared/kbn-dom-drag-drop/tsconfig.json:2
src/platform/packages/shared/kbn-event-annotation-common/jest.config.js:12
src/platform/packages/shared/kbn-event-annotation-common/tsconfig.json:2
src/platform/packages/shared/kbn-event-annotation-components/jest.config.js:12
src/platform/packages/shared/kbn-event-annotation-components/tsconfig.json:2
src/platform/packages/shared/kbn-interpreter/jest.config.js:12
src/platform/packages/shared/kbn-interpreter/tsconfig.json:2
src/platform/packages/shared/kbn-sort-predicates/jest.config.js:12
src/platform/packages/shared/kbn-sort-predicates/tsconfig.json:2
src/platform/packages/shared/kbn-visualization-ui-components/jest.config.js:12
src/platform/packages/shared/kbn-visualization-ui-components/tsconfig.json:2
src/platform/packages/shared/kbn-visualization-utils/jest.config.js:12
src/platform/packages/shared/kbn-visualization-utils/tsconfig.json:2
src/platform/plugins/private/event_annotation/jest.config.js:12
src/platform/plugins/private/event_annotation/tsconfig.json:2
src/platform/plugins/private/event_annotation_listing/jest.config.js:12
src/platform/plugins/private/event_annotation_listing/tsconfig.json:2
src/platform/plugins/private/url_forwarding/jest.config.js:12
src/platform/plugins/private/url_forwarding/tsconfig.json:2
src/platform/plugins/private/vis_default_editor/README.md:8
src/platform/plugins/private/vis_default_editor/jest.config.js:12
src/platform/plugins/private/vis_default_editor/tsconfig.json:2
src/platform/plugins/private/vis_types/gauge/jest.config.js:12
src/platform/plugins/private/vis_types/gauge/tsconfig.json:2
src/platform/plugins/private/vis_types/heatmap/jest.config.js:12
src/platform/plugins/private/vis_types/heatmap/tsconfig.json:2
src/platform/plugins/private/vis_types/metric/jest.config.js:12
src/platform/plugins/private/vis_types/metric/tsconfig.json:2
src/platform/plugins/private/vis_types/pie/jest.config.js:12
src/platform/plugins/private/vis_types/pie/tsconfig.json:2
src/platform/plugins/private/vis_types/table/jest.config.js:12
src/platform/plugins/private/vis_types/table/tsconfig.json:2
src/platform/plugins/private/vis_types/tagcloud/jest.config.js:12
src/platform/plugins/private/vis_types/tagcloud/tsconfig.json:2
src/platform/plugins/private/vis_types/timelion/jest.config.js:12
src/platform/plugins/private/vis_types/timelion/tsconfig.json:2
src/platform/plugins/private/vis_types/vega/jest.config.js:12
src/platform/plugins/private/vis_types/vega/tsconfig.json:2
src/platform/plugins/private/vis_types/vislib/jest.config.js:12
src/platform/plugins/private/vis_types/vislib/tsconfig.json:2
src/platform/plugins/private/vis_types/xy/jest.config.js:12
src/platform/plugins/private/vis_types/xy/tsconfig.json:2
src/platform/plugins/shared/chart_expressions/expression_gauge/jest.config.js:12
src/platform/plugins/shared/chart_expressions/expression_gauge/tsconfig.json:2
src/platform/plugins/shared/chart_expressions/expression_heatmap/jest.config.js:12
src/platform/plugins/shared/chart_expressions/expression_heatmap/tsconfig.json:2
src/platform/plugins/shared/chart_expressions/expression_legacy_metric/.storybook/main.js:17
src/platform/plugins/shared/chart_expressions/expression_legacy_metric/jest.config.js:12
src/platform/plugins/shared/chart_expressions/expression_legacy_metric/tsconfig.json:2
src/platform/plugins/shared/chart_expressions/expression_metric/.storybook/main.js:17
src/platform/plugins/shared/chart_expressions/expression_metric/jest.config.js:12
src/platform/plugins/shared/chart_expressions/expression_metric/tsconfig.json:2
src/platform/plugins/shared/chart_expressions/expression_partition_vis/jest.config.js:12
src/platform/plugins/shared/chart_expressions/expression_partition_vis/tsconfig.json:2
src/platform/plugins/shared/chart_expressions/expression_tagcloud/jest.config.js:12
src/platform/plugins/shared/chart_expressions/expression_tagcloud/tsconfig.json:2
src/platform/plugins/shared/chart_expressions/expression_xy/jest.config.js:12
src/platform/plugins/shared/chart_expressions/expression_xy/tsconfig.json:2
src/platform/plugins/shared/charts/jest.config.js:12
src/platform/plugins/shared/charts/tsconfig.json:2
src/platform/plugins/shared/data/jest.config.js:12
src/platform/plugins/shared/data/tsconfig.json:13
src/platform/plugins/shared/data/tsconfig.json:2
src/platform/plugins/shared/expressions/jest.config.js:12
src/platform/plugins/shared/expressions/tsconfig.json:2
src/platform/plugins/shared/unified_search/jest.config.js:12
src/platform/plugins/shared/unified_search/tsconfig.json:2
src/platform/plugins/shared/vis_types/timeseries/jest.config.js:12
src/platform/plugins/shared/vis_types/timeseries/tsconfig.json:11
src/platform/plugins/shared/vis_types/timeseries/tsconfig.json:2
src/platform/plugins/shared/visualizations/jest.config.js:12
src/platform/plugins/shared/visualizations/tsconfig.json:2
src/platform/plugins/shared/visualizations/tsconfig.json:6
x-pack/platform/packages/private/kbn-random-sampling/jest.config.js:10
x-pack/platform/packages/private/kbn-random-sampling/tsconfig.json:2
x-pack/platform/plugins/private/graph/jest.config.js:10
x-pack/platform/plugins/private/graph/tsconfig.json:13
x-pack/platform/plugins/private/graph/tsconfig.json:3
x-pack/platform/plugins/shared/lens/jest.config.js:10
x-pack/platform/plugins/shared/lens/tsconfig.json:2
x-pack/platform/plugins/shared/lens/tsconfig.json:6
```

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-08 12:19:24 +01:00
Anton Dosov
72d3f7b89c
Sustainable Kibana Architecture: Move content management related packages (#205593) 2025-01-07 22:41:31 +01:00
Ying Mao
11e3a0b77e
Reapply "[Response Ops][Alerting] Backfill actions schema changes for intermediate release (#204657)
## Summary

Redoing [this PR](https://github.com/elastic/kibana/pull/203184) which
had to be [reverted](https://github.com/elastic/kibana/pull/204218).
This should not be merged until [this update to the task manager v1
schema](https://github.com/elastic/kibana/pull/204413) is released.

## To verify
1. Set `xpack.task_manager.unsafe.exclude_task_types:
['ad_hoc_run-backfill', 'actions:*']` in your Kibana config.
2. Run Kibana on main and create some detection rules that run
frequently, with actions.
3. Schedule a manual run for your detection rules.
- Because of the config, the `action_task_params` SO and the
`ad_hoc_run_task_params` SO will get written but not read yet.
4. Remove the `exclude_task_types` config and "upgrade" to this PR
branch and verify that rules continue to run and that the actions are
triggered and the manual rule runs go through
5. Re-add the `exclude_task_types` config and let the rule run again to
schedule action. Schedule another manual rule run.
6. Remove the `exclude_task_types` config and "downgrade" back to main
and verify that rules continue to run, the action gets triggered and
manual rule runs go through.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-07 16:37:01 -05:00
Gerard Soldevila
ca42d93bd4
SKA: Relocate Script v7 (#205732)
## Summary

Addresses the following:
* Simplify `isInTargetFolder`, and leverage existing
`calculateModuleTargetFolder`. It solves a bug with "current" location
being incorrectly determined, as we were using the `group` and
`visibility` inferred from path, rather than those in the manifest.
* Move the `pre-relocation` hook to BEFORE calculating the list of
modules. This allows to update a manifest to re-relocate a module (e.g.
when changing its group or visibility).
* Fix a bug that caused modules under `src/core/packages` to not be
considered in the "correct location".
* Fix a bug in the replace logic specific to `pipeline.ts`. We were
updating paths that we shouldn't have updated.
2025-01-07 19:27:36 +00:00
Gerard Soldevila
a8579bb41f
Make saved_objects_tagging plugin shared (#205695)
## Summary

So that it can be used from `streams_app` (o11y).
See  https://github.com/elastic/kibana/pull/204309

Steps to relocate:

1. Fetch latest `main`
2. Update the `group` and/or `visibility` in the module's manifest.
3. Run `node scripts/relocate --moveOnly
@kbn/saved-objects-tagging-plugin`
2025-01-07 18:15:17 +01:00
Michael Dokolin
aa8195ced4
Fix telemetry CLI to write empty properties collection (#205746)
Follow-up of #205613. Remove check blocking empty properties from
writing.
2025-01-07 09:46:43 -07:00
Eyo O. Eyo
3bb50f7048
SKA: Move SharedUX packages under packages/core (#205608)
## Summary

This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
> * Manually review
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that
any CI pipeline customizations continue to be correctly applied after
the changed path names
> * Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below, as some of them contain relative paths
that have been updated.
> * Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
>     * customised eslint rules
>     * docs pointing to source code

> [!NOTE]
> * This PR has been auto-generated.
> * Any manual contributions will be lost if the 'relocate' script is
re-run.
> * Try to obtain the missing reviews / approvals before applying manual
fixes, and/or keep your changes in a .patch / git stash.
> * Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.

Are you trying to rebase this PR to solve merge conflicts? Please follow
the steps describe
[here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E).

#### 13 packages(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/core-chrome-browser-internal` |
`src/core/packages/chrome/browser-internal` |
| `@kbn/core-custom-branding-browser` |
`src/core/packages/custom-branding/browser` |
| `@kbn/core-custom-branding-browser-internal` |
`src/core/packages/custom-branding/browser-internal` |
| `@kbn/core-custom-branding-browser-mocks` |
`src/core/packages/custom-branding/browser-mocks` |
| `@kbn/core-custom-branding-common` |
`src/core/packages/custom-branding/common` |
| `@kbn/core-custom-branding-server` |
`src/core/packages/custom-branding/server` |
| `@kbn/core-custom-branding-server-internal` |
`src/core/packages/custom-branding/server-internal` |
| `@kbn/core-custom-branding-server-mocks` |
`src/core/packages/custom-branding/server-mocks` |
| `@kbn/core-ui-settings-browser` |
`src/core/packages/ui-settings/browser` |
| `@kbn/core-ui-settings-browser-internal` |
`src/core/packages/ui-settings/browser-internal` |
| `@kbn/core-ui-settings-common` |
`src/core/packages/ui-settings/common` |
| `@kbn/core-ui-settings-server` |
`src/core/packages/ui-settings/server` |
| `@kbn/core-ui-settings-server-internal` |
`src/core/packages/ui-settings/server-internal` |


<details >
<summary>Updated references</summary>

```
./docs/developer/architecture/core/patterns-scoped-services.asciidoc
./docs/developer/architecture/core/uisettings-service.asciidoc
./package.json
./packages/core/custom-branding/core-custom-branding-common/index.ts
./packages/kbn-ts-projects/config-paths.json
./src/core/packages/chrome/browser-internal/jest.config.js
./src/core/packages/custom-branding/browser-internal/jest.config.js
./src/core/packages/custom-branding/browser-mocks/jest.config.js
./src/core/packages/custom-branding/server-internal/jest.config.js
./src/core/packages/custom-branding/server-mocks/jest.config.js
./src/core/packages/ui-settings/browser-internal/jest.config.js
./src/core/packages/ui-settings/browser/jest.config.js
./src/core/packages/ui-settings/common/jest.config.js
./src/core/packages/ui-settings/server-internal/jest.config.js
./src/core/packages/ui-settings/server/jest.config.js
./src/platform/packages/private/kbn-repo-packages/package-map.json
./tsconfig.base.json
./x-pack/platform/plugins/private/transform/public/app/common/time_zone_utils.ts
./yarn.lock
.github/CODEOWNERS
```

</details><details >
<summary>Updated relative paths</summary>

```
src/core/packages/chrome/browser-internal/jest.config.js:12
src/core/packages/chrome/browser-internal/tsconfig.json:2
src/core/packages/custom-branding/browser-internal/jest.config.js:12
src/core/packages/custom-branding/browser-internal/tsconfig.json:2
src/core/packages/custom-branding/browser-mocks/jest.config.js:12
src/core/packages/custom-branding/browser-mocks/tsconfig.json:2
src/core/packages/custom-branding/browser/tsconfig.json:2
src/core/packages/custom-branding/common/tsconfig.json:2
src/core/packages/custom-branding/server-internal/jest.config.js:12
src/core/packages/custom-branding/server-internal/tsconfig.json:2
src/core/packages/custom-branding/server-mocks/jest.config.js:12
src/core/packages/custom-branding/server-mocks/tsconfig.json:2
src/core/packages/custom-branding/server/tsconfig.json:2
src/core/packages/ui-settings/browser-internal/jest.config.js:12
src/core/packages/ui-settings/browser-internal/tsconfig.json:2
src/core/packages/ui-settings/browser/jest.config.js:12
src/core/packages/ui-settings/browser/tsconfig.json:2
src/core/packages/ui-settings/common/jest.config.js:12
src/core/packages/ui-settings/common/tsconfig.json:2
src/core/packages/ui-settings/server-internal/jest.config.js:12
src/core/packages/ui-settings/server-internal/tsconfig.json:2
src/core/packages/ui-settings/server/jest.config.js:12
src/core/packages/ui-settings/server/tsconfig.json:2
```

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-07 15:15:56 +00:00
Anton Dosov
9e1ff1f95d
Sustainable Kibana Architecture: Move reporting related packages (#205587)
## Summary

This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
> * Manually review
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that
any CI pipeline customizations continue to be correctly applied after
the changed path names
> * Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below, as some of them contain relative paths
that have been updated.
> * Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
>     * customised eslint rules
>     * docs pointing to source code

> [!NOTE]
> * This PR has been auto-generated.
> * Any manual contributions will be lost if the 'relocate' script is
re-run.
> * Try to obtain the missing reviews / approvals before applying manual
fixes, and/or keep your changes in a .patch / git stash.
> * Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.

Are you trying to rebase this PR to solve merge conflicts? Please follow
the steps describe
[here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E).

#### 13 packages(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/generate-csv` | `src/platform/packages/private/kbn-generate-csv`
|
| `@kbn/reporting-common` |
`src/platform/packages/private/kbn-reporting/common` |
| `@kbn/reporting-csv-share-panel` |
`src/platform/packages/private/kbn-reporting/get_csv_panel_actions` |
| `@kbn/reporting-export-types-csv` |
`src/platform/packages/private/kbn-reporting/export_types/csv` |
| `@kbn/reporting-export-types-csv-common` |
`src/platform/packages/private/kbn-reporting/export_types/csv_common` |
| `@kbn/reporting-export-types-pdf` |
`src/platform/packages/private/kbn-reporting/export_types/pdf` |
| `@kbn/reporting-export-types-pdf-common` |
`src/platform/packages/private/kbn-reporting/export_types/pdf_common` |
| `@kbn/reporting-export-types-png` |
`src/platform/packages/private/kbn-reporting/export_types/png` |
| `@kbn/reporting-export-types-png-common` |
`src/platform/packages/private/kbn-reporting/export_types/png_common` |
| `@kbn/reporting-mocks-server` |
`src/platform/packages/private/kbn-reporting/mocks_server` |
| `@kbn/reporting-public` |
`src/platform/packages/private/kbn-reporting/public` |
| `@kbn/reporting-server` |
`src/platform/packages/private/kbn-reporting/server` |
| `@kbn/screenshotting-server` |
`src/platform/packages/private/kbn-screenshotting-server` |


<details >
<summary>Updated relative paths</summary>

```
src/platform/packages/private/kbn-generate-csv/jest.config.js:12
src/platform/packages/private/kbn-generate-csv/tsconfig.json:2
src/platform/packages/private/kbn-generate-csv/tsconfig.type_check.json:2
src/platform/packages/private/kbn-generate-csv/tsconfig.type_check.json:23
src/platform/packages/private/kbn-generate-csv/tsconfig.type_check.json:26
src/platform/packages/private/kbn-generate-csv/tsconfig.type_check.json:29
src/platform/packages/private/kbn-generate-csv/tsconfig.type_check.json:32
src/platform/packages/private/kbn-generate-csv/tsconfig.type_check.json:56
src/platform/packages/private/kbn-reporting/common/jest.config.js:12
src/platform/packages/private/kbn-reporting/common/tsconfig.json:2
src/platform/packages/private/kbn-reporting/common/tsconfig.type_check.json:2
src/platform/packages/private/kbn-reporting/common/tsconfig.type_check.json:21
src/platform/packages/private/kbn-reporting/common/tsconfig.type_check.json:24
src/platform/packages/private/kbn-reporting/common/tsconfig.type_check.json:27
src/platform/packages/private/kbn-reporting/common/tsconfig.type_check.json:30
src/platform/packages/private/kbn-reporting/common/tsconfig.type_check.json:33
src/platform/packages/private/kbn-reporting/export_types/csv/jest.config.js:12
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.json:2
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.type_check.json:2
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.type_check.json:22
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.type_check.json:25
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.type_check.json:28
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.type_check.json:31
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.type_check.json:34
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.type_check.json:37
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.type_check.json:40
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.type_check.json:46
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.type_check.json:49
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.type_check.json:52
src/platform/packages/private/kbn-reporting/export_types/csv/tsconfig.type_check.json:55
src/platform/packages/private/kbn-reporting/export_types/csv_common/jest.config.js:12
src/platform/packages/private/kbn-reporting/export_types/csv_common/tsconfig.json:2
src/platform/packages/private/kbn-reporting/export_types/csv_common/tsconfig.type_check.json:2
src/platform/packages/private/kbn-reporting/export_types/csv_common/tsconfig.type_check.json:20
src/platform/packages/private/kbn-reporting/export_types/csv_common/tsconfig.type_check.json:23
src/platform/packages/private/kbn-reporting/export_types/csv_common/tsconfig.type_check.json:26
src/platform/packages/private/kbn-reporting/export_types/pdf/jest.config.js:12
src/platform/packages/private/kbn-reporting/export_types/pdf/tsconfig.json:2
src/platform/packages/private/kbn-reporting/export_types/pdf/tsconfig.type_check.json:2
src/platform/packages/private/kbn-reporting/export_types/pdf/tsconfig.type_check.json:21
src/platform/packages/private/kbn-reporting/export_types/pdf/tsconfig.type_check.json:24
src/platform/packages/private/kbn-reporting/export_types/pdf/tsconfig.type_check.json:27
src/platform/packages/private/kbn-reporting/export_types/pdf/tsconfig.type_check.json:30
src/platform/packages/private/kbn-reporting/export_types/pdf/tsconfig.type_check.json:36
src/platform/packages/private/kbn-reporting/export_types/pdf/tsconfig.type_check.json:39
src/platform/packages/private/kbn-reporting/export_types/pdf_common/tsconfig.json:2
src/platform/packages/private/kbn-reporting/export_types/pdf_common/tsconfig.type_check.json:2
src/platform/packages/private/kbn-reporting/export_types/pdf_common/tsconfig.type_check.json:20
src/platform/packages/private/kbn-reporting/export_types/pdf_common/tsconfig.type_check.json:23
src/platform/packages/private/kbn-reporting/export_types/png/jest.config.js:12
src/platform/packages/private/kbn-reporting/export_types/png/tsconfig.json:2
src/platform/packages/private/kbn-reporting/export_types/png/tsconfig.type_check.json:2
src/platform/packages/private/kbn-reporting/export_types/png/tsconfig.type_check.json:22
src/platform/packages/private/kbn-reporting/export_types/png/tsconfig.type_check.json:25
src/platform/packages/private/kbn-reporting/export_types/png/tsconfig.type_check.json:28
src/platform/packages/private/kbn-reporting/export_types/png/tsconfig.type_check.json:31
src/platform/packages/private/kbn-reporting/export_types/png/tsconfig.type_check.json:37
src/platform/packages/private/kbn-reporting/export_types/png/tsconfig.type_check.json:40
src/platform/packages/private/kbn-reporting/export_types/png_common/tsconfig.json:2
src/platform/packages/private/kbn-reporting/export_types/png_common/tsconfig.type_check.json:2
src/platform/packages/private/kbn-reporting/export_types/png_common/tsconfig.type_check.json:20
src/platform/packages/private/kbn-reporting/export_types/png_common/tsconfig.type_check.json:23
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/jest.config.js:12
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.json:2
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:2
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:21
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:24
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:27
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:33
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:36
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:39
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:42
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:45
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:48
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:51
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:54
src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.type_check.json:60
src/platform/packages/private/kbn-reporting/mocks_server/jest.config.js:12
src/platform/packages/private/kbn-reporting/mocks_server/tsconfig.json:2
src/platform/packages/private/kbn-reporting/mocks_server/tsconfig.type_check.json:2
src/platform/packages/private/kbn-reporting/public/jest.config.js:12
src/platform/packages/private/kbn-reporting/public/tsconfig.json:2
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:2
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:24
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:27
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:30
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:33
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:36
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:39
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:42
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:45
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:57
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:60
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:63
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:66
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:69
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:72
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:75
src/platform/packages/private/kbn-reporting/public/tsconfig.type_check.json:78
src/platform/packages/private/kbn-reporting/server/jest.config.js:12
src/platform/packages/private/kbn-reporting/server/tsconfig.json:2
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:2
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:21
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:24
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:27
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:30
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:33
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:36
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:42
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:45
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:48
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:51
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:54
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:57
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:60
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:63
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:66
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:69
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:72
src/platform/packages/private/kbn-reporting/server/tsconfig.type_check.json:75
src/platform/packages/private/kbn-screenshotting-server/jest.config.js:12
src/platform/packages/private/kbn-screenshotting-server/src/paths.ts:106
src/platform/packages/private/kbn-screenshotting-server/tsconfig.json:2
src/platform/packages/private/kbn-screenshotting-server/tsconfig.type_check.json:2
src/platform/packages/private/kbn-screenshotting-server/tsconfig.type_check.json:20
```

</details>

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-07 15:32:38 +01:00
Patryk Kopyciński
d86a966ceb
Fix build_snapshot for Apple silicon laptops (#204951)
## Summary

`build_snapshot` was using wrong Gradle task when building ES from
source for Apple silicon laptops

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-07 14:09:46 +00:00
Anton Dosov
175916ef23
Sustainable Kibana Architecture: Move packages under packages/shared-ux/ (#205602) 2025-01-07 09:46:25 +00:00
Konrad Szwarc
2f61892e84
[EDR Workflows] Workflow Insights - RBAC (#205088)
## Access Control for Endpoint Workflow Insights

This PR adds access control to the Endpoint Workflow Insights
functionality. Both the UI and API are gated based on the following
conditions. If these conditions are not met, the content will not
render, and direct API calls will return errors.

Access Conditions
```
1. Serverless: Requires the Endpoint Complete Tier.
2. ESS: Requires an Enterprise License.
3. User Privileges:
    3.1 Endpoint Insights Privilege must be enabled:
        3.1.1 Endpoint Insights All: Grants full access.
	3.1.2 Endpoint Insights Read:
	    3.1.2.1 Allows users to view generated insights but prevents triggering new scans.
	    3.1.2.2 With Trusted Applications privilege: Users can remediate already generated insights.
	    3.1.2.3 Without Trusted Applications privilege: No actions can be taken.
	3.1.3Endpoint Insights None: The section is not rendered.
```

Predefined serverless roles that should include endpoint insights
privilege(as defined
[here](https://github.com/elastic/security-team/issues/11460)):
- Tier 3 analyst
- Rule Author
- SOC Manager
- Endpoint Operations Analyst
- Endpoint Policy Manager
- Platform Engineer

Once this PR is merged and changes make it to canary release, [this
follow-up
PR](https://github.com/elastic/elasticsearch-controller/pull/816) should
be merged.

Note on Testing and Local Setup

To test these changes locally, the `defendInsights` assistant feature
must be enabled. You can do this by updating the following line in the
code: [Enable defendInsights
here](2ae68bdaac/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/capabilities/index.ts (L23)).

Cypress Tests

Cypress tests in this PR are currently skipped because the
`defendInsights` feature is not enabled by default. These tests should
be enabled once the feature is turned on in the main branch. Successful
run with all cypress tests enabled can be found
[here](https://buildkite.com/elastic/kibana-pull-request/builds/262774#0193f3c2-eddd-48b6-9103-fb7338304f15).

<details>
<summary>Screenshots</summary>


![396870292-b5bbedad-330f-4ef5-8281-29699cf01a98](https://github.com/user-attachments/assets/586745d4-9e8d-42b4-8d70-e32737285f5c)

![b](https://github.com/user-attachments/assets/0926b696-37ef-48e8-9dfb-d6f735033583)

![a](https://github.com/user-attachments/assets/afa799bd-7e07-4a1a-b63e-6448ae56b21a)

![c](https://github.com/user-attachments/assets/cc3a2e07-0955-4348-a954-1914c5a85e81)
![Screenshot 2024-12-23 at 13 32
57](https://github.com/user-attachments/assets/fbb28bce-eedd-4a6e-85c3-b2a07f40ab27)
</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-07 09:33:25 +00:00
Jatin Kathuria
088169f446
[Security Solution] Fix timeline dynamic batching (#204034)
## Summary

Handles :


### Issue with Batches
- https://github.com/elastic/kibana/issues/201405
- Timeline had a bug where if users fetched multiple batches and then if
user adds a new column, the value of this new columns will only be
fetched for the latest batch and not old batches.
- This PR fixes that  by cumulatively fetching the data for old batches
till current batch `iff a new column has been added`.
- For example, if user has already fetched the 3rd batch, data for
1st,2nd and 3rd will be fetched together when a column has been added,
otherwise, data will be fetched incrementally.

### Issue with Elastic search limit

- Elastic search has a limit of 10K hits at max but we throw error at
10K which should be allowed.
    - Error should be thrown at anything `>10K`. 10001 for example.
    -   This PR fixes that just for timeline by allowing 10K hits.

### Removal of obsolete code

Below files related to old Timeline code are removed as well:
-
x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.test.tsx
-
x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx

---------

Co-authored-by: Philippe Oberti <philippe.oberti@elastic.co>
2025-01-07 06:20:30 +00:00
Efe Gürkan YALAMAN
e542fd2370
[Synonyms UI] Synonyms UI base plugin (#203284)
## Summary

Creates a plugin for Synonyms UI implementation. It is hidden under the
UI flag and config option which is off by default.
```
POST kbn:/internal/kibana/settings/searchSynonyms:synonymsEnabled
{"value": true}
```

Serverless Search:
<img width="379" alt="Screenshot 2024-12-17 at 13 18 02"
src="https://github.com/user-attachments/assets/8c2cb6f0-ce2a-4be6-8605-4f994adeefd7"
/>

Stack Search
<img width="293" alt="Screenshot 2024-12-17 at 13 21 43"
src="https://github.com/user-attachments/assets/0d61de0e-2cd3-46a6-990f-1f1a70843324"
/>



### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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
- [ ] [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 breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-06 19:15:19 +00:00
Michael Dokolin
540963148d
Sustainable Kibana Architecture: Fix after-relocation issues (#205613)
After merging #202748, #204959, and #201653, all of the properties in
some telemetry schemas were moved completely, but `node
scripts/telemetry_check --fix` didn't update the `properties` object
correctly.

Also, in #202748 and #201653, the relocation script changed some paths,
confusing them with `@kbn/security-plugin` and `@kbn/cloud-plugin`.
2025-01-06 19:02:36 +01:00
Joe McElroy
bf4c7da5c3
[Search] [Playground] updating AI SDK to latest (#204659)
## Summary

Upgrading AI SDK to latest version


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-06 16:20:06 +00:00
Karen Grigoryan
72980e1676
[Security Solution][Data Quality Dashboard]: migrate styled-component… (#205559)
…s to Emotion

Addresses #205449

This PR migrates `ecs_data_quality_dashboard` package from
`styled-components` to `emotion`. In the process we also convert the
`kbn/ui-theme` json tokens to `euiTheme` counterparts.

Additionally we decorate root `babel-jest`
[transform](211d4a6889/packages/kbn-test/src/jest/transforms/babel.js)
locally in `security_solution/public/overview` and
`ecs_data_quality_dashboard` package folder to include
`@emotion/babel-preset-css-prop`.

The reason for local `babel-jest` transforms is that root `babel-jest`
transform doesn't include `@emotion/babel-preset-css-prop` which is
necessary for proper compilation of emotion css prop in tests. Without
it there is a warning

![image](https://github.com/user-attachments/assets/c75b9827-a731-469c-a762-ff04f86cd80e)
appearing in every test that tests a component that uses css prop with
theme function passed into it. Other use cases seem to be compiling fine
without this babel preset. But theme callback is a valid way of using
emotion so we shouldn't avoid using it just because it's not added
properly to the test compilation step. Hence I am adding it locally to
`ecs_data_quality_dashboard` package and
`security_solution/public/overview`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-06 14:48:11 +01:00
Tomasz Kajtoch
211d4a6889
Update styled_components_files.js to include all files that import styled-components (#205011) 2025-01-05 16:54:17 +01:00
Gerard Soldevila
ca5a08db00
Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-security (#202748)
## Summary

This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
> * Manually review
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that
any CI pipeline customizations continue to be correctly applied after
the changed path names
> * Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below, as some of them contain relative paths
that have been updated.
> * Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
>     * customised eslint rules
>     * docs pointing to source code

> [!NOTE]
> * This PR has been auto-generated.
> * Any manual contributions will be lost if the 'relocate' script is
re-run.
> * Try to obtain the missing reviews / approvals before applying manual
fixes, and/or keep your changes in a .patch / git stash.
> * Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.

Are you trying to rebase this PR to solve merge conflicts? Please follow
the steps describe
[here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E).

#### 4 plugin(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/encrypted-saved-objects-plugin` |
`x-pack/platform/plugins/shared/encrypted_saved_objects` |
| `@kbn/interactive-setup-plugin` |
`src/platform/plugins/private/interactive_setup` |
| `@kbn/security-plugin` | `x-pack/platform/plugins/shared/security` |
| `@kbn/spaces-plugin` | `x-pack/platform/plugins/shared/spaces` |




#### 14 packages(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/crypto` | `src/platform/packages/shared/kbn-crypto` |
| `@kbn/handlebars` | `src/platform/packages/private/kbn-handlebars` |
| `@kbn/safer-lodash-set` |
`src/platform/packages/shared/kbn-safer-lodash-set` |
| `@kbn/security-api-key-management` |
`x-pack/platform/packages/shared/security/api_key_management` |
| `@kbn/security-authorization-core` |
`x-pack/platform/packages/private/security/authorization_core` |
| `@kbn/security-authorization-core-common` |
`x-pack/platform/packages/private/security/authorization_core_common` |
| `@kbn/security-form-components` |
`x-pack/platform/packages/shared/security/form_components` |
| `@kbn/security-hardening` |
`src/platform/packages/shared/kbn-security-hardening` |
| `@kbn/security-plugin-types-common` |
`x-pack/platform/packages/shared/security/plugin_types_common` |
| `@kbn/security-plugin-types-public` |
`x-pack/platform/packages/shared/security/plugin_types_public` |
| `@kbn/security-plugin-types-server` |
`x-pack/platform/packages/shared/security/plugin_types_server` |
| `@kbn/security-role-management-model` |
`x-pack/platform/packages/private/security/role_management_model` |
| `@kbn/security-ui-components` |
`x-pack/platform/packages/private/security/ui_components` |
| `@kbn/user-profile-components` |
`src/platform/packages/shared/kbn-user-profile-components` |


<details open>
<summary>Script errors</summary>

```
Cannot replace multiple occurrences of "../.." in the same line, please fix manually:	/Users/dokmic/work/elastic/kibana/src/platform/packages/shared/kbn-safer-lodash-set/package.json:6
```

</details><details >
<summary>Updated references</summary>

```
./.buildkite/scripts/steps/test/kbn_handlebars.sh
./.eslintrc.js
./.i18nrc.json
./docs/developer/advanced/sharing-saved-objects.asciidoc
./docs/developer/plugin-list.asciidoc
./legacy_rfcs/text/0007_lifecycle_unblocked.md
./legacy_rfcs/text/0016_ols_phase_1.md
./package.json
./packages/kbn-dependency-usage/src/dependency_graph/providers/cruiser.test.ts
./packages/kbn-ts-projects/config-paths.json
./packages/kbn-user-profile-components/src/user_profile.ts
./src/core/packages/saved-objects/common/src/types.ts
./src/core/packages/security/server/src/audit_logging/audit_logger.ts
./src/core/packages/user-profile/common/src/user_profile.ts
./src/dev/precommit_hook/casing_check_config.js
./src/platform/packages/private/kbn-handlebars/README.md
./src/platform/packages/private/kbn-handlebars/index.test.ts
./src/platform/packages/private/kbn-handlebars/index.ts
./src/platform/packages/private/kbn-handlebars/jest.config.js
./src/platform/packages/private/kbn-handlebars/scripts/check_for_upstream_updates.sh
./src/platform/packages/private/kbn-handlebars/scripts/print_ast.js
./src/platform/packages/private/kbn-handlebars/scripts/update_upstream_git_hash.sh
./src/platform/packages/private/kbn-handlebars/src/__jest__/test_bench.ts
./src/platform/packages/private/kbn-handlebars/src/handlebars.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.basic.test.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.blocks.test.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.builtins.test.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.compiler.test.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.data.test.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.helpers.test.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.partials.test.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.regressions.test.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.security.test.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.strict.test.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.subexpressions.test.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.utils.test.ts
./src/platform/packages/private/kbn-handlebars/src/spec/index.whitespace_control.test.ts
./src/platform/packages/private/kbn-handlebars/src/symbols.ts
./src/platform/packages/private/kbn-handlebars/src/types.ts
./src/platform/packages/private/kbn-handlebars/src/utils.ts
./src/platform/packages/private/kbn-handlebars/src/visitor.ts
./src/platform/packages/private/kbn-repo-packages/package-map.json
./src/platform/packages/private/kbn-ui-shared-deps-src/BUILD.bazel
./src/platform/packages/shared/kbn-crypto/jest.config.js
./src/platform/packages/shared/kbn-safer-lodash-set/fp/assoc.d.ts
./src/platform/packages/shared/kbn-safer-lodash-set/fp/assoc.js
./src/platform/packages/shared/kbn-safer-lodash-set/fp/assocPath.d.ts
./src/platform/packages/shared/kbn-safer-lodash-set/fp/assocPath.js
./src/platform/packages/shared/kbn-safer-lodash-set/fp/index.d.ts
./src/platform/packages/shared/kbn-safer-lodash-set/fp/index.js
./src/platform/packages/shared/kbn-safer-lodash-set/fp/set.d.ts
./src/platform/packages/shared/kbn-safer-lodash-set/fp/set.js
./src/platform/packages/shared/kbn-safer-lodash-set/fp/setWith.d.ts
./src/platform/packages/shared/kbn-safer-lodash-set/fp/setWith.js
./src/platform/packages/shared/kbn-safer-lodash-set/index.d.ts
./src/platform/packages/shared/kbn-safer-lodash-set/index.js
./src/platform/packages/shared/kbn-safer-lodash-set/lodash/_baseSet.js
./src/platform/packages/shared/kbn-safer-lodash-set/lodash/set.js
./src/platform/packages/shared/kbn-safer-lodash-set/lodash/setWith.js
./src/platform/packages/shared/kbn-safer-lodash-set/package.json
./src/platform/packages/shared/kbn-safer-lodash-set/scripts/_get_lodash.sh
./src/platform/packages/shared/kbn-safer-lodash-set/scripts/license-header.txt
./src/platform/packages/shared/kbn-safer-lodash-set/scripts/save_state.sh
./src/platform/packages/shared/kbn-safer-lodash-set/scripts/update.sh
./src/platform/packages/shared/kbn-safer-lodash-set/set.d.ts
./src/platform/packages/shared/kbn-safer-lodash-set/set.js
./src/platform/packages/shared/kbn-safer-lodash-set/setWith.d.ts
./src/platform/packages/shared/kbn-safer-lodash-set/setWith.js
./src/platform/packages/shared/kbn-safer-lodash-set/test/fp.ts
./src/platform/packages/shared/kbn-safer-lodash-set/test/fp_assoc.ts
./src/platform/packages/shared/kbn-safer-lodash-set/test/fp_assocPath.ts
./src/platform/packages/shared/kbn-safer-lodash-set/test/fp_patch_test.js
./src/platform/packages/shared/kbn-safer-lodash-set/test/fp_set.ts
./src/platform/packages/shared/kbn-safer-lodash-set/test/fp_setWith.ts
./src/platform/packages/shared/kbn-safer-lodash-set/test/index.ts
./src/platform/packages/shared/kbn-safer-lodash-set/test/patch_test.js
./src/platform/packages/shared/kbn-safer-lodash-set/test/set.ts
./src/platform/packages/shared/kbn-safer-lodash-set/test/setWith.ts
./src/platform/packages/shared/kbn-user-profile-components/jest.config.js
./src/platform/plugins/private/interactive_setup/jest.config.js
./tsconfig.base.json
./x-pack/.i18nrc.json
./x-pack/platform/packages/private/security/authorization_core/jest.config.js
./x-pack/platform/packages/private/security/authorization_core_common/jest.config.js
./x-pack/platform/packages/private/security/role_management_model/jest.config.js
./x-pack/platform/packages/private/security/ui_components/jest.config.js
./x-pack/platform/packages/shared/security/api_key_management/jest.config.js
./x-pack/platform/packages/shared/security/form_components/jest.config.js
./x-pack/platform/plugins/shared/cases/server/authorization/index.ts
./x-pack/platform/plugins/shared/cases/server/authorization/types.ts
./x-pack/platform/plugins/shared/cases/server/connectors/cases/utils.ts
./x-pack/platform/plugins/shared/cases/server/routes/api/utils.ts
./x-pack/platform/plugins/shared/encrypted_saved_objects/README.md
./x-pack/platform/plugins/shared/encrypted_saved_objects/jest.config.js
./x-pack/platform/plugins/shared/fleet/common/http_authorization_header.ts
./x-pack/platform/plugins/shared/rule_registry/server/lib/get_is_kibana_request.ts
./x-pack/platform/plugins/shared/security/jest.config.js
./x-pack/platform/plugins/shared/spaces/jest.config.js
./x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts
./yarn.lock
.github/CODEOWNERS
```

</details><details >
<summary>Updated relative paths</summary>

```
src/platform/packages/private/kbn-handlebars/jest.config.js:8
src/platform/packages/private/kbn-handlebars/src/spec/index.regressions.test.ts:276
src/platform/packages/private/kbn-handlebars/src/spec/index.regressions.test.ts:277
src/platform/packages/private/kbn-handlebars/tsconfig.json:2
src/platform/packages/shared/kbn-crypto/jest.config.js:12
src/platform/packages/shared/kbn-crypto/tsconfig.json:2
src/platform/packages/shared/kbn-safer-lodash-set/package.json:6
src/platform/packages/shared/kbn-safer-lodash-set/package.json:7
src/platform/packages/shared/kbn-safer-lodash-set/package.json:8
src/platform/packages/shared/kbn-safer-lodash-set/tsconfig.json:2
src/platform/packages/shared/kbn-security-hardening/tsconfig.json:2
src/platform/packages/shared/kbn-user-profile-components/jest.config.js:12
src/platform/packages/shared/kbn-user-profile-components/tsconfig.json:2
src/platform/plugins/private/interactive_setup/jest.config.js:12
src/platform/plugins/private/interactive_setup/tsconfig.json:2
x-pack/platform/packages/private/security/authorization_core/jest.config.js:13
x-pack/platform/packages/private/security/authorization_core/tsconfig.json:2
x-pack/platform/packages/private/security/authorization_core_common/jest.config.js:15
x-pack/platform/packages/private/security/authorization_core_common/tsconfig.json:2
x-pack/platform/packages/private/security/role_management_model/jest.config.js:14
x-pack/platform/packages/private/security/role_management_model/tsconfig.json:2
x-pack/platform/packages/private/security/ui_components/jest.config.js:13
x-pack/platform/packages/private/security/ui_components/tsconfig.json:2
x-pack/platform/packages/shared/security/api_key_management/jest.config.js:14
x-pack/platform/packages/shared/security/api_key_management/tsconfig.json:2
x-pack/platform/packages/shared/security/form_components/jest.config.js:14
x-pack/platform/packages/shared/security/form_components/tsconfig.json:2
x-pack/platform/packages/shared/security/plugin_types_common/tsconfig.json:2
x-pack/platform/packages/shared/security/plugin_types_public/tsconfig.json:2
x-pack/platform/packages/shared/security/plugin_types_server/tsconfig.json:2
x-pack/platform/plugins/shared/encrypted_saved_objects/README.md:8
x-pack/platform/plugins/shared/encrypted_saved_objects/jest.config.js:10
x-pack/platform/plugins/shared/encrypted_saved_objects/tsconfig.json:2
x-pack/platform/plugins/shared/security/jest.config.js:10
x-pack/platform/plugins/shared/security/tsconfig.json:2
x-pack/platform/plugins/shared/spaces/jest.config.js:10
x-pack/platform/plugins/shared/spaces/tsconfig.json:2
```

</details>

---------

Co-authored-by: Michael Dokolin <mikhail.dokolin@elastic.co>
Co-authored-by: “jeramysoucy” <jeramy.soucy@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-05 12:57:01 +01:00
Gerard Soldevila
6049493e4a
Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-core (#201653)
## Summary

Start relocating Kibana modules (packages and plugins) to the new folder
structure, according to the _Kibana Sustainable Architecture_
initiative.
#### 16 plugin(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/cloud-chat-plugin` |
`x-pack/platform/plugins/private/cloud_integrations/cloud_chat` |
| `@kbn/cloud-experiments-plugin` |
`x-pack/platform/plugins/shared/cloud_integrations/cloud_experiments` |
| `@kbn/cloud-full-story-plugin` |
`x-pack/platform/plugins/private/cloud_integrations/cloud_full_story` |
| `@kbn/cloud-links-plugin` |
`x-pack/platform/plugins/private/cloud_integrations/cloud_links` |
| `@kbn/cloud-plugin` | `x-pack/platform/plugins/shared/cloud` |
| `@kbn/features-plugin` | `x-pack/platform/plugins/shared/features` |
| `@kbn/ftr-apis-plugin` | `src/platform/plugins/private/ftr_apis` |
| `@kbn/kibana-usage-collection-plugin` |
`src/platform/plugins/private/kibana_usage_collection` |
| `@kbn/licensing-plugin` | `x-pack/platform/plugins/shared/licensing` |
| `@kbn/newsfeed-plugin` | `src/platform/plugins/shared/newsfeed` |
| `@kbn/saved-objects-management-plugin` |
`src/platform/plugins/shared/saved_objects_management` |
| `@kbn/telemetry-collection-manager-plugin` |
`src/platform/plugins/shared/telemetry_collection_manager` |
| `@kbn/telemetry-collection-xpack-plugin` |
`x-pack/platform/plugins/private/telemetry_collection_xpack` |
| `@kbn/telemetry-management-section-plugin` |
`src/platform/plugins/shared/telemetry_management_section` |
| `@kbn/telemetry-plugin` | `src/platform/plugins/shared/telemetry` |
| `@kbn/usage-collection-plugin` |
`src/platform/plugins/shared/usage_collection` |

#### 22 package(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/analytics` | `src/platform/packages/shared/kbn-analytics` |
| `@kbn/analytics-collection-utils` |
`src/platform/packages/private/analytics/utils/analytics_collection_utils`
|
| `@kbn/apm-config-loader` |
`src/platform/packages/private/kbn-apm-config-loader` |
| `@kbn/cloud` | `src/platform/packages/shared/cloud` |
| `@kbn/config` | `src/platform/packages/shared/kbn-config` |
| `@kbn/config-mocks` | `src/platform/packages/private/kbn-config-mocks`
|
| `@kbn/config-schema` |
`src/platform/packages/shared/kbn-config-schema` |
| `@kbn/crypto-browser` |
`src/platform/packages/shared/kbn-crypto-browser` |
| `@kbn/ebt-tools` | `src/platform/packages/shared/kbn-ebt-tools` |
| `@kbn/es-errors` | `src/platform/packages/shared/kbn-es-errors` |
| `@kbn/es-types` | `src/platform/packages/shared/kbn-es-types` |
| `@kbn/hapi-mocks` | `src/platform/packages/private/kbn-hapi-mocks` |
| `@kbn/health-gateway-server` |
`src/platform/packages/private/kbn-health-gateway-server` |
| `@kbn/i18n` | `src/platform/packages/shared/kbn-i18n` |
| `@kbn/i18n-react` | `src/platform/packages/shared/kbn-i18n-react` |
| `@kbn/logging` | `src/platform/packages/shared/kbn-logging` |
| `@kbn/logging-mocks` |
`src/platform/packages/shared/kbn-logging-mocks` |
| `@kbn/router-to-openapispec` |
`src/platform/packages/shared/kbn-router-to-openapispec` |
| `@kbn/server-http-tools` |
`src/platform/packages/shared/kbn-server-http-tools` |
| `@kbn/std` | `src/platform/packages/shared/kbn-std` |
| `@kbn/utility-types` |
`src/platform/packages/shared/kbn-utility-types` |
| `@kbn/zod` | `src/platform/packages/shared/kbn-zod` |

---------

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-04 11:47:24 -07:00
Catherine Liu
2b9104c327
[kbn-grid-layout] EUI Visual Refresh Integration (#204445)
## Summary

Related to https://github.com/elastic/kibana/issues/203132.
Closes [#204592](https://github.com/elastic/kibana/issues/204592).

This replaces all references to euiThemeVars in favor of the useEuiTheme
hook in the `kbn-grid-layout` package.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
2025-01-03 13:10:37 -08:00
Eyo O. Eyo
8f01c3032c
[SharedUX] Modify code editor theme definition and resolution implementation to account for color modes in EUI Theme (#203337)
## Summary

<!-- ### DONT MERGE, THIS PR DEPENDS ON AN UPDATE TO EUI, THAT'S IN
FLIGHT -->

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

This PR reworks how custom themes used within the kibana code editor for
the default visual look and ones specific to supported languages are
defined to accomodate the upcoming visual refresh, the approach here
leverages the `euiTheme` object value returned from the `useEuiTheme`
hook, now a single theme declaration is all that is required such that
using either the `colorMode `value or the `euiTheme` from the provided
`UseEUITheme` value it's possible to craft a theme that's in the context
of kIbana, color mode aware and the editor would be able to resolve the
appropriate colors depending on the user's color mode.

This required some modification to monaco itself; now when defining
languages if the `CustomLanguageType` specification is being followed, a
function that resolves to a standard monaco theme can be provided on the
property `languageThemeResolver` which will be passed the `euiTheme`
when registering this theme. It's worth mentioning that this can also be
done manually by leveraging the custom method
`registerLanguageThemeResolver` added on the monaco editor object, like
so

```tsx
 monaco.editor.registerLanguageThemeResolver(LanguageID, languageThemeResolver);
``` 

However one should take note that when calling this method directly, the
ID passed must correlate to a registered language ID, else the theme
will not be available for use after Monaco is initialised, hence the
theme name must equal an existing language ID if it's to be used for a
specific language.


## How to test

- Enable borealis, like so;
	- in your `kibana.dev.yml` file include the following config;
		```yml
		uiSettings.experimental.themeSwitcherEnabled: true
		```
- start kibana using the following command;
`KBN_OPTIMIZER_THEMES="borealislight,borealisdark,v8light,v8dark" yarn
start --run-examples`
- Tryout all downstream of the code editor to ascertain the code editor
colors are as should be for both Amsterdam and Borealis; downstreams
include;
  - ES|QL editor, navigate to discover and click the "try ES|QL" button
- Dev tools, on clicking the nav hamburger menu under the management
menu group there's a menu item that links to all dev tools
- Index Management use cases; navigate to stack management, under Index
management select any existing index, then navigate to it's settings
this should load up the code editor.
- Saved Object use case; navigate to stack management, under saved
objects attempt inspecting any saved object we'd be presented with the
code editor etc.
  
<!--
### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...


-->

---------

Co-authored-by: ek-so <eksomail@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-03 15:02:24 +01:00
Anton Dosov
9215df9200
Sustainable Kibana Architecture: Move plugins owned by @elastic/appex-sharedux (#204959)
## Summary

Part of https://github.com/elastic/kibana/pull/203163

Relocating only shared-ux-owned plugins for now
2025-01-03 05:38:57 -06:00
Jesus Wahrman
1b1d64b0a5
Set HTTP2 as default is SSL is enabled and add deprecation log if SSL is not enabled or protocol is set to HTTP1 (#204384)
## Summary

resolves https://github.com/elastic/kibana/issues/194067

Set HTTP2 as default if ssl is enabled. 

resolves https://github.com/elastic/kibana/issues/194065

Add deprecation log if ssl is not enabled or if protocol is set to http1

<img width="1665" alt="Screenshot 2024-12-17 at 17 06 50"
src="https://github.com/user-attachments/assets/3bc7ff57-1079-4a27-90d2-88f3e09093d6"
/>

<img width="1727" alt="Screenshot 2024-12-17 at 17 06 22"
src="https://github.com/user-attachments/assets/d5489705-6cd6-4e09-8327-fdd0f54292ea"
/>


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
2025-01-03 10:21:32 +01:00
Hannah Mudge
1ff181c5df
[Dashboard][Collapsable Panels] New collision resolution algorithm (#204134)
Closes https://github.com/elastic/kibana/issues/191306

## Summary

This PR updates the collision resolution algorithm to handle the edge
case described in the linked issue.

In the old algorithm, we checked each panel for collisions a **single
time** - however, this caused a bug where panels could get re-ordered
depending on the order that we pushed panels down + how much distance we
were pushing them down by. While this algorithm was extremely efficient
(approximately $`O \left({ { n^2 + n } \over 2 }\right)`$ before
compaction where `n` is the number of panels), it was not as simple as
"fixing" the bug because, no matter what, there was always an edge case
that could not be handled without adding some sort of backtracking -
instead, we had to come up with a new algorithm.

### Example of Edge Case

To better understand how the old and new algorithms compare (and how
they work), consider a scenario where the grid layout has 8 columns and
the panels are laid out as follows:


![image](https://github.com/user-attachments/assets/94fbb8f6-b6b8-4f9e-af91-0128717cdffc)

Now, what happens when panel 4 (yellow) is dragged to the left so that
it overlaps both panel 3 (red) and panel 4 (blue)?


<details>
<summary><b>Old Algorithm</b></summary>

With the old algorithm, we get the following behaviour:
  
![Dec-16-2024
17-04-58](https://github.com/user-attachments/assets/9a920046-cf53-4dff-bfbe-6ed0aed05f77)

This is because we are **only** pushing the collided panels down
**once**. So, to describe what happens in detail, we start by gathering
up the panels **in order** (top-bottom, left-right, where dragged panels
take priority when rows are equal) - this results in an order of
`[panel4, panel3, panel1, panel2]`.

We start checking for collisions in this order - starting with panel 4
(yellow), we determine that it is colliding with panel 3 (red) and panel
2 (blue). We start with panel 3 (since we are once again doing this "in
order"), and we push it down by 5 rows (since this is the overlap of the
panel 3 and panel 4). Then, to "resolve" the second collision with panel
4, we push down panel 2 by 3 rows. This leaves the layout in the
following state:

   

![image](https://github.com/user-attachments/assets/47aa981e-9e4f-4c30-8570-abf6ba4a20ba)

Now, since panel 4 (yellow) is "resolved", we move on to the next panel
in the `[panel4, panel3, panel1, panel2]` order - panel 3 (red). Panel 3
now collides with panel 2, so we push panel 2 down by two rows. This is
the only collision with panel 3, so we check panel 1 and panel 2,
neither of which report collisions at this point. So the layout ends in
the following state:


![image](https://github.com/user-attachments/assets/4c5e3aca-399c-4075-9897-a5d2d73e9284)

So, what's the problem here? Well, panel 1 (green) is now "out of sync"
with the old panel ordering because it got "left behind" in the
collision resolution. Instead, we should have moved panel 1 by the same
amount as panel 2.

</details>


<details>
<summary><b>New Algorithm</b></summary>

With the new algorithm, we get the expected behaviour:

![Dec-16-2024
17-30-28](https://github.com/user-attachments/assets/4cd7d49d-138b-4b59-ac78-0ea2cbc86c3c)

If we run through the algorithm, we identify that the **first**
collision in the layout (based on left to right, top to bottom ordering,
with priority being the panel being dragged) is panel 4 (yellow) - so,
we enter the `while` loop and recurse to resolve all collisions with
panel 4 via `resolvePanelCollisions`. The recursion within
`resolvePanelCollisions` works as follows - get **all** collisions with
panel 4 (which, at this point, returns panel 3 (red) and panel 2 (blue))
and push them down by a single row, then recurse on **those** panels to
resolve any of the resulting collisions.

It's difficult to describe recursion, but let me try my best :) During
the collision resolution on panel 4, we start by pushing panel 3 down
and then recursively resolving the collisions on panel 3. Since pushing
panel 3 causes collisions with panel 1 and 2 (in order), we push them
both down by one row - starting with panel 1. We recurse to resolve the
collisions on panel 1, which has no collisions - then we do the same for
panel 2, which also reports no collisions. The collisions with panel 3
are "resolved" (i.e. we can "back out" of the recursion on panels 1 and
2), so we go back to resolving panel 4, push panel **2** down, and then
resolve the collisions on panel 2 - which reports no collisions. In
summary:


![image](https://github.com/user-attachments/assets/ca82ca05-673e-4bf1-b22f-e2aa1c7b6ba4)


Therefore, after the first iteration of the `while` loop, this results
in the following layout, where panel 3 (red) has been pushed down by one
row, panel 1 (green) has been pushed down by one row, and panel 2 (blue)
has been pushed down by two rows:


![image](https://github.com/user-attachments/assets/ec7c08a5-d0e9-46f7-bf3c-2eede7cef6fd)

We then return to the `while` loop and check if the layout has any other
collisions - and panel 4 is still our "first" collision! So we repeat
the process above and push both panel 4 and panel 2 down and recurse to
resolve the resulting collisions on those panels. This continues as
follows:

| Steps | Resulting Layout |
|--------|--------|
| <img width="400"
src="https://github.com/user-attachments/assets/d2691a1c-5f0b-4333-bfd4-3cc57e1a3098"/>
| <img width="400"
src="https://github.com/user-attachments/assets/85325df3-7fbf-46fa-af98-10bbd883cf8d"/>
|
| <img width="400"
src="https://github.com/user-attachments/assets/e31a400f-d0d1-408d-baec-efa708ad0c52"/>
| <img width="400"
src="https://github.com/user-attachments/assets/c81762d4-443b-451c-b8fc-dabaf4e32ba1"/>
|
| <img width="400"
src="https://github.com/user-attachments/assets/4292e4a9-4157-4d77-9b69-b0f6a07338ac"/>
| <img width="400"
src="https://github.com/user-attachments/assets/bdd2dad5-6531-4d56-b8c2-dfb121fb6b5b"/>
|
| <img width="400"
src="https://github.com/user-attachments/assets/6d194a89-3ed6-46a6-9dcc-2b3fa0de9942"/>
| <img width="400"
src="https://github.com/user-attachments/assets/7e0b0fb5-bacb-49ad-ac86-02665a779b59"/>
|

And so, after our fifth iteration of the `while` loop, the layout is
**no longer** reporting collisions - so, our layout is now fully
resolved!

</details>

### Performance Comparison

This algorithm is more-or-less the same as the algorithm used in
`react-grid-layout` - however, instead of running on **every frame**,
our layout engine only resolves collisions **as they happen** (hence why
the while loop is necessary). This results in much better rendering
performance.

To test this, I opened the Logs sample dashboard in both the example app
(which is obviously using `kbn-grid-layout`) and Dashboard (which is
still using `react-grid-layout`) and performed various drag actions on
both while recording their performance. For example, consider the
following capture of a drag that doesn't cause **any** collisions:

| `kbn-grid-layout` | `react-grid-layout` |
|--------|--------|
|
![image](https://github.com/user-attachments/assets/7fa1e9bb-e3dd-4f99-b011-0a46e53f0e88)
|
![image](https://github.com/user-attachments/assets/05e86a48-769d-4bae-ba48-d2fb3bdde90e)
|

You can see that, even with no collisions, the performance is slightly
better with `kbn-grid-layout` because we don't **ever** recurse on
collisions in this scenario. But it gets even better when actual
collisions happen - for example, consider the performance when the
dragged panel only causes a **single** collision:

| `kbn-grid-layout` | `react-grid-layout` |
|--------|--------| 
|
![image](https://github.com/user-attachments/assets/5e39a616-aa96-43be-a316-cb8fc4258b88)
|
![image](https://github.com/user-attachments/assets/520ab5b6-7049-4028-9d8c-63972aff9e92)
|


Versus when the dragged panel causes multiple collisions at the top of
the dashboard that causes a chain reaction of panels needing to be
pushed down:

| `kbn-grid-layout` | `react-grid-layout` |
|--------|--------| 
|
![image](https://github.com/user-attachments/assets/4d6b15c6-181a-4ea0-a179-09702b50411a)
|
![image](https://github.com/user-attachments/assets/363ef360-3c4f-4327-8031-18aca3833bce)
|

In all of the above scenarios, performance is improved overall **and**
there are fewer red "spikes" / bottlenecks due to [forced
reflow](https://web.dev/articles/avoid-large-complex-layouts-and-layout-thrashing?utm_source=devtools#avoid-forced-synchronous-layouts)
along the way. Most of the time saved is caused by significant
reductions to both `rendering` and `painting` time in `kbn-grid-layout`
when compared to `react-grid-layout`. While some of this improvement may
be explained by differences in the example grid plugin versus the
Dashboard plugin, this is enough proof that performance of
`kbn-grid-layout` is **at least as good as** `react-grid-layout` and so
swapping out the layout engine should not cause any performance
regressions.


### Other Notable Algorithm Attempts

I tried a few **drag/resize event specific** algorithms that **only
work** when an interaction event is happening - i.e. they rely on
information from the panel that is being interacted with in order to
function.

Note that, if we decided to go this route, we would still need some
generic collision resolution algorithm (such as the one proposed in this
PR) that we could use to resolve a layout when **no** interaction event
is happening. After all, we cannot assume that the grid layout that is
sent as a prop is valid (i.e. it **could** have overlapping panels **at
the start**, before any dragging and/or resizing has occurred) and we
need a way to verify + resolve it.

Unfortunately, both of the "interaction-event necessary" collision
resolution algorithms that I tried suffered from bugs so, while it might
be **possible** to make a more efficient algorithm for this, I
ultimately threw them away in favour of using the "generic" collision
resolution algorithm proposed in this PR.

That being said, I figured it was worth documenting the things that I
tried and why they failed.

<details>
<summary><b>Algorithm 1</b></summary>

I tried a modification of the **original** collision resolution
algorithm where, instead of **just** moving the colliding panels down by
the `rowOverlap` amount, we move **all** panels in or below the targeted
grid row down by the **height** of the panel being dragged. However, due
to the compaction algorithm ignoring **all** panels that have
collisions, you can end up in an infinite "push panels down" loop like
so:
 
![Dec-16-2024
15-31-22](https://github.com/user-attachments/assets/29364168-6bd5-4b62-839e-a63636af71f5)

This is because panel 3 is **always** colliding with panel 1 and 4, so
they never get pushed up to "close" the gaps. To try and get around
this, I modified the collision detection used for panel compaction so
that collisions only "stop" compaction if the collision occurs on a
panel **above** the given panel we are trying to compact. However, this
caused a **different** bug:

![Dec-16-2024
15-12-22](https://github.com/user-attachments/assets/34f23bfd-6a5d-4ff5-8421-10b7bab89551)

In the above GIF, consider what happens when panel 3 (red) targets row
3. As expected, we move all other panels (1, 2, and 4) down by a single
row. Then, when we reach the compaction step, we start by trying to push
panel 1 up (since it is now the top-left-most panel) - and, since we are
filtering out the collision with panel 3 (since it occurs "below" panel
1), it gets pushed all the way to the top. Then, we push panel 4 all the
way to the top (because it is also ignoring the collision with panel 3),
followed by pushing panel 2 up until it would collide with panel 3.
Unfortunately though, we didn't account for the full height of panel 4 -
so panel 3 is now stuck colliding with panel 4.

I modified this algorithm **further** to move the panels down by the
"row overlap" with the dragged panel rather than the dragged panel's
height - but this also suffers from a bug:

![Dec-16-2024
16-29-12](https://github.com/user-attachments/assets/950cb573-0caf-4c44-8f63-2fc465c2c497)
   
At which point, I abandoned this approach becase it felt like there were
too many edge cases that could not all be accounted for. It's possible
we could explore this further but, given the limitations of this
algorithm **only working** for resolving collisions given an interaction
event, I opted to move on.
</details>

<details>
<summary><b>Algorithm 2</b></summary>

I tried an algorithm where, similar to the algorithm proposed in this
PR, I recorded the panel IDs in each cell that a given panel occupied -
however, instead of moving things down row by row and handling the
resulting collisions, we moved **every** panel that was **below** the
targetted row down by the **height** of the panel being dragged. In
theory, the compaction algorithm would then take control of closing all
the resulting gaps.
  
Unfortunately, this didn't quite work in practice. Consider the
following:
  
![Dec-16-2024
10-17-21](https://github.com/user-attachments/assets/8157dabd-bb52-4089-9493-74cbdcf49e5e)
 
  
According to the algorithm defined above, panel 2 (blue) and panel 4
(yellow) both need to move down when panel 3 (red) is dragged to target
row 4 (remember that row **zero** is the first row), since they both
occupy this row - so we push both of them down by 1 (the height of panel
3). However, once we start compacting the layout in order to finish our
collision resolution, we hit a snag with panel 4 (yellow) - when we
start trying to compact panel 4, `getAllCollisionsWithPanel` returns
that **panel 3** is colliding with panel 4 and so we **break out** of
the compaction - hence why panel 4 continues to float. This then has a
snowball effect on all other panels as they report collisions and
therefore do not get pushed up.
</details>
 

<details>
<summary><b>Algorithm 3</b></summary>

This was the algorithm we **almost** went with, because it works! But it
suffered from two things - one, the code was complicated and difficult
to maintain and two, the collision resolution behaviour felt less
natural because it **always** favoured the dragged panel. This made it
too sensitive to pushing items down; so even if a panel was targeting
the bottom row of a different panel, it would push that panel down to
make room for the dragged panel.

In the simplest terms, this algorithm worked as follows: after creating
a 3D array representing the current grid (a 2D array of panel ID
arrays), for each row, while there are collisions, push panels down in
**reverse order** (bottom right to top left); continue until all rows
have no collisions. This algorithm hd an efficiency of approximately
$`O\left(r * c \right)`$ to set up the 3D array and $`O \left( c * h * n
\right)`$ to resolve the conflicts, where `r` is the number of rows, `c`
is the number of columns (minus 1), `h` is the height of the dragged
panel, and `n` is the number of panels. This results in an overall speed
of about $`O \left( (r * c) + (c * h * n) \right)`$

To better understand how this algorithm works, consider how it handles
the edge case described above:


<details>
<summary>Algorithm 3 - Edge Case Example</summary>

Rather than checking every **panel** for collisions a single time, we
check and resolve each **row** for collisions and resolve them. This
gives the following behaviour:


![Dec-16-2024
17-30-28](https://github.com/user-attachments/assets/60cf3347-707c-4bc2-99e5-0e042c4cbed3)

We start by creating a 3D array representing the grid - at the **first**
point of collision, it looks like:

|   | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |

|--------|--------|--------|--------|--------|--------|--------|--------|--------|
| **0** | `[panel3]` | `[panel3]` | `[panel3]` | `[panel3, panel4]` |
`[panel4]` | `[panel4]` | `[panel4]` | `[]` |
| **1** | `[panel3]` | `[panel3]` | `[panel3]` | `[panel3, panel4]` |
`[panel4]` | `[panel4]` | `[panel4]` | `[]` |
| **2** | `[panel1]` | `[panel1]` | `[panel2]` | `[panel2, panel4]` |
`[panel4]` | `[panel4]` | `[panel4]` | `[]` |
| **3** | `[panel1]` | `[panel1]` | `[panel2]` | `[panel2, panel4]` |
`[panel4]` | `[panel4]` | `[panel4]` | `[]` |
| **4** | `[panel1]` | `[panel1]` | `[panel2]` | `[panel2, panel4]` |
`[panel4]` | `[panel4]` | `[panel4]` | `[]` |

Then, we start checking and resolving collisions, row by row. Starting
with row 0, we see that column 3 has a collision between panel 3 and
panel 4 - we **ignore** the panel being dragged (panel 4), so we push
down panel 3 by one row. Row 0 has no more collisions, so we move on to
row 1 and, following the same logic as above, we push down panel 3
again. This leaves the grid in the following state:


![image](https://github.com/user-attachments/assets/47ee1f8c-5107-41eb-8309-527e6fd773be)

|   | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |

|--------|--------|--------|--------|--------|--------|--------|--------|--------|
| **0** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **1** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **2** | `[panel1, panel3]` | `[panel1, panel3]` | `[panel2, panel3]` |
`[panel3, panel2, panel4]` | `[panel4]` | `[panel4]` | `[panel4]` | `[]`
|
| **3** | `[panel1, panel3]` | `[panel1, panel3]` | `[panel2, panel3]` |
`[panel3, panel2, panel4]` | `[panel4]` | `[panel4]` | `[panel4]` | `[]`
|
| **4** | `[panel1]` | `[panel1]` | `[panel2]` | `[panel2, panel4]` |
`[panel4]` | `[panel4]` | `[panel4]` | `[]` |

Now, on row 2, we have collisions in columns zero through three, so we
push the panels in **reverse order** (i.e from the bottom right to the
top left) - this results in pushing panel 2 down, then panel 1, and
finally panel 3. We have to add a row in order to accomplish this
because otherwise we "lose" the bottom of panel 2, so our layout now
looks like this and row 2 has no more collisions:
   

![image](https://github.com/user-attachments/assets/b5697592-cb0e-4fac-90c9-6f3ade5e9db9)

|   | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |

|--------|--------|--------|--------|--------|--------|--------|--------|--------|
| **0** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **1** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **2** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **3** | `[panel1, panel3]` | `[panel1, panel3]` | `[panel2, panel3]` |
`[panel3, panel2, panel4]` | `[panel4]` | `[panel4]` | `[panel4]` | `[]`
|
| **4** | `[panel1, panel3]` | `[panel1, panel3]` | `[panel2, panel3]` |
`[panel3, panel2, panel4]` | `[panel4]` | `[panel4]` | `[panel4]` | `[]`
|
| **5** | `[panel1]` | `[panel1]` | `[panel2]` | `[panel2]` | `[]` |
`[]` | `[]` | `[]` |

Continuing this behaviour, we push panel 2, panel 1, and panel 3 down in
row 3; then again in row 4. Once we reach and resolve row 5 (i.e. get
row 5 to the point where there are no collisions with panel 3), our
layout looks like so:


![image](https://github.com/user-attachments/assets/e59de766-a547-499a-a181-7841179032c0)
   
|   | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |

|--------|--------|--------|--------|--------|--------|--------|--------|--------|
| **0** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **1** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **2** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **3** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **4** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **5** | `[panel3]` | `[panel3]` | `[panel3]` | `[panel3]` | `[]` |
`[]` | `[]` | `[]` |
| **6** | `[panel3, panel1]` | `[panel3, panel1]` | `[panel2, panel3]` |
`[panel2, panel3]` | `[]` | `[]` | `[]` | `[]` |
| **7** | `[panel1]` | `[panel1]` | `[panel2]` | `[panel2]` | `[]` |
`[]` | `[]` | `[]` |
| **8** | `[panel1]` | `[panel1]` | `[panel2]` | `[panel2]` | `[]` |
`[]` | `[]` | `[]` |

At this point, all collisions on panel 4 have been resolved. So, in row
6, we see that panels 2 and 1 are now colliding with panel 3 - so, we
push both of them down. At that point, row 6 does not have collisions so
we **don't** push panel 3 down any further - and our layout is resolved!
    

![image](https://github.com/user-attachments/assets/71869176-473f-4a48-8d0f-863b855628c4)

|   | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |

|--------|--------|--------|--------|--------|--------|--------|--------|--------|
| **0** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **1** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **2** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **3** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **4** | `[]` | `[]` | `[]` | `[panel4]` | `[panel4]` | `[panel4]` |
`[panel4]` | `[]` |
| **5** | `[panel3]` | `[panel3]` | `[panel3]` | `[panel3]` | `[]` |
`[]` | `[]` | `[]` |
| **6** | `[panel3]` | `[panel3]` | `[panel3]` | `[panel3]` | `[]` |
`[]` | `[]` | `[]` |
| **7** | `[panel1]` | `[panel1]` | `[panel2]` | `[panel2]` | `[]` |
`[]` | `[]` | `[]` |
| **8** | `[panel1]` | `[panel1]` | `[panel2]` | `[panel2]` | `[]` |
`[]` | `[]` | `[]` |
| **9** | `[panel1]` | `[panel1]` | `[panel2]` | `[panel2]` | `[]` |
`[]` | `[]` | `[]` |

</details>

</details>


### 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] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

There are no risks to this PR, since all work is contained in the
`examples` plugin.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-02 16:04:20 -07:00