Commit graph

498 commits

Author SHA1 Message Date
Drew Tate
9b4403b7dc
[ES|QL] remove worker (#218006)
## Summary

Fix https://github.com/elastic/kibana/issues/217923

Investigations in https://github.com/elastic/kibana/issues/217368 showed
that there was basically no performance impact to passing the AST across
a thread boundary. But we also didn't detect a pressing reason to remove
the worker.

Since then, however, we noticed another cost associated with the worker:
it's a hefty Javascript file, even in production builds. In addition, we
are doing parsing on the main thread _and_ the worker, so the
`kbn-esql-ast` package is actually being loaded and parsed twice by the
browser, once for the main thread and once for the worker.

This PR removes our worker. Our parsing associated with validation and
autocomplete will still be done asynchronously, but on the main thread.

I do not see any regression in perceived performance.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2025-04-15 10:18:07 -06:00
Anton Dosov
23fe329228
[TableListView] Remove listing limit warning (#217945)
## Summary

Temporary solution for
https://github.com/elastic/kibana/issues/207135#issuecomment-2789752279


![image](https://github.com/user-attachments/assets/061282ba-aabc-46f2-a859-d57deb000c73)

> [!NOTE]  
> All items are still findable by query or tags 

Per Graham, 

> I would love to not need to display a warning but even with today's
implementation I would remove it as its benefits don't outweigh its
drawbacks IMO

We also plan to work on server-side pagination soon
2025-04-15 13:42:23 +02:00
Marco Vettorello
a9c9354382
[Charts] Use chartTheme hook everywhere (#217370)
## Summary

This PR fixes the existing usage of the chart themes by using the
provided `useElasticChartsTheme` hook that is color mode aware and theme
adaptive (borealis/amsterdam)

Some charts where using just the Light theme version or the legacy (aka
amsterdam theme), and I've applied the hook to pick up the correct
theme.

TO REVIEWERS: Please pull down the PR and check if the actual changed
charts looks correct with the new theme configuration.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
2025-04-14 18:09:15 +02:00
Vadim Kibana
86fdbe5379
[ES|QL] Source AST node parsing improvements and source selector parsing (#217299)
## Summary

- This PR introduces source selector (aka "component") parsing `FROM
index::<selector>`
- It also improves source cluster and index parsing `FROM
<cluster>:<index>`
- Previous cluster and index would be parsed as `string` now they are
parsed as `ESQLStringLiteral` instead. This is more correct as any of
those can take three forms, and `ESQLStringLiteral` handles all three
forms:
    1. unquoted string: `cluster:index`
    2. single-double quoted string: `"cluster":"index"`
    3. triple-double quote string: `"""cluster""":"""index""`
- The `ESQLStringLiteral` now also supports *"unquoted strings"* in
addition to single `"str"` and triple `"""str"""` quoted strings.


### 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-04-07 16:11:10 +02:00
Mike Côté
93174d3887
Change reporting CODEOWNERS to response ops (#213560)
In this PR, I'm changing the CODEOWNERS for reporting related modules.
While reviewing, ensure I haven't missed anything or moved a module that
should remain part of sharedux team.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>
2025-04-04 23:27:42 +02:00
Nathan Reese
5a3c2c0f05
[embeddable] fix race condition in useStateFromPublishingSubject (#216522)
Related to https://github.com/elastic/kibana/pull/216399

PR
* updates `useStateFromPublishingSubject` to require `subject`, thus,
removing complexities of setting up subscription when `subject` is
optionally provided.
* Updates `useStateFromPublishingSubject` to setup subscription with
`useMemo` to avoid timing issues.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-04-03 09:35:59 -06:00
Marta Bondyra
f5b185a28f
[kbn-grid-layout][dashboard] Basic keyboard interaction (#208286)
## Summary
Adds keyboard navigation for drag-and-drop interactions
Fixes https://github.com/elastic/kibana/issues/211925
Fixes https://github.com/elastic/kibana/issues/190448

### Supported features 
1. Resize panels


https://github.com/user-attachments/assets/ba7add16-a0c6-4f15-9f3b-0f8ef7caf8ac

2. Drag panels within the same section (dragging between sections is
pending)


https://github.com/user-attachments/assets/a1fd80af-63ca-4fa2-bded-3db9968a8366

3. Move rows up/down


https://github.com/user-attachments/assets/8d7e8d7d-b1bf-4abe-9cc2-28eeea9b43f8

### Interaction Flow

1. Start interaction with `Space` or `Enter`
2. Move using arrow keys
3. Finish by confirming (`Enter`/`Space`) or canceling (`Escape`)
(blurring also confirms the changes)

### Scrolling Behavior:
* Default browser scrolling is disabled in interaction mode to avoid
unexpected behavior and edge cases that would overcomplicate this simple
implementation.
* Scrolling occurs when the user reaches the edge of the screen while
resizing or dragging, allowing them to continue the interaction
smoothly.
* When the operation is confirmed, we also scroll to the element to make
sure it's in view.

### Missing (planned for another PR):
* A11y announcements 
* Dragging between sections
* This feature is not well unit-tested, but it's very difficult to do it
without mocking the crucial pieces of functionality. I'd vote to leave
it for now and add a few functional tests once we decide a strategy for
it, since drag and drop interactions are anyway quite difficult to
unit-test reliably anyway.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-01 11:29:02 +02:00
Davis McPhee
bf7de0e6b9
[Discover] Support state updates across tabs (#215620)
## Summary

This PR adjusts the approach introduced in #214861 to ensure state
updates work consistently across tabs, even after switching tabs during
async operations. The `currentTabId` prop has been removed from the
central state since it can't be relied on in actions, and instead tab
IDs are injected using a `CurrentTabProvider`. This allows selectors to
work the same as they did before, and tab specific actions have been
updated to use a standard `TabAction` interface that accepts a tab ID
and prevents leaking state changes.

This approach is safer but adds some complexity, so for actions
dispatched from React components, a `useCurrentTabAction` hook has been
added to handle injecting the current tab ID. We also still need to
access tab state within `DiscoverStateContainer` for now, so two utility
methods (`injectCurrentTab` and `getCurrentTab`) have been added to make
this easier. Since `DiscoverStateContainer` is scoped to a single tab,
this should be safe, and ideally temporary until we get rid of it
completely.

Resolves #215398.

### Checklist

- [ ] 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
- [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
- [ ] 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
- [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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-31 15:41:59 -03:00
Davis McPhee
0bb73eec2c
[Discover] Initial tabs implementation (disabled in main) (#214861)
## Summary

This PR restructures Discover's state management to support tabs as
outlined in #215398, including the Redux store and
`RuntimeStateManager`. It also adds the initial tabs implementation to
the UI to start building on, but they're disabled by default with a
hardcoded flag. Tabs can be enabled by setting `TABS_ENABLED = true` in
`discover_main_route`, but they don't need to be thoroughly tested in
this PR since most of the functionality is incomplete.

There's also a flaw in the state management approach with `currentId`
since depending on it can cause state to leak across tabs when switching
tabs during async operations (e.g. data fetching). This shouldn't be an
issue while tabs are disabled, and there will be a followup PR #215620
to address it.


https://github.com/user-attachments/assets/ebbb9fa7-a3bc-4e82-9b5c-0d29cd0575f0

Part of #215398.

### Checklist

- [ ] 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)
- [ ] 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)
2025-03-28 15:38:53 -03:00
Lene Gadewoll
2cd777d969
Upgrade EUI to v101.0.1 (#215698)
`100.0.0`  `101.0.1`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Package updates

### `@elastic/eui`
[`v101.0.1`](https://github.com/elastic/eui/releases/v101.0.1)

- Updated `EuiProvider` and `EuiThemeProvider` with a new
`highContrastMode` ([#8444](https://github.com/elastic/eui/pull/8444))
- This prop allows toggling a higher contrast visual style that
primarily affects borders and shadows
- On `EuiProvider`, if the `highContrastMode` prop is not passed, this
setting will inherit from the user's OS/system settings
- If the user is using a forced colors mode (e.g. Windows' high contrast
themes), this system setting will take precedence over any
`highContrastMode` or `colorMode` props passed
- Added `highContrastModeStyles` and `preventForcedColors` styling utils
([#8444](https://github.com/elastic/eui/pull/8444))
- Updated `EuiRangeTooltip` to be easier to see in dark mode
([#8444](https://github.com/elastic/eui/pull/8444))
- Updated some deprecated color token usages that have direct
substitutes ([#8444](https://github.com/elastic/eui/pull/8444))
  - `text` -> `textParagraph`
  - `title` -> `textHeading`
  - `subduedText` -> `textSubdued`
  - `disabledText` -> `textDisabled`
  - `accentText` -> `textAccent`
  - `dangerText` -> `textDanger`
  - `warningText` -> `textWarning`
- `useEuiShadow()` now accepts a second `options` argument
([#8234](https://github.com/elastic/eui/pull/8234))
- `useEuiShadowFlat()` now accepts an `options` object instead of only a
color ([#8234](https://github.com/elastic/eui/pull/8234))
- Updated `EuiPopover` and `EuiToolTip` to be easier to see in dark
mode. ([#8174](https://github.com/elastic/eui/pull/8174))

**Bug fixes**

- Fixed a visual bug where a transparent border would create visible
empty space (`LIGHT` mode only) for the components:
([#8427](https://github.com/elastic/eui/pull/8427))
  - `EuiPanel`
  - `EuiPopover`
  - `EuiToolTip`
  - `EuiToast`
  - `EuiTour`
  
  --- 
  
### `@elastic/eui-theme-common`
[`v0.1.0`](https://github.com/elastic/eui/releases/v0.1.0)

- Removed type `EuiShadowCustomColor`
([#8444](https://github.com/elastic/eui/pull/8444))
- Added types:  ([#8444](https://github.com/elastic/eui/pull/8444))
  - `EuiShadowOptions`
  - `EuiThemeHighContrastModeProp`
  - `EuiThemeHighContrastMode`
- Updated shadow utils to accepts a second `options` argument and return
borders in high contrast mode:
([#8444](https://github.com/elastic/eui/pull/8444))
  - `euiShadow`
  - `euiShadowXSmall`
  - `euiShadowSmall`
  - `euiShadowMedium`
  - `euiShadowLarge`
  - `euiSlightShadowHover`
  - `euiShadowFlat`
  
  ---
  
### `@elastic/eui-theme-borealis`
[`v0.1.0`](https://github.com/elastic/eui/releases/v0.1.0)

- Added new component level tokens:
([#8444](https://github.com/elastic/eui/pull/8444))
  - `buttonGroupBackgroundDisabledSelected`
  - `overlayMaskBackground`
  - `overlayMaskBackgroundHighContrast`
  - `skeletonBackgroundSkeletonMiddleHighContrast`
  

## Additional changes

The latest `@elastic/eui` package introduces high contrast mode support.
This PR sets all usages of `EuiProvider` to use
`highContrastMode={false}` to introduce it in disabled state (this
reflects the current functionality in Kibana). This is because the UI
for the high contrast mode functionality (and style adjustments) need to
first be implemented on Kibana side (by shared-ux).

## QA

Adding high contrast mode in disabled state should result in no visual
changes in Kibana. Please ensure your product view remain unchanged.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-28 19:29:23 +01:00
Elena Shostak
7a41906d88
[Authz] Mandatory Security Config (#215180)
## Summary

This PR makes `security` a required field for route registration. To
incorporate the new required filed, changes has been made:

1. **Test file updates**. A lot of the updates made in this PR were made
in tests.
2. **Versioned route security configuration**. For the versioned route
`security` config has been lifted up to the top-level definition:

    Before
    ```ts
    router.versioned
      .get({
        path: '/api/path',
        options: { ... },
        ...
      }, handler)
      .addVersion({
         version: 1,
         validate: false,
         security: {
          authz: {
            requiredPrivileges: ['privilege'],
          },
         },
      });
    ```
    
    After
    ```ts
    router.versioned
      .get({
        path: '/api/path',
        options: { ... },
         security: {
          authz: {
            requiredPrivileges: ['privilege'],
          },
         },
        ...
      }, handler)
      .addVersion({
         version: 1,
         validate: false,
      });
    ```

3. **Type adjustments for route wrappers**. Type changes has been made
in:
-
`x-pack/solutions/observability/plugins/infra/server/lib/adapters/framework/adapter_types.ts`
-
`x-pack/solutions/observability/plugins/metrics_data_access/server/lib/adapters/framework/adapter_types.ts`
-
`x-pack/solutions/observability/plugins/synthetics/server/routes/types.ts`
-
`x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/types.ts`

Security was made an optional field for the wrappers defined in those
files, since the default security is provided in the wrapper itself and
then passed down to the core router.

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


__Closes: https://github.com/elastic/kibana/issues/215331__

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-27 12:04:53 -07:00
Ania Kowalska
748d54ba91
[Discover Session][Tabs] Tab preview (#214090)
- Closes https://github.com/elastic/kibana/issues/214554

## Summary

This PR:
- adds TabPreview component, which is visible when you hover over a
particular tab
- adds tests for TabPreview component

About TabPreview component
- EUI doesn't have a component, which would suit for our needs, hence a
custom component activated on hover
- TabPreview should activate (with 500ms of delay) after hovering over a
whole tab
- It should hide when we click action button in the tab or we open
editing name mode
- It shouldn't appear on hover when we have tab context menu open or
we're editing a title
- For now the data inside is mocked (besides of title), so you can see
random queries and statuses each time you hover over the tab
- Preview should not overflow the screen if there are a lot of tabs and
they're "touching" right side of the screen


https://github.com/user-attachments/assets/da0a47dd-b594-4c20-b76c-49e6889f3814



## Testing

Two options are possible:

1. start Storybook with `yarn storybook unified_tabs` and navigate to
`http://localhost:9001`.
2. start Kibana with `yarn start --run-examples`. Then navigate to the
Unified Tabs example plugin
`http://localhost:5601/app/unifiedTabsExamples`.

### 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: Julia Rechkunova <julia.rechkunova@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-20 14:10:56 +02:00
Hannah Mudge
05db9e9597
[kbn-grid-layout] Allow rows to be reordered (#213166)
Closes https://github.com/elastic/kibana/issues/190381

## Summary

This PR adds the ability to drag and drop rows by their headers in order
to reorder them:

![Mar-12-2025
16-07-04](https://github.com/user-attachments/assets/de6afb8e-f009-4c00-b1dc-4804769e54eb)

It can be a bit confusing dragging section headers around when other
sections are expanded - it is easy to lose track of them, especially
when the expanded sections are very large. I experimented with
auto-collapsing all sections on drag, but this felt extremely
disorienting because you instantly lost all of your context - so, to
improve the UI here, I added a "scroll to" effect on drop like so:



https://github.com/user-attachments/assets/0b519783-a4f5-4590-9a1c-580df66a2f66

Reminder that, to test this feature, you need to run Kibana with
examples via `yarn start --run-examples` and navigate to the grid
examples app via `Analytics > Developer examples > Grid Example`.

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

Collapsible sections are not available on Dashboard yet and so there is
no user-facing risk to this PR.
2025-03-19 11:12:35 -06:00
Julia Rechkunova
328ce08494
[Discover Tabs] Visually connect the active tab with the top nav (#214440)
- Closes https://github.com/elastic/kibana/issues/210864

## Summary

This PR changes tabs styles and visually connects the selected tab with
the Kibana header.

Classic view:

<img width="1439" alt="Screenshot 2025-03-17 at 13 26 16"
src="https://github.com/user-attachments/assets/31dc0311-7bc1-4bc8-9b83-48f40227705f"
/>
<img width="1435" alt="Screenshot 2025-03-17 at 13 26 52"
src="https://github.com/user-attachments/assets/301963fb-3207-49ae-ab70-177834f3a73f"
/>


Project view:

<img width="1438" alt="Screenshot 2025-03-17 at 13 25 34"
src="https://github.com/user-attachments/assets/df1d1bff-82f8-4eed-9cf3-b3e557f5658c"
/>
<img width="1437" alt="Screenshot 2025-03-17 at 13 24 58"
src="https://github.com/user-attachments/assets/dfe27fc7-1cfe-4695-b1fd-2e306adc8787"
/>

### Testing

Two options are possible:

1. start Storybook with `yarn storybook unified_tabs` and navigate to
`http://localhost:9001`.
2. start Kibana with `yarn start --run-examples`. Then navigate to the
Unified Tabs example plugin
`http://localhost:5601/app/unifiedTabsExamples`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-19 13:33:51 +02:00
Julia Rechkunova
d764bd91f5
[Discover Tabs] Don't allow to duplicate a tab when tabs limit is reached (#214772)
## Summary

This PR is a follow up for https://github.com/elastic/kibana/pull/213106
to hide Duplicate menu item when the max tabs limit is already reached.

## Testing

Two options are possible:

1. start Storybook with `yarn storybook unified_tabs` and navigate to
`http://localhost:9001`.
2. start Kibana with `yarn start --run-examples`. Then navigate to the
Unified Tabs example plugin
`http://localhost:5601/app/unifiedTabsExamples`.


### 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-03-19 10:25:58 +01:00
Julia Rechkunova
535a853133
[Discover Tabs] Responsive tab size and scroll actions (#213739)
- Closes https://github.com/elastic/kibana/issues/210514

## Summary

This PR:
- updates style of tab name overflow
- automatically recalculates what the max tab size can be used
- if tabs don't fit the available width, arrow buttons will appear to
help with scrolling left and right
- adds max tab limit and hides "+" button if it's reached
- introduces `unifiedTabs` page object for creating functional tests

![Mar-07-2025
17-47-12](https://github.com/user-attachments/assets/f1547086-1c8e-4e47-9d2e-35954403ec24)

## Testing

Two options are possible:

1. start Storybook with `yarn storybook unified_tabs` and navigate to
`http://localhost:9001`.
2. start Kibana with `yarn start --run-examples`. Then navigate to the
Unified Tabs example plugin
`http://localhost:5601/app/unifiedTabsExamples`.

### Checklist

- [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/src/platform/packages/shared/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
2025-03-13 12:42:13 +00:00
Alejandro Fernández Haro
bdf7823c54
[SSE] Fix EventSource streams (#213151)
## Summary

Resolves #212919

We noticed that setting the header `'Content-Type':
'text/event-stream',` didn't work as the browser's native EventSource
implementation.

```JS
      return res.ok({
        headers: {
          'Content-Type': 'text/event-stream',
          'Cache-Control': 'no-cache',
        },
        body: observableIntoEventSourceStream(events$ as unknown as Observable<ServerSentEvent>, {
          signal: abortController.signal,
          logger,
        }),
      });
```

The reason, apparently, is that we need to flush the compressor's buffer
negotiated in the HTTP request.

### How to test it:

Run Kibana with examples `yarn start --no-base-path --run-examples
--http2` and open the SSE example app in Kibana. You should see a clock
updating every second in the UI (the clock is coming from the server).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-11 11:33:11 +01:00
Davis McPhee
ccae358d37
[Discover] Replace DiscoverInternalStateContainer with Redux based InternalStateStore (#208784)
## Summary

This PR replaces Discover's current `DiscoverInternalStateContainer`
(based on Kibana's custom `ReduxLikeStateContainer`) with an actual
Redux store using Redux Toolkit. It's the first step toward migrating
all of Discover's state management to Redux as part of the Discover tabs
project.

Part of #210160.
Resolves #213304.

### Checklist

- [ ] 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
- [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
- [ ] 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
- [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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-06 17:08:58 -04:00
Hannah Mudge
b32f0fe1e8
[kbn-grid-layout] Store rows in object instead of array (#212965)
Closes https://github.com/elastic/kibana/issues/211930

## Summary

This PR makes it so that `kbn-grid-layout` stores its rows as an object
/ dictionary (`{ [key: string]: GridRowData }`) rather than an array
(`Array<GridRowData>`). This is a prerequisite for
https://github.com/elastic/kibana/issues/190381 , since it allows us to
re-order rows without re-rendering their contents. It also means that
deleting a row will no longer cause the rows below it to re-render,
since re-rendering is now dependant on the row's **ID** rather than the
row's order.

**Before**


https://github.com/user-attachments/assets/83651b24-a32c-4953-8ad5-c0eced163eb5


**After**


https://github.com/user-attachments/assets/9cef6dbc-3d62-46aa-bc40-ab24fc4e5556


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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-04 13:34:39 -07:00
Nathan Reese
b213eb6bb2
[embeddable] replace Embeddable ViewMode with presentation-publishing ViewMode (#211960)
Embeddable ViewMode is part of legacy embeddable architecture. This PR
removes Embeddable ViewMode and replaces its usage with
presentation-publishing ViewMode. presentation-publishing ViewMode is a
string literal type so an enum is no longer needed.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-04 09:05:23 -07:00
Stratoula Kalafateli
f6978eaf7b
[ES|QL] Makes the clear control button optional (#212848)
## Summary

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

Here we are removing the clear button from the ES|QL control as clearing
will result in wrong charts. I also considered the reset but when there
is no changes should be hidden or disabled. This seems to me as a
smaller change and taken under consideration that dashboard already
allows resetting I think it is ok to remove it.

We can always reconsider if any user complains.

Although by removing the clearSelections from the control config removes
the button the `DefaultControlApi ` was marking it as required. So I had
to tweak a bit the types.
2025-03-03 19:03:57 +01:00
Nick Peihl
2a7e38b0fc
[Dashboard] Remove mSearch from content management (#210709)
## Summary

Removes the mSearch method from Dashboard content management.

The `mSearch` content management method was designed to be a temporary
implementation of search that allowed searching multiple saved object
types ([see more
[internal]](https://docs.google.com/document/d/1ssYmqSEUPrsuCR4iz8DohkEWekoYrm2yL4QR_fVxXLg/edit?tab=t.0#heading=h.6sj4n6bjcgp5)).
However, the mSearch implementation in the Dashboard Storage class lacks
extensibility as it requires a synchronous `toItemResult` function. As
we start migrating reference handling to the server, we will likely need
transforms that return Promises (ex. `savedObjectToItem`), such as
[retrieving tag saved objects from the SavedObjectTagging
client](https://github.com/elastic/kibana/issues/210619).

The Dashboard `mSearch` method was only used by the dashboard_picker and
this PR replaces its usage with the `search` method.

### Identify risks

There is a slight risk in serverless environments where a browser may
have already loaded the dashboard_picker module but lags behind the
server. In this case, the dashboard picker may fail to retrieve a list
of dashboards due to it calling the now non-existent `mSearch` method
provided by the server. In this case, the user simply needs to refresh
their browser to retrieve the latest UI modules.
2025-03-03 11:31:09 -05:00
Nathan Reese
8784e4d68d
[controls] add example for programmatically interacting with controls (#212665)
Update search control example with buttons to programmatically interact
with controls

<img width="800" alt="Screenshot 2025-02-27 at 8 41 05 AM"
src="https://github.com/user-attachments/assets/e936cdeb-ce51-4fca-a8bc-ec5d983e3155"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-28 17:16:07 -07:00
Alejandro Fernández Haro
52ab19db2d
Upgrade ES client to 9.0.0-alpha.3 (#208776)
## Summary

Updating the ES client to 9.0. 

Resolves #116102

## What changes?

**Breaking change**: `body` has been removed.

Most of the changes are about bringing all the content inside the body
as a root attribute to the API params:

```diff
const response = await client.search({
  index: 'test',
-  body: {
    query: {
      match_all: {}
    }
-  }
})
```

For this reason, enabling the "Hide whitespace changes" option when
reviewing is recommended.

Some exceptions to this rule:

* Bulk APIs replace the `body` array with `operations` array (direct
replacement)
* Index Put Settings API replace `body` array with `settings` (direct
replacement)
* Msearch replaces the `body` array with `searches` array (direct
replacement)
* Document Index API replaces `body` with `document` (direct
replacement)
* Create Repository replaces `body` with `repository` (direct
replacement)

Because of a known issue in the client
(https://github.com/elastic/elasticsearch-js/issues/2584), there's still
an escape hatch to send data in the body in case the specific use case
requires it via `// @ts-expect-error elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584`, but it
shouldn't be abused because we lose types. In this PR we've used it in
those scenarios where we reuse the response of a GET as the body of a
PUT/POST.

### Other changes

* `estypes` can be imported from the root of the library as `import type
{ estypes } from '@elastic/elasticsearch';`
* `estypesWithBody` have been removed
* `requestTimeout`'s 30s default has been removed in the client. This PR
explicitly adds the setting in all client usages.


### Identify risks

- [x] The client places unknown properties as querystring, risking body
params leaking there, and causing 400 errors from ES => Solved by
forcing `body` usage there via `// @ts-expect-error elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584`. The next
version of the client will address this.
- [x] We need to run the MKI tests to make sure that we're not breaking
anything there =>
https://elastic.slack.com/archives/C04HT4P1YS3/p1739528112482629?thread_ts=1739480136.231439&cid=C04HT4P1YS3

---------

Co-authored-by: Gloria Hornero <gloria.hornero@elastic.co>
2025-02-25 14:37:23 +00:00
Hannah Mudge
e587187ffc
[kbn-grid-layout] Add ability to create, edit, and delete rows (#209193)
Closes https://github.com/elastic/kibana/issues/204849

## Summary

This PR adds the ability to create, edit, and delete sections / rows to
`kbn-grid-layout`:



https://github.com/user-attachments/assets/4831b289-2c71-42fb-851d-0925560e233a



Note that sections are still statically placed - dragging rows around
will be added in a follow-up PR, because it's a larger undertaking.
Since this feature is not available to users yet, it is okay to
implement this in stages like this.

### Checklist

- [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/src/platform/packages/shared/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

Collapsible sections are not available on Dashboard yet and so there is
no user-facing risk to this PR.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
2025-02-24 18:29:00 +00:00
Julia Rechkunova
705df212b8
[Discover][Tabs] New tabs package and initial implementation of components (#210674)
- Closes https://github.com/elastic/kibana/issues/210500
- Closes https://github.com/elastic/kibana/issues/210502

## Summary

This PR introduces a new package `@kbn/unified-tabs` which includes an
initial implementation for tabs UI/UX which we are planning to add to
Discover.

- [x] New package
- [x] Storybook support 
- [x] Initial styles and interactions
- [x] New example plugin for testing together with UnifiedSearch bar 
- [x] Minimal tests

### In the new Storybook

Start Storybook with `NODE_OPTIONS="--openssl-legacy-provider" node
scripts/storybook unified_tabs` and navigate to `http://localhost:9001`.

<img width="1024" alt="Screenshot 2025-02-12 at 13 35 46"
src="https://github.com/user-attachments/assets/0723b0c4-c3f7-44f8-af8d-f68d7a7b6ea8"
/>

### In the new Unified Tabs example plugin

Start Kibana with `yarn start --run-examples`. Then navigate to the
Unified Tabs example plugin
`http://localhost:5601/app/unifiedTabsExamples`.

<img width="1221" alt="Screenshot 2025-02-12 at 16 11 55"
src="https://github.com/user-attachments/assets/2edff817-0aae-424c-978c-c4c67450c9eb"
/>
<img width="1219" alt="Screenshot 2025-02-12 at 16 13 57"
src="https://github.com/user-attachments/assets/2e6e6b0b-88e9-4689-a175-9612e8507535"
/>

![Feb-12-2025
16-13-17](https://github.com/user-attachments/assets/a1d511da-d554-432c-bea9-cbe8349f9772)


### Checklist

- [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/src/platform/packages/shared/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)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
2025-02-21 14:00:40 +01:00
Tiago Costa
203bc28478
chore(NA): upgrade to webpack 5 (#191106)
### Summary

- Closes #89741

This PR contains the resulting work of a massive effort that ports our
on top bundler abstraction (called @kbn/optimizer) from Webpack v4 into
Webpack v5. It's essential in terms of long term maintenance since v4
was not receiving updates any longer but will also unblock some new
features that could be beneficial for our future DevEx endeavours.

Next you can find a small list of all the accomplished tasks on this
journey.

### Completed Tasks
- [x] Upgrade dependencies to match the ones on webpack v5
- [x] Fix null-loader usages
- [x] Fix raw-loader usages
- [x] Fix file-loader usages
- [x] Fix url-loader usages
- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 
- [x] Adopt previous webpack v4 polyfill-all strategy with
node-polyfill-webpack-plugin
- [x] Fix theme-loader on @kbn/optimizer
- [x] Migrate configurations and ad-hoc loader options on all webpack
configs from v4 to v5
- [x] Fix @kbn/test jest resolver for file-loader cases
- [x] Migrate public-path loader on UiSharedDeps
- [x] Fix all usages of webpack-merge
- [x] Migrate BundleRemoteModule
- [x] Migrate BundleRemotesPlugin
- [x] Correctly migrate PopulateBundleCachePlugin
- [x] Correctly migrate BundleMetricsPlugin
- [x] Check if the profiling plugins still work (--profile flag)
- [x] Recover if possible the previous webpack v4 cacheGroup chunks
rename to something like `data.plugin.chunk.0.js`
- [x] Run `/ci` and make sure we get our first green CI, otherwise work
on the errors until we do
- [x] Profile and solve bottlenecks until we get a cold build
performance similar to the one we had on webpack v4 (`node
scripts/build_kibana_platform_plugins --no-cache`).
- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider
` flags
- [x] Add Webpack to Renovate config
- [x] Explore removing `NodePolyfillPlugin`
([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and
add each polyfill needed individually per each webpack config to check
if we get smaller bundles. If we do it's better to go with the case by
case need approach instead of deploying a bunch of polyfills with
NodePolyfillPlugin. As another alternative, create a custom smaller
plugin with only the union of all needed polyfills.
- [x] Evaluate if we want to touch the resolutions on mainFields and
conditionNames
- [x] Understand why `@import 'src/core/public/mixins'` does not work
anymore (not a problem, we should use relative paths anyway but we want
to track why it changed from v4 to v5)
- [x] BUG: Child compilers are having errors hidden and/or changed from
error to warning
- [x] Fix license check for
[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the
license for
[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).
This package is a dependency of
[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).
Artistic 2.0 license is [classified as
yellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)
and should only be used for dev dependencies.
- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on
other webpack configs like storybook one
- [x] Find what is being wrongly removed by usedExports optimization;
hint: I believe it is identifying a lot of exports inside the sync entry
of plugins as unused exports and removing them. Then `__kbnBootstrap__`
can't be found
- [x] Rebalance @kbn/optimizer pickMaxWorkerCount
- [x] Re-open the issue to fix sass-warnings
[#190345](https://github.com/elastic/kibana/issues/190345) or downgrade
sass-loader to v10
- [x] Remove previous esm no parse rules
- [x] Confirm esm support is working
- [x] Confirm console override is needed
- [x] Confirm react prod builds on ui shared deps for distributable
- [x] Remove customization for
[xyflow](https://github.com/xyflow/xyflow) from webpack configs
- [x] Clean all the code
- [x] Make sure collected metrics from stats are still aligned with what
we were collecting before; also verify if the modules used for optimizer
caches etc are well generated (@kbn/node-libs-browser)
- [x] Fix watch performance

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Brad White <brad.white@elastic.co>
2025-02-14 03:01:36 +00:00
Hannah Mudge
200922a512
[kbn-grid-layout] Add useCustomDragHandle prop (#210463)
This PR **might** resolve
https://github.com/elastic/kibana/issues/207011 but we will need time
for the telemetry metrics to settle before we know for sure.

## Summary

This PR removes the conditional rendering of the default drag handle in
`kbn-grid-layout`, which has two benefits:

1. It removes the double render of `GridPanel` that was caused by
relying on the `dragHandleCount` to be updated in order to determine
whether the default drag handle should be rendered
2. The default drag handle no longer "flashes" when Dashboards are
loading and waiting for `dragHandleCount` to update
  
   - **Before:**
   

https://github.com/user-attachments/assets/30a032fc-4df3-42ce-9494-dd7f69637c03
      
   - **After:**
   

https://github.com/user-attachments/assets/db447911-cbe2-40dd-9a07-405d1e35a75d


Instead, the consumer of `kbn-grid-layout` is responsible for setting
the `useCustomDragHandle` prop to `true` when they want to use a drag
handle other than the default one.


When adding the `useCustomDragHandle` prop, I got annoyed that I had to
pass this prop all the way down to `grid_panel` - so I decided to swap
to using React context in this PR, as well. The API for the grid layout
component will most likely continue to grow, so this should make it
easier to manage the props.

### 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)
2025-02-13 15:18:00 -07:00
Elena Shostak
ad0e1d9d9d
[Authz] Migrated routes with access tags to security config (#209756)
## Summary

This PR migrates the last routes with `access:<privilege>` tags used in
route definitions to new security configuration.
Please refer to the documentation for more information: [Authorization
API](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization)

### **Before Migration:**
Access control tags were defined in the `options` object of the route:

```ts
router.get({
  path: '/api/path',
  options: {
    tags: ['access:<privilege_1>', 'access:<privilege_2>'],
  },
  ...
}, handler);
```

### **After Migration:**
Tags have been replaced with the more robust
`security.authz.requiredPrivileges` field under `security`:

```ts
router.get({
  path: '/api/path',
  security: {
    authz: {
      requiredPrivileges: ['<privilege_1>', '<privilege_2>'],
    },
  },
  ...
}, handler);
```

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-11 21:36:38 +07:00
Nathan Reese
0ba9c66a4e
[dashboard][canvas] Replace VisTypes and VisTypeAliases in Add Panel Menu (#209022)
Closes https://github.com/elastic/kibana/issues/180057

The following items needed to be replaced with add panel actions
* vega - visType
* markdown - visType
* lens - visTypeAlias
* maps - visTypeAlias

As an added benefit, now these actions are displayed in embeddable
examples that uses ADD_PANEL_TRIGGER

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-10 15:33:24 -07:00
Davis McPhee
b53d3990a2
[Saved Queries] Rework saved query privileges (#202863)
## Summary

This PR reworks saved query privileges to rely solely on a single global
`savedQueryManagement` privilege, and eliminates app-specific overrides.
This change simplifies the security model for users, fixes bugginess in
the saved query management UI, and reduces code complexity associated
with maintaining two separate security mechanisms (app-specific
overrides and global saved query management privileges).

### Background

Saved queries allow users to store a combination of KQL or Lucene
queries, filters, and time filters to use across various applications in
Kibana. Access to saved query saved objects are currently granted by the
following feature privileges:
```json
[
  "feature_discover.all",
  "feature_dashboard.all",
  "feature_savedQueryManagement.all",
  "feature_maps.all",
  "feature_savedObjectsManagement.all",
  "feature_visualize.all"
]
```

There is also a saved query management UI within the Unified Search bar
shared by applications across Kibana:
<img
src="https://github.com/user-attachments/assets/e4a7539b-3dd4-4d47-9ff8-205281ef50e3"
width="500" />

The way access to this UI is managed in Kibana is currently confusing
and buggy:
- If a user has `feature_discover.all` and `feature_dashboard.all` they
will be able to load and save queries in Discover and Dashboard.
- If a user has `feature_discover.all` and `feature_dashboard.read` they
will be able to load queries in both Discover and Dashboard, but only
save queries in Discover (even though they have write access to the SO,
and API access). Instead they have to navigate to Discover to save a
query before navigating back to Dashboard to load it, making for a
confusing and frustrating UX.
- Access to the UI is even more confusing in apps not listed in the
above feature privileges (e.g. alerting, SLOs). Some of them chose to
check one of the above feature privileges, meaning users who otherwise
should have saved query access won't see the management UI if they don't
also have the exact feature privilege being checked. Other apps just
always show the management UI, leading to bugs and failures when users
without one of the above feature privileges attempt to save queries.

### Existing improvements

In v8.11.0, we introduced a new ["Saved Query
Management"](https://github.com/elastic/kibana/pull/166937) privilege,
allowing users to access saved queries across all of Kibana with a
single global privilege:
<img
src="https://github.com/user-attachments/assets/ccbe79a4-bd0b-4ed6-89c9-117cc1f99ee2"
width="600" />


When this privilege is added to a role, it solves the
`feature_discover.all` and `feature_dashboard.read` issue mentioned
above. However, it does not fix any of the mentioned issues for roles
without the new privilege. We have so far postponed further improvements
to avoid a breaking change.

### Approach

To fully resolve these issues and migrate to a single global privilege,
these changes have been made:
- Remove saved query SO access from all application feature privileges
and instead only allow access through the global saved query management
privilege.
- Stop relying on application feature privileges for toggling the saved
query management UI, and instead rely on the global privilege.

To implement this with minimal breaking changes, we've used the Kibana
privilege migration framework. This allows us to seamlessly migrate
existing roles containing feature privileges that currently provide
access to saved queries, ensuring they are assigned the global saved
query management privilege on upgrade.

As a result, we had to deprecate the following feature privileges,
replacing them with V2 privileges without saved query SO access:
```json
[
  "feature_discover.all",
  "feature_dashboard.all",
  "feature_maps.all",
  "feature_visualize.all"
]
```

Each area of code that currently relies on any of these feature
privileges had to be updated to instead access `feature_X_V2` instead
(as well as future code).

This PR still introduces a minor breaking change, since users who have
`feature_discover.all` and `feature_dashboard.read` are now able to save
queries in Dashboard after upgrade, but we believe this is a better UX
(and likely the expected one) and worth a small breaking change.

### Testing
- All existing privileges should continue to work as they do now,
including deprecated V1 feature privileges and customized serverless
privileges. There should be no changes for existing user roles apart
from the minor breaking change outlined above.
- Check that code changes in your area don't introduce breaking changes
to existing behaviour. Many of the changes are just updating client UI
capabilities code from `feature.privilege` to `feature_v2.privilege`,
which is backward compatible.
- The `savedQueryManagement` feature should now globally control access
to saved query management in Unified Search for all new user roles.
Regardless of privileges for Discover, Dashboard, Maps, or Visualize,
new user roles should follow this behaviour:
- If `savedQueryManagement` is `none`, the user cannot see or access the
saved query management UI or APIs.
- If `savedQueryManagement` is `read`, the user can load queries from
the UI and access read APIs, but cannot save queries from the UI or make
changes to queries through APIs.
- If `savedQueryManagement` is `all`, the user can both load and save
queries from the UI and through APIs.

### Checklist

- [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)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] 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
- [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 risks introducing unintended breaking changes to user privileges
related to saved queries if the deprecated features have not been
properly migrated, and users could gain or lose access to saved query
management on upgrade. This would be bad if it happened, but not overly
severe since it wouldn't grant them access to any ES data they couldn't
previously access (only query saved objects). We have automated testing
in place to help ensure features have been migrated correctly, but the
scope of these changes are broad and touch many places in the codebase.

Additionally, the UI capabilities types are not very strict, and are
referenced with string paths in many places, which makes changing them
riskier than changing strictly typed code. A combination of regex
searches and temporarily modifying the `Capabilities` type to cause type
errors for deprecated privileges was used to identify references in
code. Reviewers should consider if there are any other ways that UI
capabilities can be referenced which were not addressed in this PR.

Our automated tests already help mitigate the risk, but it's important
that code owners thoroughly review the changes in their area and
consider if they could have unintended consequences. The Platform
Security team should also review this PR thoroughly, especially since
some changes were made to platform code around privilege handling. The
Data Discovery team will also manually test the behaviour when upgrading
existing user roles with deprecated feature privileges as part of 9.0
upgrade testing.

---------

Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: “jeramysoucy” <jeramy.soucy@elastic.co>
2025-01-29 17:34:58 -04:00
Gerard Soldevila
4a00449bdc
SKA: Relocate core mock and test-helper modules (#208538)
## 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).

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

| Id | Target folder |
| -- | ------------- |
| `@kbn/core-analytics-browser-mocks` |
`src/core/packages/analytics/browser-mocks` |
| `@kbn/core-analytics-server-mocks` |
`src/core/packages/analytics/server-mocks` |
| `@kbn/core-application-browser-mocks` |
`src/core/packages/application/browser-mocks` |
| `@kbn/core-apps-browser-mocks` |
`src/core/packages/apps/browser-mocks` |
| `@kbn/core-base-browser-mocks` |
`src/core/packages/base/browser-mocks` |
| `@kbn/core-base-server-mocks` | `src/core/packages/base/server-mocks`
|
| `@kbn/core-capabilities-browser-mocks` |
`src/core/packages/capabilities/browser-mocks` |
| `@kbn/core-capabilities-server-mocks` |
`src/core/packages/capabilities/server-mocks` |
| `@kbn/core-chrome-browser-mocks` |
`src/core/packages/chrome/browser-mocks` |
| `@kbn/core-deprecations-browser-mocks` |
`src/core/packages/deprecations/browser-mocks` |
| `@kbn/core-deprecations-server-mocks` |
`src/core/packages/deprecations/server-mocks` |
| `@kbn/core-doc-links-browser-mocks` |
`src/core/packages/doc-links/browser-mocks` |
| `@kbn/core-doc-links-server-mocks` |
`src/core/packages/doc-links/server-mocks` |
| `@kbn/core-elasticsearch-client-server-mocks` |
`src/core/packages/elasticsearch/client-server-mocks` |
| `@kbn/core-elasticsearch-server-mocks` |
`src/core/packages/elasticsearch/server-mocks` |
| `@kbn/core-environment-server-mocks` |
`src/core/packages/environment/server-mocks` |
| `@kbn/core-execution-context-browser-mocks` |
`src/core/packages/execution-context/browser-mocks` |
| `@kbn/core-execution-context-server-mocks` |
`src/core/packages/execution-context/server-mocks` |
| `@kbn/core-fatal-errors-browser-mocks` |
`src/core/packages/fatal-errors/browser-mocks` |
| `@kbn/core-http-browser-mocks` |
`src/core/packages/http/browser-mocks` |
| `@kbn/core-http-context-server-mocks` |
`src/core/packages/http/context-server-mocks` |
| `@kbn/core-http-resources-server-mocks` |
`src/core/packages/http/resources-server-mocks` |
| `@kbn/core-http-router-server-mocks` |
`src/core/packages/http/router-server-mocks` |
| `@kbn/core-http-server-mocks` | `src/core/packages/http/server-mocks`
|
| `@kbn/core-i18n-browser-mocks` |
`src/core/packages/i18n/browser-mocks` |
| `@kbn/core-i18n-server-mocks` | `src/core/packages/i18n/server-mocks`
|
| `@kbn/core-injected-metadata-browser-mocks` |
`src/core/packages/injected-metadata/browser-mocks` |
| `@kbn/core-integrations-browser-mocks` |
`src/core/packages/integrations/browser-mocks` |
| `@kbn/core-lifecycle-browser-mocks` |
`src/core/packages/lifecycle/browser-mocks` |
| `@kbn/core-lifecycle-server-mocks` |
`src/core/packages/lifecycle/server-mocks` |
| `@kbn/core-logging-browser-mocks` |
`src/core/packages/logging/browser-mocks` |
| `@kbn/core-logging-server-mocks` |
`src/core/packages/logging/server-mocks` |
| `@kbn/core-metrics-collectors-server-mocks` |
`src/core/packages/metrics/collectors-server-mocks` |
| `@kbn/core-metrics-server-mocks` |
`src/core/packages/metrics/server-mocks` |
| `@kbn/core-node-server-mocks` | `src/core/packages/node/server-mocks`
|
| `@kbn/core-notifications-browser-mocks` |
`src/core/packages/notifications/browser-mocks` |
| `@kbn/core-overlays-browser-mocks` |
`src/core/packages/overlays/browser-mocks` |
| `@kbn/core-plugins-browser-mocks` |
`src/core/packages/plugins/browser-mocks` |
| `@kbn/core-plugins-server-mocks` |
`src/core/packages/plugins/server-mocks` |
| `@kbn/core-preboot-server-mocks` |
`src/core/packages/preboot/server-mocks` |
| `@kbn/core-rendering-browser-mocks` |
`src/core/packages/rendering/browser-mocks` |
| `@kbn/core-rendering-server-mocks` |
`src/core/packages/rendering/server-mocks` |
| `@kbn/core-saved-objects-api-server-mocks` |
`src/core/packages/saved-objects/api-server-mocks` |
| `@kbn/core-saved-objects-base-server-mocks` |
`src/core/packages/saved-objects/base-server-mocks` |
| `@kbn/core-saved-objects-browser-mocks` |
`src/core/packages/saved-objects/browser-mocks` |
| `@kbn/core-saved-objects-import-export-server-mocks` |
`src/core/packages/saved-objects/import-export-server-mocks` |
| `@kbn/core-saved-objects-migration-server-mocks` |
`src/core/packages/saved-objects/migration-server-mocks` |
| `@kbn/core-saved-objects-server-mocks` |
`src/core/packages/saved-objects/server-mocks` |
| `@kbn/core-status-server-mocks` |
`src/core/packages/status/server-mocks` |
| `@kbn/core-test-helpers-kbn-server` |
`src/dev/packages/core-test-helpers-kbn-server` |
| `@kbn/core-test-helpers-model-versions` |
`src/dev/packages/core-test-helpers-model-versions` |
| `@kbn/core-theme-browser-mocks` |
`src/core/packages/theme/browser-mocks` |
| `@kbn/core-ui-settings-browser-mocks` |
`src/core/packages/ui-settings/browser-mocks` |
| `@kbn/core-ui-settings-server-mocks` |
`src/core/packages/ui-settings/server-mocks` |
| `@kbn/core-usage-data-server-mocks` |
`src/core/packages/usage-data/server-mocks` |


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

```
./.github/codeql/codeql-config.yml
./package.json
./packages/kbn-ts-projects/config-paths.json
./src/core/packages/analytics/browser-mocks/jest.config.js
./src/core/packages/analytics/server-mocks/jest.config.js
./src/core/packages/application/browser-mocks/jest.config.js
./src/core/packages/apps/browser-mocks/jest.config.js
./src/core/packages/base/browser-mocks/jest.config.js
./src/core/packages/base/server-mocks/jest.config.js
./src/core/packages/capabilities/browser-mocks/jest.config.js
./src/core/packages/capabilities/server-mocks/jest.config.js
./src/core/packages/chrome/browser-mocks/jest.config.js
./src/core/packages/deprecations/browser-mocks/jest.config.js
./src/core/packages/deprecations/server-mocks/jest.config.js
./src/core/packages/doc-links/browser-mocks/jest.config.js
./src/core/packages/doc-links/server-mocks/jest.config.js
./src/core/packages/elasticsearch/client-server-mocks/jest.config.js
./src/core/packages/elasticsearch/server-mocks/jest.config.js
./src/core/packages/environment/server-mocks/jest.config.js
./src/core/packages/execution-context/browser-mocks/jest.config.js
./src/core/packages/execution-context/server-mocks/jest.config.js
./src/core/packages/fatal-errors/browser-mocks/jest.config.js
./src/core/packages/http/browser-mocks/jest.config.js
./src/core/packages/http/context-server-mocks/jest.config.js
./src/core/packages/http/resources-server-mocks/jest.config.js
./src/core/packages/http/router-server-mocks/jest.config.js
./src/core/packages/http/server-mocks/jest.config.js
./src/core/packages/i18n/browser-mocks/jest.config.js
./src/core/packages/i18n/server-mocks/jest.config.js
./src/core/packages/injected-metadata/browser-mocks/jest.config.js
./src/core/packages/integrations/browser-mocks/jest.config.js
./src/core/packages/lifecycle/browser-mocks/jest.config.js
./src/core/packages/lifecycle/server-mocks/jest.config.js
./src/core/packages/logging/browser-mocks/jest.config.js
./src/core/packages/logging/server-mocks/jest.config.js
./src/core/packages/metrics/collectors-server-mocks/jest.config.js
./src/core/packages/metrics/server-mocks/jest.config.js
./src/core/packages/node/server-mocks/jest.config.js
./src/core/packages/notifications/browser-mocks/jest.config.js
./src/core/packages/overlays/browser-mocks/jest.config.js
./src/core/packages/plugins/browser-mocks/jest.config.js
./src/core/packages/plugins/server-mocks/jest.config.js
./src/core/packages/preboot/server-mocks/jest.config.js
./src/core/packages/rendering/browser-mocks/jest.config.js
./src/core/packages/rendering/server-mocks/jest.config.js
./src/core/packages/saved-objects/api-server-mocks/jest.config.js
./src/core/packages/saved-objects/base-server-mocks/jest.config.js
./src/core/packages/saved-objects/browser-mocks/jest.config.js
./src/core/packages/saved-objects/import-export-server-mocks/jest.config.js
./src/core/packages/saved-objects/migration-server-mocks/jest.config.js
./src/core/packages/saved-objects/server-mocks/jest.config.js
./src/core/packages/status/server-mocks/jest.config.js
./src/core/packages/theme/browser-mocks/jest.config.js
./src/core/packages/ui-settings/browser-mocks/jest.config.js
./src/core/packages/ui-settings/server-mocks/jest.config.js
./src/core/packages/usage-data/server-mocks/jest.config.js
./src/core/system/tsconfig.type_check.json
./src/dev/packages/core-test-helpers-kbn-server/jest.config.js
./src/dev/packages/core-test-helpers-model-versions/jest.config.js
./src/dev/tsconfig.type_check.json
./src/platform/packages/private/kbn-repo-packages/package-map.json
./src/platform/plugins/private/interactive_setup/tsconfig.type_check.json
./src/platform/plugins/shared/console/tsconfig.type_check.json
./src/plugins/kibana_usage_collection/tsconfig.type_check.json
./src/plugins/saved_objects_management/tsconfig.type_check.json
./src/plugins/telemetry/tsconfig.type_check.json
./src/plugins/usage_collection/tsconfig.type_check.json
./tsconfig.base.json
./tsconfig.base.type_check.json
./tsconfig.refs.json
./x-pack/platform/plugins/private/index_lifecycle_management/tsconfig.type_check.json
./x-pack/platform/plugins/private/remote_clusters/tsconfig.type_check.json
./x-pack/platform/plugins/private/snapshot_restore/tsconfig.type_check.json
./x-pack/platform/plugins/private/watcher/tsconfig.type_check.json
./x-pack/platform/plugins/shared/encrypted_saved_objects/tsconfig.type_check.json
./x-pack/platform/plugins/shared/fleet/tsconfig.type_check.json
./x-pack/platform/plugins/shared/security/tsconfig.type_check.json
./x-pack/platform/plugins/shared/spaces/tsconfig.type_check.json
./x-pack/plugins/actions/tsconfig.type_check.json
./x-pack/plugins/aiops/tsconfig.type_check.json
./x-pack/plugins/alerting/tsconfig.type_check.json
./x-pack/plugins/cases/tsconfig.type_check.json
./x-pack/plugins/enterprise_search/tsconfig.type_check.json
./x-pack/plugins/integration_assistant/tsconfig.type_check.json
./x-pack/plugins/ml/tsconfig.type_check.json
./x-pack/plugins/observability_solution/apm/tsconfig.type_check.json
./x-pack/plugins/observability_solution/apm_data_access/tsconfig.type_check.json
./x-pack/plugins/observability_solution/entity_manager/tsconfig.type_check.json
./x-pack/plugins/observability_solution/exploratory_view/tsconfig.type_check.json
./x-pack/plugins/observability_solution/observability/tsconfig.type_check.json
./x-pack/plugins/observability_solution/slo/tsconfig.type_check.json
./x-pack/plugins/observability_solution/synthetics/tsconfig.type_check.json
./x-pack/plugins/observability_solution/uptime/tsconfig.type_check.json
./x-pack/plugins/rule_registry/tsconfig.type_check.json
./x-pack/plugins/search_playground/tsconfig.type_check.json
./x-pack/plugins/serverless_search/tsconfig.type_check.json
./x-pack/plugins/stack_alerts/tsconfig.type_check.json
./x-pack/plugins/stack_connectors/tsconfig.type_check.json
./x-pack/plugins/task_manager/tsconfig.type_check.json
./x-pack/plugins/transform/tsconfig.type_check.json
./x-pack/solutions/observability/plugins/dataset_quality/tsconfig.type_check.json
./x-pack/solutions/security/packages/security-solution/ecs_data_quality_dashboard/tsconfig.type_check.json
./x-pack/solutions/security/plugins/ecs_data_quality_dashboard/tsconfig.type_check.json
./yarn.lock
.github/CODEOWNERS
```

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

```
src/core/packages/analytics/browser-mocks/jest.config.js:12
src/core/packages/analytics/browser-mocks/tsconfig.json:2
src/core/packages/analytics/server-mocks/jest.config.js:12
src/core/packages/analytics/server-mocks/tsconfig.json:2
src/core/packages/application/browser-mocks/jest.config.js:12
src/core/packages/application/browser-mocks/tsconfig.json:2
src/core/packages/apps/browser-mocks/jest.config.js:12
src/core/packages/apps/browser-mocks/tsconfig.json:2
src/core/packages/base/browser-mocks/jest.config.js:12
src/core/packages/base/browser-mocks/tsconfig.json:2
src/core/packages/base/server-mocks/jest.config.js:12
src/core/packages/base/server-mocks/tsconfig.json:2
src/core/packages/capabilities/browser-mocks/jest.config.js:12
src/core/packages/capabilities/browser-mocks/tsconfig.json:2
src/core/packages/capabilities/server-mocks/jest.config.js:12
src/core/packages/capabilities/server-mocks/tsconfig.json:2
src/core/packages/chrome/browser-mocks/jest.config.js:12
src/core/packages/chrome/browser-mocks/tsconfig.json:2
src/core/packages/deprecations/browser-mocks/jest.config.js:12
src/core/packages/deprecations/browser-mocks/tsconfig.json:2
src/core/packages/deprecations/server-mocks/jest.config.js:12
src/core/packages/deprecations/server-mocks/tsconfig.json:2
src/core/packages/doc-links/browser-mocks/jest.config.js:12
src/core/packages/doc-links/browser-mocks/tsconfig.json:2
src/core/packages/doc-links/server-mocks/jest.config.js:12
src/core/packages/doc-links/server-mocks/tsconfig.json:2
src/core/packages/elasticsearch/client-server-mocks/jest.config.js:12
src/core/packages/elasticsearch/client-server-mocks/tsconfig.json:2
src/core/packages/elasticsearch/server-mocks/jest.config.js:12
src/core/packages/elasticsearch/server-mocks/tsconfig.json:2
src/core/packages/environment/server-mocks/jest.config.js:12
src/core/packages/environment/server-mocks/tsconfig.json:2
src/core/packages/execution-context/browser-mocks/jest.config.js:12
src/core/packages/execution-context/browser-mocks/tsconfig.json:2
src/core/packages/execution-context/server-mocks/jest.config.js:12
src/core/packages/execution-context/server-mocks/tsconfig.json:2
src/core/packages/fatal-errors/browser-mocks/jest.config.js:12
src/core/packages/fatal-errors/browser-mocks/tsconfig.json:2
src/core/packages/http/browser-mocks/jest.config.js:12
src/core/packages/http/browser-mocks/tsconfig.json:2
src/core/packages/http/context-server-mocks/jest.config.js:12
src/core/packages/http/context-server-mocks/tsconfig.json:2
src/core/packages/http/resources-server-mocks/jest.config.js:12
src/core/packages/http/resources-server-mocks/tsconfig.json:2
src/core/packages/http/router-server-mocks/jest.config.js:12
src/core/packages/http/router-server-mocks/tsconfig.json:2
src/core/packages/http/server-mocks/jest.config.js:12
src/core/packages/http/server-mocks/tsconfig.json:2
src/core/packages/i18n/browser-mocks/jest.config.js:12
src/core/packages/i18n/browser-mocks/tsconfig.json:2
src/core/packages/i18n/server-mocks/jest.config.js:12
src/core/packages/i18n/server-mocks/tsconfig.json:2
src/core/packages/injected-metadata/browser-mocks/jest.config.js:12
src/core/packages/injected-metadata/browser-mocks/tsconfig.json:2
src/core/packages/integrations/browser-mocks/jest.config.js:12
src/core/packages/integrations/browser-mocks/tsconfig.json:2
src/core/packages/lifecycle/browser-mocks/jest.config.js:12
src/core/packages/lifecycle/browser-mocks/tsconfig.json:2
src/core/packages/lifecycle/server-mocks/jest.config.js:12
src/core/packages/lifecycle/server-mocks/tsconfig.json:2
src/core/packages/logging/browser-mocks/jest.config.js:12
src/core/packages/logging/browser-mocks/tsconfig.json:2
src/core/packages/logging/server-mocks/jest.config.js:12
src/core/packages/logging/server-mocks/tsconfig.json:2
src/core/packages/metrics/collectors-server-mocks/jest.config.js:12
src/core/packages/metrics/collectors-server-mocks/tsconfig.json:2
src/core/packages/metrics/server-mocks/jest.config.js:12
src/core/packages/metrics/server-mocks/tsconfig.json:2
src/core/packages/node/server-mocks/jest.config.js:12
src/core/packages/node/server-mocks/tsconfig.json:2
src/core/packages/notifications/browser-mocks/jest.config.js:12
src/core/packages/notifications/browser-mocks/tsconfig.json:2
src/core/packages/overlays/browser-mocks/jest.config.js:12
src/core/packages/overlays/browser-mocks/tsconfig.json:2
src/core/packages/plugins/browser-mocks/jest.config.js:12
src/core/packages/plugins/browser-mocks/tsconfig.json:2
src/core/packages/plugins/server-mocks/jest.config.js:12
src/core/packages/plugins/server-mocks/tsconfig.json:2
src/core/packages/preboot/server-mocks/jest.config.js:12
src/core/packages/preboot/server-mocks/tsconfig.json:2
src/core/packages/rendering/browser-mocks/jest.config.js:12
src/core/packages/rendering/browser-mocks/tsconfig.json:2
src/core/packages/rendering/server-mocks/jest.config.js:12
src/core/packages/rendering/server-mocks/tsconfig.json:2
src/core/packages/saved-objects/api-server-mocks/jest.config.js:12
src/core/packages/saved-objects/api-server-mocks/tsconfig.json:2
src/core/packages/saved-objects/base-server-mocks/jest.config.js:12
src/core/packages/saved-objects/base-server-mocks/tsconfig.json:2
src/core/packages/saved-objects/browser-mocks/jest.config.js:12
src/core/packages/saved-objects/browser-mocks/tsconfig.json:2
src/core/packages/saved-objects/import-export-server-mocks/jest.config.js:12
src/core/packages/saved-objects/import-export-server-mocks/tsconfig.json:2
src/core/packages/saved-objects/migration-server-mocks/jest.config.js:12
src/core/packages/saved-objects/migration-server-mocks/tsconfig.json:2
src/core/packages/saved-objects/server-mocks/jest.config.js:12
src/core/packages/saved-objects/server-mocks/tsconfig.json:2
src/core/packages/status/server-mocks/jest.config.js:12
src/core/packages/status/server-mocks/tsconfig.json:2
src/core/packages/theme/browser-mocks/jest.config.js:12
src/core/packages/theme/browser-mocks/tsconfig.json:2
src/core/packages/ui-settings/browser-mocks/jest.config.js:12
src/core/packages/ui-settings/browser-mocks/tsconfig.json:2
src/core/packages/ui-settings/server-mocks/jest.config.js:12
src/core/packages/ui-settings/server-mocks/tsconfig.json:2
src/core/packages/usage-data/server-mocks/jest.config.js:12
src/core/packages/usage-data/server-mocks/tsconfig.json:2
src/dev/packages/core-test-helpers-kbn-server/jest.config.js:12
src/dev/packages/core-test-helpers-kbn-server/tsconfig.json:2
src/dev/packages/core-test-helpers-model-versions/jest.config.js:12
src/dev/packages/core-test-helpers-model-versions/tsconfig.json:2
```

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
2025-01-29 12:14:44 +01:00
Gerard Soldevila
fb26c1c683
SKA: Update broken references and URLs (#206836)
## Summary

Updates a number of broken file references and broken links.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
2025-01-28 03:32:48 +00:00
Tim Sullivan
06a28ae4f7
[SharedUX/SCSS] remove scss from selected components (#207008)
## Summary
Part of https://github.com/elastic/kibana-team/issues/1417

This PR converts a batch of SCSS to Emotion in the SharedUX domain.

* `KibanaSolutionAvatar`
* `FilePicker`
* `SolutionNav`
* `SolutionNavCollapseButton`
* `KbnTopNav`

All of the changes, except for `KbnTopNav`, can be tested in Storybook
by running `yarn storybook shared_ux`

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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.

- [x] The risk of inexact conversion: verifying this PR requires manual
checks to ensure that the conversion has not created any regressions in
the style.
2025-01-24 19:42:02 +00:00
Rodney Norris
2812f8b99a
[Search] remove app search guided onboarding (#206670)
## Summary

Removing references to the appSearch guided onboarding guide. App Search
is removed in v9.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-24 09:46:05 -06:00
Nathan Reese
05916056cd
[embeddable] make presentation interface names consistent (#205279)
PR cleans up presentation interface names for consistentency
* adds `$` suffix to all observables. For example, `dataLoading` =>
`dataLoading$`
* removes `Panel` naming convention from interface names since an api
may not be a panel, an api may be a dashboard. For example,
`PublisesPanelTitle` => `PublishesTitle`

#### Note to Reviewers
Pay special attention to any place where your application creates an
untyped API. In the example below, there is no typescript violation when
the parent returns `dataLoading` instead of `dataLoading$` since the
parent is not typed as `PublishesDataLoading`. Please check for
instances like these.

```
<ReactEmbeddableRenderer
  getParentApi={() => {
    dataLoading: new BehaviorSubject()
  }}
/>
```

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-22 10:46:01 -06:00
Hannah Mudge
5ee4297994
[Dashboard][kbn-grid-layout] Update styles (#206503)
Closes https://github.com/elastic/kibana/issues/204060

## Summary

This PR updates the styles used for `kbn-grid-layout` in Dashboard as
shown below.

- **Dragging**

    | Before | After |
    |--------|--------|
|
![image](https://github.com/user-attachments/assets/13161969-3eaf-4dce-bcf4-7b4850215816)
|
![image](https://github.com/user-attachments/assets/d76dc678-6277-4819-b554-f6b66b200c0c)
|
|
![image](https://github.com/user-attachments/assets/84d8d489-2240-4f10-809f-0aa30415f408)
|
![image](https://github.com/user-attachments/assets/573d71ad-71fb-47ab-a34e-66b845ecff67)
|

- **Resizing**

    | Before | After |
    |--------|--------|
|
![image](https://github.com/user-attachments/assets/79dfebd0-538b-4193-9b66-30961e9c7b21)
|
![image](https://github.com/user-attachments/assets/bc66ed35-83c4-4291-8cec-6ae8dda8f006)
|
|
![image](https://github.com/user-attachments/assets/d3fb5643-a77f-416f-9fc3-53af6225782a)
|
![image](https://github.com/user-attachments/assets/df2c65d5-af52-4848-b16c-f9f85abd5d9a)
|

As part of this work, I moved all aesthetic style logic out of the
`kbn-grid-layout` package and added support for Emotion to the
`GridLayout` component instead - this means that the consumer is
responsible for applying styles based on given classes, and
`kbn-grid-layout` is now less opinionated. The only styling kept in the
`kbn-grid-layout` package are those that handle layout-engine specific
functionality (positioning of panels, hiding edit actions in view mode,
etc).

In addition, I also updated the styles used in the grid example app and
added settings for dynamically changing the grid gutter size + row
height:




https://github.com/user-attachments/assets/c2f06db1-7041-412e-b546-86b102cc0770


### Checklist

- [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/src/platform/packages/shared/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

This PR has minimal risk, since it is primarily style changes.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-21 12:52:39 -07:00
Devon Thomson
3719be0144
[Serialized state only] Update Library Transforms and Duplicate (#206140)
Unifies the various `LibraryTransforms` interfaces, updates all by reference capable embeddables to use them in the same way, and migrates the clone functionality to use only serialized state.
2025-01-21 13:43:43 -05: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
Nathan Reese
1bd8c97982
[uiActions] make trigger action registry async (#205512)
Closes https://github.com/elastic/kibana/issues/191642, part of
https://github.com/elastic/kibana/pull/205512

PR makes the following changes to uiActions API.
* Deprecates `registerAction` and `addTriggerAction` and replaces them
with `registerActionAsync` and `addTriggerActionAsync`
* Makes all registry consumption methods async, such as `getAction`,
`getTriggerActions` and `getFrequentlyChangingActionsForTrigger`

PR updates presentation_panel plugin to use `registerActionAsync`. With
actions behind async import, page load bundle size has been reduced by
21.1KB.

<img width="500" alt="Screenshot 2025-01-08 at 2 14 23 PM"
src="https://github.com/user-attachments/assets/34a2cae9-dc5e-429b-bbdb-ffd9dfe1cce3"
/>

Also, async exports are [contained in a single file
`panel_module`](https://github.com/elastic/kibana/issues/206117). This
results in dashboard only loading one `presentationPanel.chunk`.

<img width="500" alt="Screenshot 2025-01-08 at 2 15 02 PM"
src="https://github.com/user-attachments/assets/e083b852-b50d-4fa7-8ebd-e2f56f85e998"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-13 09:57:34 -07: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
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
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
Dario Gieselaar
98ce312ba3
More strict plugin type definitions (#205232)
Stricter defaults for plugin types: `Plugin` and `CoreSetup` now have
empty objects as defaults instead of `object` which is assignable to
anything basically. This catches some type errors, but my motivation for
this is to allow something like:

```ts
function createPlugin ():Plugin<MySetupContract, MyStartContract, MySetupDependencies, MyStartDependencies> {
	return {
		// look ma, no additional typing necessary
		setup ( coreSetup, pluginsSetup ) {
		},
		start ( coreStart, pluginsStart ) {
		}
	}
}
```
2025-01-07 16:41:15 +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
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
Gerard Soldevila
bb877cff7e
Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-data-discovery (#203152)
## 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).

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

| Id | Target folder |
| -- | ------------- |
| `@kbn/data-view-editor-plugin` |
`src/platform/plugins/shared/data_view_editor` |
| `@kbn/data-view-field-editor-plugin` |
`src/platform/plugins/shared/data_view_field_editor` |
| `@kbn/data-view-management-plugin` |
`src/platform/plugins/shared/data_view_management` |
| `@kbn/data-views-plugin` | `src/platform/plugins/shared/data_views` |
| `@kbn/discover-enhanced-plugin` |
`x-pack/platform/plugins/private/discover_enhanced` |
| `@kbn/discover-plugin` | `src/platform/plugins/shared/discover` |
| `@kbn/discover-shared-plugin` |
`src/platform/plugins/shared/discover_shared` |
| `@kbn/field-formats-plugin` |
`src/platform/plugins/shared/field_formats` |
| `@kbn/saved-objects-finder-plugin` |
`src/platform/plugins/shared/saved_objects_finder` |
| `@kbn/saved-search-plugin` |
`src/platform/plugins/shared/saved_search` |
| `@kbn/unified-doc-viewer-plugin` |
`src/platform/plugins/shared/unified_doc_viewer` |
| `@kbn/unified-histogram-plugin` |
`src/platform/plugins/shared/unified_histogram` |




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

| Id | Target folder |
| -- | ------------- |
| `@kbn/content-management-utils` |
`src/platform/packages/shared/kbn-content-management-utils` |
| `@kbn/data-view-utils` |
`src/platform/packages/shared/kbn-data-view-utils` |
| `@kbn/datemath` | `src/platform/packages/shared/kbn-datemath` |
| `@kbn/deeplinks-analytics` |
`src/platform/packages/shared/deeplinks/analytics` |
| `@kbn/default-nav-analytics` |
`src/platform/packages/private/default-nav/analytics` |
| `@kbn/discover-utils` |
`src/platform/packages/shared/kbn-discover-utils` |
| `@kbn/es-query` | `src/platform/packages/shared/kbn-es-query` |
| `@kbn/field-types` | `src/platform/packages/shared/kbn-field-types` |
| `@kbn/field-utils` | `src/platform/packages/shared/kbn-field-utils` |
| `@kbn/react-field` | `src/platform/packages/shared/kbn-react-field` |
| `@kbn/resizable-layout` |
`src/platform/packages/shared/kbn-resizable-layout` |
| `@kbn/search-errors` |
`src/platform/packages/shared/kbn-search-errors` |
| `@kbn/search-response-warnings` |
`src/platform/packages/shared/kbn-search-response-warnings` |
| `@kbn/search-types` | `src/platform/packages/shared/kbn-search-types`
|
| `@kbn/unified-data-table` |
`src/platform/packages/shared/kbn-unified-data-table` |
| `@kbn/unified-doc-viewer` |
`src/platform/packages/shared/kbn-unified-doc-viewer` |
| `@kbn/unified-field-list` |
`src/platform/packages/shared/kbn-unified-field-list` |
| `@kbn/unsaved-changes-badge` |
`src/platform/packages/private/kbn-unsaved-changes-badge` |


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

```
./.buildkite/scripts/steps/functional/scout_ui_tests.sh
./.eslintrc.js
./.i18nrc.json
./docs/developer/advanced/sharing-saved-objects.asciidoc
./docs/developer/architecture/core/saved-objects-service.asciidoc
./docs/developer/best-practices/navigation.asciidoc
./docs/developer/contributing/development-unit-tests.asciidoc
./docs/developer/plugin-list.asciidoc
./examples/unified_doc_viewer/README.md
./examples/unified_field_list_examples/public/plugin.ts
./legacy_rfcs/text/0015_bazel.md
./oas_docs/scripts/merge_ess_oas.js
./oas_docs/scripts/merge_serverless_oas.js
./package.json
./packages/kbn-repo-packages/package-map.json
./packages/kbn-synthetic-package-map/synthetic-packages.json
./packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js
./packages/kbn-ts-projects/config-paths.json
./packages/kbn-ui-shared-deps-src/BUILD.bazel
./packages/kbn-unified-field-list/src/services/field_examples_calculator/field_examples_calculator.ts
./packages/shared-ux/prompt/no_data_views/types/index.d.ts
./src/dev/code_coverage/ingest_coverage/__tests__/mocks/team_assign_mock.txt
./src/dev/storybook/aliases.ts
./src/platform/packages/private/default-nav/analytics/jest.config.js
./src/platform/packages/private/kbn-unsaved-changes-badge/jest.config.js
./src/platform/packages/shared/deeplinks/analytics/jest.config.js
./src/platform/packages/shared/kbn-content-management-utils/jest.config.js
./src/platform/packages/shared/kbn-data-view-utils/jest.config.js
./src/platform/packages/shared/kbn-datemath/jest.config.js
./src/platform/packages/shared/kbn-discover-utils/jest.config.js
./src/platform/packages/shared/kbn-es-query/jest.config.js
./src/platform/packages/shared/kbn-field-types/jest.config.js
./src/platform/packages/shared/kbn-field-utils/jest.config.js
./src/platform/packages/shared/kbn-react-field/jest.config.js
./src/platform/packages/shared/kbn-resizable-layout/jest.config.js
./src/platform/packages/shared/kbn-search-errors/jest.config.js
./src/platform/packages/shared/kbn-search-response-warnings/jest.config.js
./src/platform/packages/shared/kbn-search-types/jest.config.js
./src/platform/packages/shared/kbn-unified-data-table/jest.config.js
./src/platform/packages/shared/kbn-unified-doc-viewer/jest.config.js
./src/platform/packages/shared/kbn-unified-field-list/jest.config.js
./src/platform/plugins/shared/data_view_editor/jest.config.js
./src/platform/plugins/shared/data_view_field_editor/jest.config.js
./src/platform/plugins/shared/data_view_management/jest.config.js
./src/platform/plugins/shared/data_views/jest.config.js
./src/platform/plugins/shared/discover/README.md
./src/platform/plugins/shared/discover/jest.config.js
./src/platform/plugins/shared/discover/public/context_awareness/README.md
./src/platform/plugins/shared/discover_shared/README.md
./src/platform/plugins/shared/discover_shared/jest.config.js
./src/platform/plugins/shared/field_formats/jest.config.js
./src/platform/plugins/shared/saved_objects_finder/jest.config.js
./src/platform/plugins/shared/saved_search/jest.config.js
./src/platform/plugins/shared/unified_doc_viewer/jest.config.js
./src/platform/plugins/shared/unified_histogram/jest.config.js
./tsconfig.base.json
./tsconfig.refs.json
./x-pack/.i18nrc.json
./x-pack/platform/plugins/private/discover_enhanced/jest.config.js
./x-pack/platform/plugins/private/discover_enhanced/ui_tests/README.md
./x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts
./yarn.lock
.github/CODEOWNERS
```

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

```
src/platform/packages/private/default-nav/analytics/jest.config.js:12
src/platform/packages/private/default-nav/analytics/tsconfig.json:2
src/platform/packages/private/kbn-unsaved-changes-badge/jest.config.js:12
src/platform/packages/private/kbn-unsaved-changes-badge/tsconfig.json:2
src/platform/packages/shared/deeplinks/analytics/jest.config.js:12
src/platform/packages/shared/deeplinks/analytics/tsconfig.json:2
src/platform/packages/shared/kbn-content-management-utils/jest.config.js:12
src/platform/packages/shared/kbn-content-management-utils/tsconfig.json:2
src/platform/packages/shared/kbn-data-view-utils/jest.config.js:12
src/platform/packages/shared/kbn-data-view-utils/tsconfig.json:2
src/platform/packages/shared/kbn-datemath/jest.config.js:22
src/platform/packages/shared/kbn-datemath/tsconfig.json:2
src/platform/packages/shared/kbn-discover-utils/jest.config.js:12
src/platform/packages/shared/kbn-discover-utils/tsconfig.json:2
src/platform/packages/shared/kbn-es-query/jest.config.js:12
src/platform/packages/shared/kbn-es-query/tsconfig.json:2
src/platform/packages/shared/kbn-field-types/jest.config.js:12
src/platform/packages/shared/kbn-field-types/tsconfig.json:2
src/platform/packages/shared/kbn-field-utils/jest.config.js:12
src/platform/packages/shared/kbn-field-utils/tsconfig.json:2
src/platform/packages/shared/kbn-react-field/jest.config.js:12
src/platform/packages/shared/kbn-react-field/tsconfig.json:2
src/platform/packages/shared/kbn-resizable-layout/jest.config.js:12
src/platform/packages/shared/kbn-resizable-layout/tsconfig.json:2
src/platform/packages/shared/kbn-search-errors/jest.config.js:12
src/platform/packages/shared/kbn-search-errors/tsconfig.json:2
src/platform/packages/shared/kbn-search-response-warnings/jest.config.js:12
src/platform/packages/shared/kbn-search-response-warnings/tsconfig.json:2
src/platform/packages/shared/kbn-search-types/jest.config.js:12
src/platform/packages/shared/kbn-search-types/tsconfig.json:2
src/platform/packages/shared/kbn-unified-data-table/jest.config.js:12
src/platform/packages/shared/kbn-unified-data-table/tsconfig.json:2
src/platform/packages/shared/kbn-unified-doc-viewer/jest.config.js:12
src/platform/packages/shared/kbn-unified-doc-viewer/tsconfig.json:2
src/platform/packages/shared/kbn-unified-field-list/jest.config.js:12
src/platform/packages/shared/kbn-unified-field-list/tsconfig.json:2
src/platform/plugins/shared/data_view_editor/jest.config.js:12
src/platform/plugins/shared/data_view_editor/tsconfig.json:2
src/platform/plugins/shared/data_view_field_editor/jest.config.js:12
src/platform/plugins/shared/data_view_field_editor/tsconfig.json:2
src/platform/plugins/shared/data_view_field_editor/tsconfig.json:7
src/platform/plugins/shared/data_view_management/jest.config.js:12
src/platform/plugins/shared/data_view_management/tsconfig.json:2
src/platform/plugins/shared/data_views/jest.config.js:12
src/platform/plugins/shared/data_views/tsconfig.json:2
src/platform/plugins/shared/discover/jest.config.js:12
src/platform/plugins/shared/discover/public/application/context/context_app.scss:1
src/platform/plugins/shared/discover/public/application/main/components/layout/discover_layout.scss:1
src/platform/plugins/shared/discover/public/context_awareness/README.md:118
src/platform/plugins/shared/discover/public/context_awareness/README.md:119
src/platform/plugins/shared/discover/tsconfig.json:10
src/platform/plugins/shared/discover/tsconfig.json:2
src/platform/plugins/shared/discover_shared/jest.config.js:12
src/platform/plugins/shared/discover_shared/tsconfig.json:10
src/platform/plugins/shared/discover_shared/tsconfig.json:2
src/platform/plugins/shared/field_formats/jest.config.js:12
src/platform/plugins/shared/field_formats/tsconfig.json:2
src/platform/plugins/shared/saved_objects_finder/jest.config.js:12
src/platform/plugins/shared/saved_objects_finder/tsconfig.json:2
src/platform/plugins/shared/saved_search/jest.config.js:12
src/platform/plugins/shared/saved_search/tsconfig.json:2
src/platform/plugins/shared/saved_search/tsconfig.json:6
src/platform/plugins/shared/unified_doc_viewer/jest.config.js:12
src/platform/plugins/shared/unified_doc_viewer/tsconfig.json:2
src/platform/plugins/shared/unified_doc_viewer/tsconfig.json:6
src/platform/plugins/shared/unified_histogram/jest.config.js:12
src/platform/plugins/shared/unified_histogram/tsconfig.json:2
src/platform/plugins/shared/unified_histogram/tsconfig.json:6
x-pack/platform/plugins/private/discover_enhanced/jest.config.js:10
x-pack/platform/plugins/private/discover_enhanced/tsconfig.json:2
```

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-30 13:23:47 +01:00
Catherine Liu
b80980694a
[Embeddable] EUI Visual Refresh Integration (#204452)
## Summary

Related to https://github.com/elastic/kibana/issues/203132.
Part of [#204596](https://github.com/elastic/kibana/issues/204596).

This replaces all references to euiThemeVars in favor of the useEuiTheme
hook.

### 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>
2024-12-19 10:12:09 -08:00
Julia Rechkunova
40c90550f1
[Discover] Rename Saved Search to Discover Session (#202217)
- Closes https://github.com/elastic/kibana/issues/174144

## Summary

This PR renames Saved Search into Discover Session in UI.

- [x] Discover
- [x] Saved Objects page and modal
- [x] Docs
- [x] Other occurrences 

<img width="810" alt="Screenshot 2024-12-16 at 15 20 10"
src="https://github.com/user-attachments/assets/e39083da-f496-4ed5-bbdc-8e184897fc41"
/>
<img width="1220" alt="Screenshot 2024-12-11 at 14 40 15"
src="https://github.com/user-attachments/assets/a6dc3e29-e1a5-4304-8148-0108231cc9de"
/>
<img width="1476" alt="Screenshot 2024-12-16 at 14 57 39"
src="https://github.com/user-attachments/assets/4b34c70e-e21a-4d82-85f2-f5a3cb7a3826"
/>


### Checklist

- [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)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: wajihaparvez <wajiha.parvez@elastic.co>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
2024-12-18 13:45:32 +01:00
Lukas Olson
8ad0eb4122
Remove bfetch explorer example plugin (#204284)
## Summary

Part of https://github.com/elastic/kibana/issues/186139.

First step of breaking up https://github.com/elastic/kibana/pull/199066
into smaller pieces.

Removes the bfetch explorer example plugin.
2024-12-16 10:28:58 -07:00