Commit graph

6667 commits

Author SHA1 Message Date
Ignacio Rivas
baadf59aa2
[Console] Fix bug with inline autocompletion (#210187) 2025-02-13 13:15:22 +01:00
Stratoula Kalafateli
f96b68dbac
[ES|QL] Creates controls for stats functions (#210170)
## Summary

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

Allows the creation of function controls. These are only available for
STATS

<img width="880" alt="image"
src="https://github.com/user-attachments/assets/fe57c3e5-f42a-4d9c-95b3-4a5a12938821"
/>


### Release notes
Allows the creation of dynamic aggregations controls for ES|QL charts.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/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)
2025-02-13 12:28:18 +01:00
Drew Tate
201dfddeaa
[ES|QL] Separate FROM autocomplete routine (#210465)
## Summary

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

Gives `FROM` and `METADATA` autocomplete logic its own home 🏡

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

### Identify risks

- [ ] As with any refactor, there's a possibility this will introduce a
regression in the behavior of FROM. However, all automated tests are
passing and I have tested the behavior manually and can detect no
regression.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-13 01:03:30 +01:00
Jeramy Soucy
6bfd5a581a
[kbn-scout] update category of server integration tests (#210783)
## Summary

Updates the test category for the server integration test configs from
UI_TEST to UNIT_INTEGRATION_TEST.
2025-02-12 17:23:20 +01:00
Nathan Reese
d9d0b39272
[dashboard] remove DashboardContainerInput type (#210446)
Part of https://github.com/elastic/kibana/issues/204249

Clean up work from embeddable refactor. PR removes
`DashboardContainerInput` type, which is a duplicate of `DashboardState`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-12 08:16:48 -07:00
Robert Oskamp
4bd80160b2
[kbn-scout] add test config category to reporting (#210167)
## Summary

This PR adds a test config category to the scout reporting. This allows
us to distinguish between UI and API FTR tests.
A new property `testConfigCategory` has been added to all FTR configs
that don't already inherit it from a higher level config.
2025-02-12 11:17:04 +01:00
Julia Rechkunova
9635cfa526
[Discover] Fix formatting and sorting for custom ES|QL vars (#209360)
- Closes https://github.com/elastic/kibana/issues/208020

## Summary

By default the data view (which is used in ES|QL mode) has only mapped
fields as per field caps for the current index pattern. This PR
dynamically extends with additional fields based on ES|QL meta
information.

This change helps to fix the formatting for ES|QL var values and fixes
sorting on them.

<img width="1673" alt="Screenshot 2025-02-03 at 18 42 14"
src="https://github.com/user-attachments/assets/3647a375-f0f5-43e6-815d-d5a4292c637a"
/>
<img width="643" alt="Screenshot 2025-02-03 at 18 42 50"
src="https://github.com/user-attachments/assets/9d84bc23-7665-43c1-8ac2-d67174b68c31"
/>


### Checklist


- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2025-02-11 10:58:51 +01:00
Davis McPhee
37465f43d2
[Discover] Add "All logs" data view to classic nav (#209042)
## Summary

This PR adds the default "All logs" data view introduced in #205991 to
the classic nav in addition to Observability nav.

Resolves #209013.

### 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)
2025-02-10 21:18:26 -04: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
Thom Heymann
151ce184c5
[OneDiscover] Remove logs explorer (#209565)
Resolves #209261

## Summary

Removes the code used to render Logs Explorer. This does not result in
any functional changes.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-06 17:40:55 +00:00
Hannah Mudge
c35698bcf8
[Dashboard] Presentation panel refactor (#207275)
Closes https://github.com/elastic/kibana/issues/206686
Closes https://github.com/elastic/kibana/issues/197897
Part of https://github.com/elastic/kibana/issues/207852

## Summary

This PR is a major refactor of the `PresentationPanel` component,
including an overhaul of the hover action and panel title components.
Some notable highlights include:
- All styles in the `PresentationPanel` component were moved from SASS
to Emotion
- The over-complicated logic to combine hover actions when the panel
shrinks was removed in favour of CSS, driven by a [container
query](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries)
Removing the `updateCombineHoverActions` function (which was defined in
a React component and not memoized) also made a difference in
performance when dragging:
    
   | Before | After |
   |--------|--------|
|
![image](https://github.com/user-attachments/assets/e66898d6-a6fc-42c7-9e24-f116d3bd85a6)
|
![image](https://github.com/user-attachments/assets/1f1d75ba-2ebc-4def-9d2e-14dfd5e1a585)
|
      

- The over-complicated logic defined in
`usePresentationPanelTitleClickHandle`, which was meant to ignore the
`onClick` that would trigger after a panel was dragged, was converted to
2 lines of CSS

### Small usability improvements

This PR also includes a few small usability improvements, such as:

- Ensuring that only the **first** row of hover actions overlaps with
the Dashboard's sticky top navigation bar, and this only happens when
the dashboard has no controls. This results in much better behaviour in
most scenarios:
  
  | Before | After |
  |--------|--------|
| ![Jan-27-2025
16-14-26](https://github.com/user-attachments/assets/2bf5eaa0-06ab-4d87-897f-d217f189daf7)
| ![Jan-27-2025
16-13-41](https://github.com/user-attachments/assets/61b0f06a-1363-4bfc-8a2b-c57a3e736552)
|

- Adding a small delay for hiding the hover actions on mouse leave,
which makes it a lot easier to grab the drag handle:

  | Before | After |
  |--------|--------|
| ![Jan-27-2025
16-21-11](https://github.com/user-attachments/assets/65138e53-1856-44f0-913f-01383b8aa6c2)
| ![Jan-27-2025
16-20-17](https://github.com/user-attachments/assets/7c8ba4d8-8b77-4bc5-85af-a082cace1f96)
|

- Preventing the resize handle from overlapping Dashboard's stick top
navigation:

  | Before | After |
  |--------|--------|
| ![Jan-27-2025
16-24-31](https://github.com/user-attachments/assets/5363a302-5f6a-4483-9782-516023567d87)
| ![Jan-27-2025
16-25-04](https://github.com/user-attachments/assets/8614d025-b45b-4af2-81d6-c62a086ca427)
|


### 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-02-05 15:18:04 -07:00
Shahzad
679e2badaf
Remove dependency date-fns !! (#209539)
## Summary

What's better than upgrade? removing it alltogther !!
2025-02-05 17:34:16 +01:00
Ignacio Rivas
86497d5e7f
[Console] Refactor flaky test (#209516) 2025-02-05 11:28:46 +01:00
Julia Rechkunova
c53140036a
[Discover] Unskip Edit field flyout tests (#209271)
- Closes https://github.com/elastic/kibana/issues/193102

### Checklist

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
2025-02-04 18:32:49 +01:00
Marco Vettorello
7260564f6a
[Vega] Fix highlight for HJSON (#208858)
## Summary

This PR fixes the missing highlight theme for HJSON specs in Vega.
The issue https://github.com/elastic/kibana/issues/205711 was caused by
https://github.com/elastic/kibana/pull/182348 that inadvertently
specified the code-editor package as sideEffect free. This cause the
compiler to exclude every import without exported and used methods.
This was the case for the code-editor that registered some language
highlighters in that way.

The solution adopted here is to mark the register_language.ts file as a
file with side effects, the alternative solution can be to register
these directly from within the code_editor component.
A third option is to move these registration within the monaco package
where other languages are also registered.
I'd like to leave to @elastic/appex-sharedux the preference to followup
with a better fix for the future.

I'd also like to have the opinion from @elastic/kibana-operations
because the misconfigured package issue can be seen only in production
and not in development mode. Is it possible that webpack doesn't apply
treeshaking when in development mode?

fix https://github.com/elastic/kibana/issues/205711
Should also fix the same issue but for TSVB Markdown

The fix was tested on CI by running at first only the CI FT with the
`sideEffects:false` to verify the failure (see
[build](https://buildkite.com/elastic/kibana-pull-request/builds/272375))
and then with the fix specifying the actual file that contains side
effects.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-03 14:18:35 +01:00
Kibana Machine
c1f17515b1 skip failing test suite (#193102) 2025-01-31 13:41:17 +11:00
Rodney Norris
26fac70c9b
[Search][Configuration] Remove Enterprise Search node values (#208856)
## Summary

This removes the config values associated with the enterprise search
node.

### 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
- [x] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
2025-01-30 13:28:26 -06:00
Nathan Reese
758768136d
[dashboard] remove legacy section from 'Add panel' flyout (#208116)
Users should use Lens to visualize data. Users should not use TSVB or
aggregation based panels. To this end, "easy button" UIs, such as
dashboard's "Add panel" flyout, should guide users to lens and not guide
them to legacy applications.

This PR removes `legacy` section from dashboard "Add panel" flyout.
Users can still add legacy panels to dashboards via "visualize"
application. The path is more steps, but this is as intended. Using old
stuff should be painful and require extra work as a caret to move users
to new stuff.

<img width="500" alt="Screenshot 2025-01-23 at 1 08 41 PM"
src="https://github.com/user-attachments/assets/e142cba9-a880-4ad6-a3f8-a981a03daaec"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-30 12:22:51 -07:00
Ania Kowalska
a376e9b169
refactor RowHeightSettings component to EUI layout (#203606) 2025-01-30 09:12:02 +01:00
Julia Rechkunova
8ffb2ff628
[Discover] In-table search (#206454)
- Closes https://github.com/elastic/kibana/issues/192360

## Summary

The default browser Find-in-page does not work great with the grid
virtualization and our pagination and it can only find matches in rows
which are currently displayed.

This PR adds in-table search support to the grid so users can find
matches in all grid rows (up to `500` sample docs/rows by default) and
jump between them with "Previous"/"Next" buttons.

![Jan-24-2025
22-03-54](https://github.com/user-attachments/assets/95b31fb8-4740-4c5f-ba91-8e1c19066e02)

The implementation is extracted in a new package
`@kbn/data-grid-in-table-search`. This would allow to use in-table
search with `EuiDataGrid` on other pages of Kibana too.

`Cmd+F` shortcut is overridden when one of grid elements is in focus
otherwise we keep the browser default behaviour.

### 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)
- [ ]
[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>
Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
2025-01-29 19:52:07 -04: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
Davis McPhee
bf9d34465e
[Discover] Add a default "All logs" temporary data view in the Observability Solution view (#205991)
## Summary

This PR adds an "All logs" ad hoc (temporary) data view to the Discover
Observability root profile based on the central log sources setting,
allowing quick access to logs (with the most up to date log sources)
without needing to first manually create a data view:
![CleanShot 2025-01-22 at 17 47
19@2x](https://github.com/user-attachments/assets/2c03ec79-0cf9-414e-8883-130599989c25)

To support this, a new `getDefaultAdHocDataViews` extension point has
been added to Discover, allowing profiles to specify an array of ad hoc
data view specs would should be created by default when the profile is
resolved, and automatically cleaned up when the profile changes or the
user leaves Discover.

Resolves #201669.
Resolves #189166.

### Notes

- The "All logs" ad hoc data view should only appear when using the
Observability Solution view (in any deployment type).
- Data view specs returned from `getDefaultAdHocDataViews` must include
consistent IDs across resolutions in order for Discover to manage them
correctly (e.g. to find and reload the data view after a page refresh).
Situations where we'd expect a change in ID (e.g. when saving to a
Discover session) are handled internally by Discover.
- To avoid a breaking change, the returned ad hoc data views have no
impact on the default data view shown when navigating to Discover. If
any persisted data views exist, one of them will be used as the default.
If no persisted data views exist, the first entry of the array returned
by `getDefaultAdHocDataViews` will be used as the default.
- We still want to notify users in Discover when they have no ES data at
all, and prompt them to install integrations. For this reason, the "no
data" page is still shown in Discover even if there are default profile
ad hoc data views (unlike if there are persisted data views, in which
case we use the default and hide the "no data" page).
- When saving a Discover session that uses a default profile ad hoc data
view, the data view will be copied on save as `{DATA_VIEW_NAME} (copy)`.
This allows us to assign a unique ID to the version that gets saved with
the Discover session, and avoids having to choose between the profile
data view or the embedded data view when reopening the session, which
has drawbacks:
- If choosing the profile data view, the Discover session may display
incorrectly if the log sources setting changed since it was saved, and
the user would no longer be able to view the session as it was intended
without first modifying the setting to the expected value.
- If choosing the embedded data view, the replacement shown after
opening the Discover session may not reflect the latest log sources
setting until a new session is started, and there would be no way for
the user to migrate the session to use the latest version of the profile
data view.

### 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)
- [ ]
[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.
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-01-29 11:04:32 -04:00
Ignacio Rivas
4da814d138
[Console] Fix flaky autocomplete test for index fields (#208503) 2025-01-29 15:36:02 +01:00
Sonia Sanz Vivas
20ed84d41d
Fix flaky console tests (#208337)
Fixes https://github.com/elastic/kibana/issues/204381

## Summary
The test that verifies tab changes in Console was failing because it was
verifying the presence of the tab content before it was fully loaded.


### Checklist
- [x] [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-29 09:09:05 +01:00
Larry Gregory
9ce2dd8df9
Additional prototype pollution protections (#206073)
## Summary

1. Extends the server-side prototype pollution protections introduced in
https://github.com/elastic/kibana/pull/190716 to include
`Array.prototype`.
2. Applies the same prototype pollution protections to the client-side.


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

- [ ] Sealing prototypes on the client can lead to failures in
third-party dependencies. I'm relying on sufficient functional test
coverage to detect issues here. As a result, these protections are
disabled by default for now, and can be controlled via setting
`server.prototypeHardening: true/false`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-28 23:00:43 +01:00
Hanna Tamoudi
06d16614a9
[Automatic Import] rename plugin to automatic import (#207325)
## Summary

Rename `integration-assistant` plugin to `automatic-import`.
2025-01-28 21:55:42 +01:00
Ignacio Rivas
458704f475
[Console] Fix flaky autocomplete functional tests (#208322) 2025-01-27 15:01:19 +01:00
Stratoula Kalafateli
b84c65c095
[ES|QL] Dashboard variables (#202875)
## Summary

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

Supports dashboard variables in ES|QL charts.

This PR introduces the first phase of ES|QL controls. In this phase:
- the flow starts from Lens ES|QL editor (and no vice-versa, this will
happen on a later phase after we discuss some technical details with ES)
- it is only available for dashboards (we want to include them in other
apps as Discover but this is the next phase driven by the presentation
team)
- it supports variables for intervals, fields and values. I haven't
added support for functions. I am going to do it after this PR being
merged (there are some business questions I want to answer first)

For more info check this
[deck](https://docs.google.com/presentation/d/1qSbWLSoC5SseXuLix763vpp8sa7ikp3pQTbHImEHBoc)


![meow](https://github.com/user-attachments/assets/c101a257-fbe4-44e6-9686-18012f39e8c1)

### Implementation details

- There is a new service, the ESQLVariables service that is responsible
for ES|QL variables. I isolated this to a new plugin owned by the ES|QL
team for cleaner code and for avoiding circular dependencies
- A new ESQL_CONTROL type got created. It follows the exact same logic
as the rest controls. No changes in the architecture here.
- The creation of the controls (the control forms) have been added in
the esql plugin.
- Lens has small changes:
   -  The support of variables in the textBased datasource
- Two callbacks needed to be called after the creation / cancellation of
an ES|QL control


### Types of ES|QL variables 

We have 2 types:

- Static Values (the user gives a list of values with his own
responsibility). As the flow starts from the editor we can identify what
they most possibly want to do and we give the user some options but they
have the freedom to do as they want. A basic validation has been added
too.
- Values from an ES|QL query (the user gives an ES|QL query that
generates the values). As the flow starts from the editor we can suggest
a query for the users but they can always change it as they wish.

<img width="1168" alt="image"
src="https://github.com/user-attachments/assets/cc28beb8-111c-43ad-9f26-865bc62ae512"
/>

### Example of a control creation from the editor

![meow](https://github.com/user-attachments/assets/09fa0e21-98cd-4160-b271-4f8ed0a91bf7)


### Release note
ES|QL charts now allow the creation of controls in dashboards. You can
control a part of the query such as a field, an interval or a value.

### 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] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [x] [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>
Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
Co-authored-by: Devon Thomson <devon.thomson@elastic.co>
2025-01-27 11:35:54 +01:00
Rodney Norris
a774033bf2
[Search] Remove calls to enterprise search config (#206971)
## Summary

Updated the search plugin config endpoint to return just features and
kibana version, removing the call to the enterprise search node.

### 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-24 12:41:21 -06: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
Tiago Costa
e15350ea6f
skip flaky suite (#204381) 2025-01-22 20:26:16 +00:00
Kibana Machine
b73cb8a31c skip failing test suite (#156926) 2025-01-23 04:14:38 +11: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
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
Marco Vettorello
25913693c0
[TSVB] fix borealis colors check on test (#206484)
## Summary

Fix and unskip TSVB Functional test by using the right Borealis colors.

fix https://github.com/elastic/kibana/issues/206380

---------

Co-authored-by: nickofthyme <nicholas.partridge@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-20 18:58:53 +01:00
Davis McPhee
1c7a823920
[Discover] [ES|QL] Prevent redundant requests when loading Discover sessions and toggling chart visibility (#206699)
## Summary

This PR prevents redundant Discover requests in ES|QL mode for the
following scenarios:
- Creating a new Discover session.
- Saving the current Discover session.
- Loading a saved Discover session.
- Toggling the Unified Histogram chart visibility.

It does so by addressing several underlying state related issues that
were triggering the redundant requests:
- Skipping the initial emission of `currentSuggestionContext` on Unified
Histogram mount, which immediately triggered a second fetch.
- Treating the Unified Histogram `table` prop the same as other props
which affect Lens suggestions (data view, query, columns), and deferring
updates to it until result fetching completes to avoid unnecessary
suggestion updates.
- Removing all auto-fetching behaviour from Unified Histogram and
instead relying solely on the consumer to control when fetching should
occur (including the initial fetch).

Resolves #165192.

### 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.
- [x] [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: Matthias Wilhelm <matthias.wilhelm@elastic.co>
2025-01-20 11:11:01 -04:00
Matthias Wilhelm
a04274723e
[Discover] Remove redundant data fetching when hiding/showing the histogram/chart (#206389)
Since the timerange in Discover of the main request is stable we don't need to trigger a main fetch for all data when the histogram/chart is being hidden/displayed, unless it's necessary to get the data (e.g. when the histogram/chart was hiden when a discover session was being loaded)
2025-01-17 10:49:37 +00:00
Elena Stoeva
b6f6c4cefe
[Console] Copy as curl only for Kibana requests (#206631)
Closes https://github.com/elastic/kibana/issues/201781

## Summary

This PR makes the context menu in Console only display "Copy as curl" if
any of the selected requests is an internal Kibana request (i.e. starts
with the `kbn:` prefix).

Sample Kibana request: `GET kbn:/api/index_management/indices`




https://github.com/user-attachments/assets/a6c5cbc3-4dc5-44db-8ebb-2cbc9b3aea2d

---------

Co-authored-by: Ignacio Rivas <rivasign@gmail.com>
2025-01-16 16:41:25 +00:00
Ignacio Rivas
983470fb85
[Console] Add a small action for copying variable names to clipboard (#206628) 2025-01-16 09:27:31 +01:00
Alejandro Fernández Haro
45d4f7de0b
Add local EBT shipper (#189671)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
2025-01-16 09:26:43 +01:00
Nathan Reese
55f3cf7a66
[dashboard] lazy load dashboard actions (#206492)
* move actions to `registerActionAsync`
* remove global string file loaded in page load bundle
* Break constants into smaller files so only constants required by page
load bundle are exposed.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-15 11:57:09 -07:00
Kibana Machine
c174f10929 skip failing test suite (#206380) 2025-01-14 04:42:18 +11:00
Matthias Wilhelm
b625221757
[Discover] Unskip and stabilize ESQL request count test (#206207) 2025-01-13 06:59:33 +00:00
Tomasz Kajtoch
93935619de
Make Borealis the default theme in non-serverless (#203840) 2025-01-11 14:23:45 +01:00
Matthias Wilhelm
df495ce532
[Discover][ES]QL] Ensure the same time range is being used for documents and histogram (#204694)
Fixing the case a relative time range is set (for example "Last 15 minutes") and the time range goes out of sync for table and histogram requests on Discover in ES|QL mode.

Fixes a redundant ES|QL request for histogram data, with different timeranges, when the timerange is changed.
2025-01-10 17:06:45 +01:00
Lola
473eb721bc
[Cloud Security] Feature Flag Support for Cloud Security Posture Plugin (#205438)
## Summary

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

## Changes

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

## Benefits

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

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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-10 10:55:06 -05:00
Nick Peihl
ce072268aa
[Dashboard] Add functional test for panel listing types (#205808)
Fixes #192663

## Summary

Add functional tests that verify the number of panel types registered in
the dashboards Add panel flyout. Any changes to the number of registered
panel types will trigger a review from the
`@elastic/kibana-presentation` team.

This PR also adds an additional test for panel types registered with an
advanced license.
2025-01-09 08:37:29 -05:00
Matthias Wilhelm
cbcb24e036
[Discover] Unskip functional discover request counts test and skip ES|QL part (#205690)
Unskipping the main test, and unskipping the `ES|QL` part due to flakiness
2025-01-09 06:35:40 +01:00
Davis McPhee
8eb326d596
[Discover] Fix issue where KEEP columns are not applied after Elasticsearch error (#205833)
## Summary

This PR fixes an issue where columns are not applied correctly when
using the ES|QL `KEEP` command after an Elasticsearch error has
occurred.

Fixes #205353.

### 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.
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-01-08 14:20:24 -04:00
Anton Dosov
3b2ab7b413
Sustainable Kibana Architecture: Move CodeEditor related packages #205587 (#205738)
## Summary

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

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

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

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

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

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


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

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

</details>
2025-01-08 15:25:47 +01:00