Commit graph

487 commits

Author SHA1 Message Date
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
Vadim Kibana
8904cb068c
[ES|QL] Improve the Builder class (#203558)
## Summary

Partially addresses https://github.com/elastic/kibana/issues/202113

- Makes sure it is possible to construct any AST using the `Builder`
class
- Fixes few bugs in pretty-printer
- No space is added before unary `-` or `+` expression, for example,
`-123`.
  - Source cluster is now printed `cluster:my_index` 


### 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
2024-12-13 16:19:10 +01:00
Devon Thomson
abfd590d4d
[Embeddables Rebuild] Make Serialize Function Synchronous (#203662)
changes the signature of the `serializeState` function so that
it no longer returns MaybePromise
2024-12-12 21:25:03 -05:00
Tim Sullivan
99aa884fa0
Preparation for High Contrast Mode, Analytics Experience domains (#202608)
## Summary

**Reviewers: Please test the code paths affected by this PR. See the
"Risks" section below.**

Part of work for enabling "high contrast mode" in Kibana. See
https://github.com/elastic/kibana/issues/176219.

**Background:**
Kibana will soon have a user profile setting to allow users to enable
"high contrast mode." This setting will activate a flag with
`<EuiProvider>` that causes EUI components to render with higher
contrast visual elements. Consumer plugins and packages need to be
updated selected places where `<EuiProvider>` is wrapped, to pass the
`UserProfileService` service dependency from the CoreStart contract.

**NOTE:** **EUI currently does not yet support the high-contrast mode
flag**, but support for that is expected to come in around 2 weeks.
These first PRs are simply preparing the code by wiring up the
`UserProvideService`.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

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

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

- [ ] [medium/high] The implementor of this change did not manually test
the affected code paths and relied on type-checking and functional tests
to drive the changes. Code owners for this PR need to manually test the
affected code paths.
- [ ] [medium] The `UserProfileService` dependency comes from the
CoreStart contract. If acquiring the service causes synchronous code to
become asynchronous, check for race conditions or errors in rendering
React components. Code owners for this PR need to manually test the
affected code paths.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-12 13:16:07 -06:00
Sid
bffd4e14e7
[Security team] Update components for EUI visual refresh (#201795)
Closes https://github.com/elastic/kibana/issues/200005

## Summary

Integrate changes from the Borealis theme to components owned by
@elastic/kibana-security team.


### Notes

There are no visual changes in this PR. However:
- Switch from using `success` to `accentSecondary` where needed
- Switched from 'colors.disabled` to `colors.textDisabled`


### Screenshots

There isn't much to add but adding a few before/after screenshots of the
changes made



| Usage | Before | After |
|--------|--------|--------|
| API Key token field | <img width="446" alt="image"
src="https://github.com/user-attachments/assets/0167671c-b9e8-4493-88d9-514c524ccd06">
| <img width="469" alt="image"
src="https://github.com/user-attachments/assets/bde7f308-1ba4-4a92-bb27-e5875357ba49">
|
| User profile page | <img width="271" alt="image"
src="https://github.com/user-attachments/assets/668a66df-949a-4ce6-a390-d5ea2dd3489c">
| <img width="271" alt="image"
src="https://github.com/user-attachments/assets/a3965279-6f64-407c-923c-f7a07f474a14">
|
| Copy SO to space counter | <img width="991" alt="image"
src="https://github.com/user-attachments/assets/87a2cf3c-6b1f-4cf0-b818-03ed59133598">
| <img width="1161" alt="image"
src="https://github.com/user-attachments/assets/549648f1-297b-434d-b61b-d2761bc5d641">
|
| Space listing | <img width="604" alt="image"
src="https://github.com/user-attachments/assets/6db8f9df-4059-4a06-b49f-e48dd910277a"
/> |
![image](https://github.com/user-attachments/assets/5798590a-f65a-4fbe-b6b8-feb10dd62562)
|





### How to test

1. Start ES and KIB as:

```
yarn es snapshot --license trial
KBN_OPTIMIZER_THEMES=experimental yarn start --no-base-path
```

2. Navigate to `Stack Management > Advance Setting` and change the theme
to Borealis.
3. Verify the different screens as seen in the screenshots to see if
they render correctly with no visual regression


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-13 00:22:18 +11:00
Hannah Mudge
2a76fe3ee4
[Dashboard] [Collapsable Panels] Add embeddable support (#198413)
Closes https://github.com/elastic/kibana/issues/190379

## Summary

This PR switches the example grid layout app to render embeddables as
panels rather than the simplified mock panel we were using previously.
In doing so, I had to add the ability for custom panels to add a custom
drag handle via the `renderPanelContents` callback - this required
adding a `setDragHandles` callback to the `ReactEmbeddableRenderer` that
could be passed down to the `PresentationPanel` component.




https://github.com/user-attachments/assets/9e2c68f9-34af-4360-a978-9113701a5ea2



#### New scroll behaviour

In https://github.com/elastic/kibana/pull/201867, I introduced a small
"ease" to the auto-scroll effect that happens when you drag a panel to
the top or bottom of the window. However, in that PR, I was using the
`smooth` scrolling behaviour, which unfortunately became **very**
jittery once I switched to embeddables rather than simple panels
(specifically in Chrome - it worked fine in Firefox).

The only way to prevent this jittery scroll was to switch to the default
scroll behaviour, but this lead to a very **abrupt** stop when the
scrollbar reached the top and/or bottom of the page - so, to give the
same "gentle" stop that the `smooth` scroll had, I decided to recreate
this effect by adding a slow down "ease" when close to the top or bottom
of the page:


https://github.com/user-attachments/assets/cb7bf03f-4a9e-4446-be4f-8f54c0bc88ac

This effect is accomplished via the parabola formula `y = a(x-h)2 + k`
and can be roughly visualized with the following, which shows that the
"speed up" ease happens at a much slower pace than the "slow down" ease:


![image](https://github.com/user-attachments/assets/02b4389c-fe78-448d-9c02-c4ec5e722d5e)




#### Notes about parent changes
As I investigated improving the efficiency of the grid layout with
embeddables, one of the main things I noticed was that the grid panel
was **always** remounted when moving a panel from one collapsible
section to another. This lead me (and @ThomThomson) down a rabbit hole
of React-reparenting, and we explored a few different options to see if
we could change the parent of a component **without** having it remount.

In summary, after various experiments and a whole bunch of research, we
determined that, due to the reconciliation of the React tree, this is
unfortunately impossible. So our priorities will instead have to move to
making the remount of `ReactEmbeddableRenderer` **as efficient as
possible** via caching, since the remount is inevitable.

### Checklist

- [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 the most significant work is
contained in the `examples` plugin. Some changes were made to the
presentation panel to allow for custom drag handles, but this isn't
actually used in Dashboard - so for now, this code is only called in the
example plugin, as well.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-10 11:14:31 -06:00
Nathan Reese
e103a253d9
[dashboard] Do not reset panel to undefined or empty last saved state (#203158)
Part of https://github.com/elastic/kibana/issues/201627

This is a short term fix for serverless and 8.x branches (long term fix
is an architectural change that will only be merged into 9.0 and 8.18
branches).

Fix prevents users from reseting a panel edited via embeddable transfer
service. This prevents panel from getting into an invalid state.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-09 20:04:15 -07:00
Gerard Soldevila
313f973aec
Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-esql (#202722)
## 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.
> Do not attempt to push any changes unless you know what you are doing.
> Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.




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

| Id | Target folder |
| -- | ------------- |
| `@kbn/esql` | `src/platform/plugins/shared/esql` |
| `@kbn/esql-datagrid` | `src/platform/plugins/shared/esql_datagrid` |


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

  | Id | Target folder |
  | -- | ------------- |
  | `@kbn/esql-ast` | `src/platform/packages/shared/kbn-esql-ast` |
| `@kbn/esql-editor` | `src/platform/packages/private/kbn-esql-editor` |
| `@kbn/esql-utils` | `src/platform/packages/shared/kbn-esql-utils` |
| `@kbn/esql-validation-autocomplete` |
`src/platform/packages/shared/kbn-esql-validation-autocomplete` |
| `@kbn/language-documentation` |
`src/platform/packages/private/kbn-language-documentation` |


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

```
./.buildkite/scripts/steps/esql_generate_function_metadata.sh
./.buildkite/scripts/steps/esql_grammar_sync.sh
./.eslintignore
./.eslintrc.js
./.i18nrc.json
./docs/developer/plugin-list.asciidoc
./examples/esql_ast_inspector/public/plugin.ts
./examples/esql_validation_example/public/plugin.ts
./package.json
./packages/kbn-esql-validation-autocomplete/src/validation/validation.test.ts
./packages/kbn-monaco/BUILD.bazel
./packages/kbn-repo-packages/package-map.json
./packages/kbn-ts-projects/config-paths.json
./packages/kbn-ui-shared-deps-src/BUILD.bazel
./src/dev/storybook/aliases.ts
./src/platform/packages/private/kbn-esql-editor/jest.config.js
./src/platform/packages/private/kbn-language-documentation/jest.config.js
./src/platform/packages/private/kbn-language-documentation/package.json
./src/platform/packages/shared/kbn-esql-ast/jest.config.js
./src/platform/packages/shared/kbn-esql-utils/jest.config.js
./src/platform/packages/shared/kbn-esql-validation-autocomplete/README.md
./src/platform/packages/shared/kbn-esql-validation-autocomplete/jest.config.js
./src/platform/packages/shared/kbn-esql-validation-autocomplete/jest.integration.config.js
./src/platform/packages/shared/kbn-esql-validation-autocomplete/package.json
./src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts
./src/platform/plugins/shared/esql/jest.config.js
./src/platform/plugins/shared/esql_datagrid/jest.config.js
./tsconfig.base.json
./yarn.lock
```
</details>
<details>
<summary>Updated relative paths</summary>

```
src/platform/packages/private/kbn-esql-editor/jest.config.js:12
src/platform/packages/private/kbn-esql-editor/tsconfig.json:2
src/platform/packages/private/kbn-language-documentation/jest.config.js:12
src/platform/packages/private/kbn-language-documentation/package.json:12
src/platform/packages/private/kbn-language-documentation/tsconfig.json:2
src/platform/packages/shared/kbn-esql-ast/jest.config.js:12
src/platform/packages/shared/kbn-esql-ast/tsconfig.json:2
src/platform/packages/shared/kbn-esql-utils/jest.config.js:12
src/platform/packages/shared/kbn-esql-utils/tsconfig.json:2
src/platform/packages/shared/kbn-esql-validation-autocomplete/jest.config.js:12
src/platform/packages/shared/kbn-esql-validation-autocomplete/jest.integration.config.js:12
src/platform/packages/shared/kbn-esql-validation-autocomplete/package.json:10
src/platform/packages/shared/kbn-esql-validation-autocomplete/package.json:11
src/platform/packages/shared/kbn-esql-validation-autocomplete/scripts/generate_function_definitions.ts:389
src/platform/packages/shared/kbn-esql-validation-autocomplete/tsconfig.json:2
src/platform/plugins/shared/esql/jest.config.js:12
src/platform/plugins/shared/esql/tsconfig.json:2
src/platform/plugins/shared/esql/tsconfig.json:7
src/platform/plugins/shared/esql_datagrid/jest.config.js:12
src/platform/plugins/shared/esql_datagrid/tsconfig.json:2
src/platform/plugins/shared/esql_datagrid/tsconfig.json:7
```
</details>
<details>
<summary>Script errors</summary>

```

```
</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
2024-12-09 11:33:55 +01:00
Julia Rechkunova
2f95dee8f4
[Discover] Remove discover:searchFieldsFromSource setting (#202679)
- Closes https://github.com/elastic/kibana/issues/196501

## Summary

The PR removes `discover:searchFieldsFromSource` Advanced Setting and
the associated code.
This breaking change is planned for v9.

The setting was marked as deprecated in v8.15
https://github.com/elastic/kibana/pull/185871

### 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
- [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)
2024-12-06 17:58:47 +01:00
Nathan Reese
d508b5da9c
[embeddable] remove legacy embeddable factories from 'Add from library' flyout (#202823)
Part of https://github.com/elastic/kibana/issues/180059

PR removes legacy embeddable factory support from Canvas and Dashboard
`Add from library` flyout

PR also does the following clean-ups
1) Renames folder, files, and component from `add_panel_flyout` to
`add_from_library_flyout`. When component was originally created,
dashboard `Add panel` button did not exist, and `Add from library`
button was called `Add panel`. Now that dashboard contains `Add panel`
and `Add from library` buttons, the old naming convention is super
confusing and not longer lines up with the current UI.
2) moves registry to `add_from_library` folder so that the registry is
in closer proximity to its usage.
2) Renames `registerReactEmbeddableSavedObject` to
`registerAddFromLibraryType` because
`registerReactEmbeddableSavedObject` does not clearly specifying what
the registry enables.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-05 12:55:40 -07:00
Tim Sullivan
6178e8295d
Preparation for High Contrast Mode, Core/SharedUX domains (#202606)
## Summary

**Reviewers: Please test the code paths affected by this PR. See the
"Risks" section below.**

Part of work for enabling "high contrast mode" in Kibana. See
https://github.com/elastic/kibana/issues/176219.

**Background:**
Kibana will soon have a user profile setting to allow users to enable
"high contrast mode." This setting will activate a flag with
`<EuiProvider>` that causes EUI components to render with higher
contrast visual elements. Consumer plugins and packages need to be
updated selected places where `<EuiProvider>` is wrapped, to pass the
`UserProfileService` service dependency from the CoreStart contract.

**NOTE:** **EUI currently does not yet support the high-contrast mode
flag**, but support for that is expected to come in around 2 weeks.
These first PRs are simply preparing the code by wiring up the
`UserProvideService`.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

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

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

- [ ] [medium/high] The implementor of this change did not manually test
the affected code paths and relied on type-checking and functional tests
to drive the changes. Code owners for this PR need to manually test the
affected code paths.
- [ ] [medium] The `UserProfileService` dependency comes from the
CoreStart contract. If acquiring the service causes synchronous code to
become asynchronous, check for race conditions or errors in rendering
React components. Code owners for this PR need to manually test the
affected code paths.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-05 08:26:41 -07:00
Marta Bondyra
d92aa91c3a
[Dashboard][Collapsable Panels] Responsive layout (#200771)
## Summary

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

### Key Features

#### Responsiveness

1. Adds a responsive view controlled by the `accessMode` prop. 
2. For the responsive version (in the `VIEW` mode), panels retain height
and are arranged based on screen order (left-to-right, top-to-bottom).
3. Interactivity (drag/resize) is disabled in `view` mode.

<img width="514" alt="Screenshot 2024-11-25 at 17 34 56"
src="https://github.com/user-attachments/assets/6a5a97aa-de9b-495a-b1de-301bc935a5ab">

#### Maximization
1. Supports expanded panel view using the `expandedPanelId` prop.
2. Interactivity (drag/resize) is disabled when a panel is expanded.

<img width="1254" alt="Screenshot 2024-11-25 at 17 35 05"
src="https://github.com/user-attachments/assets/c83014f6-18ad-435b-a59d-1d3ba3f80d84">

#### Considerations
1. CSS elements naming convention: Main component uses `kbnGrid` class,
with modifiers like `kbnGrid--nonInteractive`. For the drag handle of
`GridPanel` I used `kbnGridPanel__dragHandle` classname.
2. Classes vs. Inline Styles: I opted for using
`kbnGrid--nonInteractive` instead of adding one more subscription to
`GridPanel` to modify the styles inline. It's the first time in this
package that I used classes instead of inline styles for no-initial
styles setting.
3. Naming Convention: I opted for using the `expanded` word to describe
an expanded panel. Another one could be `maximized` as it's more used in
UI, but less in the legacy code.
4. Interactivity (drag/resize) is disabled in responsive mode but we
could consider to limit this to small viewports only (<768px).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-28 19:31:09 +01:00