Commit graph

3237 commits

Author SHA1 Message Date
Krzysztof Kowalczyk
52ee949f6f
[FieldFormatters] Allow boolean field to be colored (#203498)
## Summary

This PR allows for boolean type field to be colored. 

Closes: #195861
2024-12-11 20:18:33 +01:00
Lukas Olson
162b1497b9
Add limit to Discover ES|QL queries to remove deprecation warnings (#202735)
## Summary

Resolves https://github.com/elastic/kibana/issues/196491.

Adds a `LIMIT` to our ES|QL Discover tests. Without the `LIMIT` we are
getting the following deprecation messages:

> Elasticsearch deprecation: 299
Elasticsearch-9.0.0-c74c06daee0583562c82597b19178268b9f415e5 "No limit
defined, adding default limit of [1000]"

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2024-12-11 06:18:11 -07:00
Nathan Reese
101e797e9d
Remove dashboard embeddable (#194892)
Closes https://github.com/elastic/kibana/issues/197281

PR replaces `DashboardContainer`, which implements legacy Container and
Embeddable interfaces, with plain old javascript object implementation
returned from `getDashboardApi`.

The following are out of scope for this PR and will be accomplished at a
later time:
1) re-factoring dashboard folder structure
2) removing all uses of Embeddable and EmbeddableInput types
3) removing legacy types like DashboardContainerInput

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
Co-authored-by: Devon Thomson <devon.thomson@elastic.co>
2024-12-10 09:34:04 -06: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
Davis McPhee
4215a637da
[Data Views] Disable scripted field creation in the Data Views management page (#202250)
## Summary

Scripted fields in data views have been deprecated since 7.13, and
superseded by runtime fields.

The ability to create new scripted fields has been removed from the Data
Views management page in 9.0. Existing scripted fields can still be
edited or deleted, and the creation UI can be accessed by navigating
directly to
`/app/management/kibana/dataViews/dataView/{dataViewId}/create-field`,
but it is recommended to migrate to runtime fields or ES|QL instead to
prepare for removal.

Additionally, the scripted fields entry in the Upgrade Assistant has
been updated to reflect these changes, improve migration instructions,
and surface the full list of data views across all spaces that contain
scripted fields as well as their associated spaces. New documentation
has been added to the "Manage data views" page with examples and
instructions to help users migrate off scripted fields to runtime fields
or ES|QL, which is also linked to from the Upgrade Assistant entry.

Data Views management page:

![management](https://github.com/user-attachments/assets/ed42310c-d7fa-48ba-8430-533e9230b48d)

Upgrade Assistant:
<img
src="https://github.com/user-attachments/assets/4ff27866-4fe8-4357-82e8-cd4c503ab50b"
width="500" />

Resolves #182067.

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

---------

Co-authored-by: Matt Kime <matt@mattki.me>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-05 20:11:34 -04:00
Ignacio Rivas
27e828c669
[Console] Only copy as curl should be allowed for kbn requests (#201915) 2024-12-03 05:07:48 -06:00
Julia Rechkunova
14bdd8d51b
[Discover] Remove the legacy table (#201254)
- Closes https://github.com/elastic/kibana/issues/167582

## Summary

This PR removes the code related to the legacy doc table and 2 Advanced
Settings: `doc_table:legacy` and `truncate:maxHeight`.

The legacy table in Discover was replaced by the new data grid in v8.3.
The `doc_table:legacy` Advanced Setting was added to let users switch
back to the legacy table if necessary. The removal of the setting and
the legacy table entirely would allow us to reduce bundle size,
maintenance burden, and code complexity.

Also the legacy table does not support many new features which were
added to the grid only (e.g. comparing selected documents, context-aware
UI based on current solution project, column resizing, bulk row
selection, copy actions, new doc viewer flyout, and more).

Since v8.15 `doc_table:legacy` is marked as deprecated on Advanced
Settings page via https://github.com/elastic/kibana/issues/179899

Since v8.16 `truncate:maxHeight` is marked as deprecated too via
https://github.com/elastic/kibana/pull/183736

The removal of these 2 settings and the associated code is planned for
v9.

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-03 12:03:08 +01:00
Matthias Wilhelm
d1c2e04912
[Discover] Unskip _sidebar tests for MKI testing (#202133) 2024-12-03 06:17:39 +01:00
Davis McPhee
281269f6a0
[Unified Data Table] Stop passing data grid density as key (#202390)
## Summary

When the data grid density setting was added, an issue was found with
resetting the density state:
https://github.com/elastic/kibana/pull/188495#discussion_r1712510252. It
was caused by an EUI bug: https://github.com/elastic/eui/issues/7962.
The EUI bug has been fixed and this is no longer an issue, so we can
remove the workaround we were using by passing the data grid density in
the `key` prop to the data grid to force a re-render. Besides removing a
small piece of tech debt, this change improves performance when
switching densities, and no longer closes the popover when changing the
density (like other settings).

### 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/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)
2024-12-02 14:22:53 -04:00
Ignacio Rivas
648c323d1b
[Console] Dont show autocomplete within comment blocks (#201543) 2024-11-29 07:39:24 -06:00
Ignacio Rivas
82de734e6c
[Console] Avoid duplicate suggestions in autocomplete (#201766) 2024-11-29 12:58:39 +01:00
Julia Rechkunova
f50b93c290
[Discover] Address the flaky histogram code (#201809)
- Closes https://github.com/elastic/kibana/issues/201744
- Similar to https://github.com/elastic/kibana/issues/184600

## Summary

This PR fixes the issues with the transition from a data view without a
time field to a data view with a time field.

Previously reported error:
![management Index patterns on aliases discover verify hits should be
able to
disc-4da8c0b87362e3312cae00dc943a984acfda9af98d821decb6f48164eaca21ae](https://github.com/user-attachments/assets/652096ef-70c1-4394-a665-6b2b15d976ec)
2024-11-28 10:35:29 +01:00
Marco Antonio Ghiani
ac6025eaa1
[One Discover] Breakdown by log.level for logs sources (#200584)
## 📓 Summary

Closes #183498 

This work sets the Breakdown selector for the Histogram to the
`log.level` field once a logs data source is resolved.
It also applies to ES|QL queries, the change is applied/removed on each
source change.

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
2024-11-28 09:12:47 +01:00
Julia Rechkunova
4701af32cf
[Discover] Unskip data view tests (#201784)
- Closes https://github.com/elastic/kibana/issues/201072
- Closes https://github.com/elastic/kibana/issues/201071

I would not say that the changes fixed it but it does not fail again so
let's unskip and monitor.
2024-11-27 21:40:23 +01:00
Davis McPhee
d7601442f2
Fix flaky test #181955 (#201904)
## Summary

Resolves #181955.

### 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/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
- [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
- [ ] 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-11-27 15:34:37 -04:00
Kibana Machine
a77d98b0e3 skip failing test suite (#201744) 2024-11-28 02:08:30 +11:00
Graham Hudgins
398dcbf526
[Discover] field formatter truncated hex color pickers (#201676)
## Summary

Updates data view color field formatter to allow
easier hex color entry (the UI is truncated today)
2024-11-26 13:47:04 -05:00
Marco Liberati
61d0320c64
[Lens] Embeddable react refactor (#186642)
## Summary

This PR contains the refactor of the Lens embeddable with the new React
architecture.

fix https://github.com/elastic/kibana/issues/174957
fixes https://github.com/elastic/kibana/issues/180672

**Current status**:
 Ready to review

### Notes for testing and reviewers

Other than reworking the Lens embeddable with the new architecture this
PR contains the following major changes.

#### Edit flow
The `Edit` flow has changed to in-line first using the new `Edit` API
provided by the new system
* The impact of this change can be noticed in the code on the `Canvas`
case where the Custom Lens component is instructed to avoid the inline
editing. In all the other cases in-line editing is enabled by default
now.
* Another side effect of this has been the replacement of the special
`INLINE_EDIT` action id into the regular `EDIT` action. Some tests have
been affected by this replacing the `clickEdit` function with the
`openEditorFromFlyout` one.
* The Inline editing codebase **as been reworked entirely** so make sure
to stress test this side of things.

#### Attribute service

Another important aspect changed in this PR is the `attributeService`:
this was tied to the previous Embeddable system and it is now completely
skipped. The Lens wrapper around that has been reworked to be thinner
and directly call the CM services.
* Please make sure to test thoroughly save/load SO flows

#### Transformation API (by-value <=> by-reference flow)

The new system adopts the new Transformation API (who prevents the panel
to fully reload on change).
* Please make sure to test thoroughly Visualize library <=> by value
flows
* In particular moving from one type and another should change how the
Panel Settings interpret "default" values to reset

#### Message system

Also this part of the code was partially rewritten to be more manageable
ont he embeddable surface, maintaining the core functionalities.
* Please make sure to test thoroughly error messages, warnings and info
messages
  * Some scenarios to test includes
* multi-layer errors (i.e. use a broken KQL query for an
annotation/multi-layers). Check that the panel recovers correctly from
it when resolved
    * Missing references
    * Missing dataViews
    * Wrong formatted SO
* Configuration mistakes - check that a broken config is not saveable

### Other areas to check

* Change filters in dashboard/viz and check that are correctly handled
* Check drilldowns
* Check that `Unsaved changes` are correctly detected
* Check that the panel updates correctly on `View` mode change

## Main type changes

This PR contains also some important `type` changes, here's listed:
* the `query` property now explicitly supports ES|QL query type.
  * in `main` it used to work without type support
* `LensEmbeddableInput`/`LensEmbeddableOutput` types have changed, but
the type names remained the same.

## Follow ups already planned:

Some enhancements have been already collected and will be addressed in a
follow up [here](https://github.com/elastic/kibana/issues/195355)

### Tasks
<details>

<summary>Detailed list of tasks for the refactor</summary>

* New embeddable factory
  * [x] Define visualization context
  * [x] Define observables to track
  * [x] Basic panel settings
  * [x] Basic edit api
  * [x] inspector api 
  * [x] Library services
  * [x] Unified search api
  * [x] Basic integrations api
  * [x] State management api for inline editing
  * Publish correct observables
    * [x] `dataViews`
    * [x] `query`
    * [x] `filters`
    * [x] `dataLoading`
    * [x] `savedObjectId`
  * Actions
    * [x] View underlying data api
 * Custom renderer
   * [x] Basic implementation
   * [x] Support callbacks
   * [x] Support custom styling/paddings
 * Expose  
* [x] Handle searchSession
* Edit
  * [x] Open panel in Lens editor
  * Inline editing
    * [x] rework references logic
      * #180726
* integrate the logic to extract filters dataViews from filters as for
the first bug in #188545
    * DSL flyout
      * [x] open flyout
      * [x] save
    * ES|QL
      * [x] open flyout on creation
      * [x] open flyout on editing
      * [x] save
* [x] revisit mounting logic to avoid detach if possible (not possible
yet)
* [x] explore the integration with the new `onEdit` api method used for
the inline editing~~
      * [x] created panel management module and sorted it out
    * [x] open in Editor
      * [x] fix the save on return to dashboard
* ~~migrate by ref to by value on inline editing~~ will do it in a
follow up PR
* Add from library issues
  * [x] Fix missing title and tags
* Data loading
  * [x] Compute all required data params for rendering
* Render the panel
  * [x] hook up user messaging system
  * [x] Merge search context
  * [x] Expression variables
  * [x] panel settings
    * [x] per panel time range
    * [x] per panel filter
    * test with both DSL and ES|QL mode
  * Reload
    * [x] on unified search updates
    * [x] on config changes
    * [x] on drilldown changes?
    * [x] on view mode change 
 * Attributes service
   * [x] load from library
   * [x] save to library

</details>


### Pending issues:
<details>

<summary>Detailed list of issues</summary>

* [x] Unified histogram does not render in Discover
* [x] Saving to library from context menu in dashboard doesn't save the
title
* [x] When adding a vis from the library the new panel has no title
* [x] Vis disappears when opening inline editor and cancel
  * Create a viz, save and return to dashboard, then edit it and cancel.
* Saving an edit inline doesn't apply the changes (i.e. changing the
chart type)
  * [x] Changing the chart type on the layer panel leads to a crash
* [x] Changing the chart type won't update the visualization (via both
config panel or suggestions)
* [x] Edit a dimension will stretch the panel to overflow the fly-out
* [x] duplicating a dimension in the inline editor by drag and drop
works buggy visually
* When duplicating a panel, the new panel gets the same title rather
than “title (copy)”
  * [x] by-value panels
  * [x] by-reference panels
* [x] brushing throughout the timerange doesn’t work
* [x] filtering when clicking on value doesn’t work
* [x] filtering from legend doesn’t work
* [x] for lens table, the sort ascending/descending actions don’t have
an effect
* [x] filtering doesn’t display on table either
* Discover related issues
* thanks to @davismcphee investigation the source of the issue seems to
be related to the way the `abortController` is managed in the new
embeddable implementation as Discover is relying on that.
* [x] needs to investigate for a fix that restores the previous
behaviour of the `abortController` management
  * [x] the hits total count is not in sync with the chart/table now
* [x] Change chart type via suggestion panel when inline editing in
Discover doesn't update the chart
* [x] Dirty panel issue (see @nickofthyme 's
[comment](https://github.com/elastic/kibana/pull/186642#discussion_r1792659477)
)
* [x] `Unsaved changes` issue (see @mbondyra
[comment](https://github.com/elastic/kibana/pull/186642#discussion_r1795384587))
* [x] Multiple errors not rendered correctly in panel when blocking
(i.e. missing field - `lens-message-list-trigger` related)
  * [x] recover from a blocker error required 2 renders
* Missing SO error should not be handled for the custom render component
(legacy behaviour) but should be correctly handled for dashboard (will
be handled in a follow up PR given that is broken on `main` too)
* [x] Too many requests on Unified Histogram when in Discover (3 vs 2)
* [x] Too many request on slow queries for Unified Histogram (2 vs 1)
* [x] Annotations preview issues (chart rendering with height `0px`)
* [x] `uuid` not propagated correctly
* [x] another flavour of this was `id` not propagated correctly into the
`data-test-embeddable-id` attribute
* [x] Dispatch correctly the `render` events
* [x] refresh interval does not propagate thru the Lens custom component
in Discover (thanks to @jughosta to sort this out )
</details>

---------

Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
Co-authored-by: Marta Bondyra <marta.bondyra@elastic.co>
Co-authored-by: Bhavya RM <bhavya@elastic.co>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2024-11-26 09:34:13 +01:00
Kibana Machine
33f06c5a85 skip failing test suite (#201071) 2024-11-26 03:31:07 +11:00
Kibana Machine
a81a47404a skip failing test suite (#200748) 2024-11-26 03:30:55 +11:00
Davis McPhee
50236c4677
[Discover] [ES|QL] Fix ES|QL functional test MKI failure (#195150)
## Summary

This PR attempts to fix the MKI functional test failure from #188816.

Fixes #188816.

### 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/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
- [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
2024-11-22 00:49:58 -04:00
Julia Rechkunova
b9439e658d
[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries (#200583)
- Closes https://github.com/elastic/kibana/issues/199608

## Summary

This PR changes the logic around when suggestions from lens API are
used. Previously for non-transformational query and non-time-based data
it would try to render one of lens suggestions supplying chart data via
`table` prop. Now, it would not render any chart.

Before:
- Data view mode => Static histogram configuration
- ES|QL mode and non-transformational query => _**Gets lens
suggestions.**_ If histogram chart is not possible, **_takes the first
lens suggestion for rendering the chart_**
- ES|QL mode and transformational query => Gets lens suggestions. Takes
the first lens suggestion for rendering the chart.

After:
- Data view mode => Static histogram configuration (same)
- ES|QL mode and non-transformational query => ~~_**Gets lens
suggestions.**_~~ If histogram chart is not possible, **_renders
nothing_** (updated)
- ES|QL mode and transformational query => Gets lens suggestions. Takes
the first lens suggestion for rendering the chart. (same)

### Testing

As per originally reported case:
1. `node scripts/es_archiver
--kibana-url=http://elastic:changeme@localhost:5601
--es-url=http://elastic:changeme@localhost:9200 load
test/functional/fixtures/es_archiver/many_fields`

2. Navigate to Discover, switch to ES|QL mode and enter `FROM
indices-stats | LIMIT 10`
3. No chart is expected.

Also there should be no regression for
https://github.com/elastic/kibana/pull/195863

### 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: Davis McPhee <davis.mcphee@elastic.co>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2024-11-21 14:10:21 +01:00
Julia Rechkunova
6f0bda8843
[Discover] Unskip additional cell actions test (#201009)
- Closes https://github.com/elastic/kibana/issues/193367

### 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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
2024-11-21 14:09:57 +01:00
Julia Rechkunova
65cb53c28b
[Discover] Unskip ES|QL switch modal tests and fix other flaky tests in the same suite (#200923)
- Closes https://github.com/elastic/kibana/issues/189636
- Closes https://github.com/elastic/kibana/issues/200805
- Closes https://github.com/elastic/kibana/issues/195479

### 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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
2024-11-21 11:51:12 +01:00
Matthias Wilhelm
e082cd1dfa
[Discover] Unskip Discover-Lens functional test suite (#200687)
Catching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped.
2024-11-20 11:38:05 -06:00
Julia Rechkunova
b512ee4803
[Discover] Unskip get_render_app_wrapper test (#199456)
- Closes https://github.com/elastic/kibana/issues/199356
2024-11-20 10:19:24 +01:00
Kurt
ac0b0b4f05
Enabling Full FTR, Integration, and Unit tests to the FIPS Test Pipeline (#192632)
## Summary

Closes #192233 

Just in time for Thanksgiving - a full buffet of FIPS testing fixes

Usage of non-compliant algorithms manifest as runtime errors, so it is
imperative that we attempt to run all tests possible with Kibana in FIPS
mode. However, several overrides are needed to run Kibana in FIPS mode,
resulting in setup that make it impossible to run.

## In this PR

- Enable Unit tests for FIPS pipeline
- Enable Integration Tests for FIPS pipeline
- Enable Full FTR suite for FIPS pipeline (smoke test had originally run
a subset)
- Skip tests that break with overrides
- Fix/change tests to work in FIPS mode to maximize coverage
- Examine necessity of MD5 when installing from source (TBD based Ops PR
feed back, see self review below)
- Remove md5 from es_file_client options

## Latest Successful FIPS Test Run

https://buildkite.com/elastic/kibana-fips/builds/268

---------

Co-authored-by: Brad White <Ikuni17@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
2024-11-19 08:31:47 -05:00
Anton Dosov
45972374f0
[ES|QL] Starred queries in the editor (#198362)
## Summary

close https://github.com/elastic/kibana/issues/194165
close https://github.com/elastic/kibana-team/issues/1245

### User-facing

<img width="1680" alt="image"
src="https://github.com/user-attachments/assets/6df4ee9f-1b4d-404c-a764-592998a1d430">

This PRs adds a new tab in the editor history component. You can star
your query from the history and then you will see it in the Starred
list. The started queries are scoped to a user and a space.


### Server

To allow starring ESQL query, this PR extends [favorites
service](https://github.com/elastic/kibana/pull/189285) with ability to
store metadata in addition to an id. To make metadata strict and in
future to support proper metadata migrations if needed, metadata needs
to be defined as schema:

```
plugins.contentManagement.favorites.registerFavoriteType('esql_query', {
       typeMetadataSchema: schema.object({ query: schema.string(), timeRange:...., etc... }),
})
```

Notable changes: 

- Add support for registering a favorite type and a schema for favorite
type metadata. Previosly the `dashboard` type was the only supported
type and was hardcoded
- Add `favoriteMetadata` property to a saved object mapping and make it
`enabled:false` we don't want to index it, but just want to store
metadata in addition to an id.
[code](https://github.com/elastic/kibana/pull/198362/files#diff-d1a39e36f1de11a1110520d7607e6aee7d506c76626993842cb58db012b760a2R74-R87)
- Add a 100 favorite items limit (per type per space per user). Just do
it for sanity to prevent too large objects due to metadata stored in
addtion to ids.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Stratoula Kalafateli <stratoula1@gmail.com>
2024-11-18 21:53:46 +01:00
ruby
81919c3d77
[Console]: incorrect position of console tour #198389 (#198636) 2024-11-18 17:14:32 +00:00
Marco Liberati
5102b50489
[Visualize] Fix embeddable panel title behavior (#200548)
## Summary

This PR adds a fix for a regression bug introduced with the new
embeddable refactor in 8.16 .
I've added an extra 8.16 FTR test to ensure it works.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2024-11-18 16:33:30 +01:00
Sébastien Loix
020acbeaa3
[EuiInMemoryTable] Persist table rows per page and sort (#198297) 2024-11-18 07:35:26 -06:00
Ignacio Rivas
ebd3f0d69e
[Console] Avoid console url redirection (#199966) 2024-11-18 06:56:11 -06:00
Davis McPhee
bedc0d8ba6
[Discover] Only show logs profiles for O11y solution view (#199255)
## Summary

This PR updates the current logs data source profiles and log document
profile to only be active in the Observability solution view. It also
restructures some folders to conform to the solution folder conventions
in our docs. Lastly it restructures the functional tests so that the
logs profiles tests only run for Observability serverless projects, and
the core context awareness suite only tests example implementations.

### 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/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
- [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow 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>
2024-11-17 21:24:46 -04:00
Ignacio Rivas
0ed82309e2
[Console] Fix actions menu scrolling issue (#200018) 2024-11-17 05:44:07 -06:00
Robert Oskamp
79c5e844ff
Functional tests - remove .empty file from screenshots dir (#200161)
## Summary

This PR removes the `.empty` file from the `test/functional/screenshots`
directory as it's no longer needed.

### Details

The file has been introduced as part of #14122 when the directory was
cleaned. Since then, new base line screenshots have been added, so the
directory is no longer empty.
2024-11-14 15:46:28 +01:00
Ignacio Rivas
35c2a9e31e
[Console] Fix incorrect output message when status code is 200 and body is empty (#199975) 2024-11-14 09:27:31 +01:00
Quynh Nguyen (Quinn)
61cc4129a3
[ES|QL] Hide field statistics tab and Dashboard when ES|QL is in use, disable Index data visualizer for MATCH and QSRT functions (#197538)
## Summary

Part of https://github.com/elastic/kibana/issues/196995. This PR
disables field statistics tab and Dashboard embeddable when ES|QL is in
used. In Index data visualizer, it is disabled when MATCH & QSRT is in
used.

**1. Hide Discover's Field statistics tab:** 


https://github.com/user-attachments/assets/07cbf6ab-4e8f-4430-852a-2fe14269f26a


**2. ML's Index data visualizer:**

Message will popup and user will not be allowed to run query if it
contains `MATCH` or `QRST`



![image](https://github.com/user-attachments/assets/42251d13-8b49-4eee-a65c-e275a4a7312f)



**3. Dashboard:**

Hide the option to add panel and show unavailable for existing ES|QL
panel


<img width="1728" alt="Screenshot 2024-11-05 at 09 44 21"
src="https://github.com/user-attachments/assets/ef763c8d-cdd6-4ece-ae13-f45726e3ef16">

For existing dashboards and saved searches with ES|QL field statistics:

<img width="1209" alt="Screenshot 2024-11-06 at 12 00 10"
src="https://github.com/user-attachments/assets/3c423d01-42b1-48bc-994c-3340dee94bdc">




### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-12 12:38:04 -06:00
Marta Bondyra
13e9b9950a
[Lens] speed up functional test suite by setting the time picker via ui settings (#199479)
1. Speeds up functional test suite by setting the time picker via ui
settings
2. removes legacy tests from editor frame (replaced by adding some
conditions to drag_drop functional tests) as they were not the best
tests anyway
2024-11-12 17:40:47 +01:00
mohamedhamed-ahmed
73694426f9
[Discover] Breakdown support for fieldstats (#199028)
closes https://github.com/elastic/kibana/issues/192700

## 📝  Summary

This PR add a new `Add breakdown` button to the field stats popover for
all applicable fields.

## 🎥 Demo


https://github.com/user-attachments/assets/d647189c-9b04-4127-a4fd-f9764babe46e

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-12 14:26:36 +02:00
Nick Peihl
a227021302
[Dashboard] Public CRUD API MVP (#193067)
Closes #[192618](https://github.com/elastic/kibana/issues/192618)

Adds public CRUD+List endpoints for the Dashboards API. 

The schema for the endpoints are generated from Content Management
schemas so that the RPC and Public APIs use the same schemas for CRUD
operations. A new version (v3) has been added to the Dashboards content
management specification that decouples Content from Saved Objects using
a translation layer in Content Management. When retrieving a saved
object the Content Management layer parses and validates the panelJSON,
optionsListJSON, and savedSearchJSON properties against the defines
schema and passes the translated content to the consumer (user interface
or API).

When writing a saved object, the Content Management layer serializes
(`JSON.stringify`) the Content object into the saved object schema. So
the saved object schema continues to store as stringified JSON, but the
user interface and public API see and use the JSON objects.

These planned features are out of scope for this PR and may be added in
subsequent PRs.
1) https://github.com/elastic/kibana/issues/192758
2) https://github.com/elastic/kibana/issues/192622

Reviewers, please test both UI and endpoints. 

# cURL examples: 

First, `yarn start --no-base-path`. Assumes `elastic:changeme` is the
username:password.

## Create

<details>
<summary>Create an empty dashboard with the minimum required
properties</summary>

```
curl  -X POST \
  'http://localhost:5601/api/dashboards/dashboard' \
  --user elastic:changeme \
  --header 'Accept: */*' \
  --header 'elastic-api-version: 2023-10-31' \
  --header 'kbn-xsrf: true' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "attributes": { "title": "my empty dashboard" }
  }'
```

</details>

<details>
<summary>Create a dashboard of a specific ID with some ES|QL
panels</summary>


```
curl  -X POST \
  'http://localhost:5601/api/dashboards/dashboard/foo-123' \
  --user elastic:changeme \
  --header 'Accept: */*' \
  --header 'elastic-api-version: 2023-10-31' \
  --header 'kbn-xsrf: true' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "attributes": {
    "description": "",
    "panels": [
      {
        "panelConfig": {
          "attributes": {
            "references": [],
            "state": {
              "adHocDataViews": {
                "32eec79c9673ab1b9265f3e422e8f952778f02c82eaf13147a9c0ba86290337a": {
                  "allowHidden": false,
                  "allowNoIndex": false,
                  "fieldFormats": {},
                  "id": "32eec79c9673ab1b9265f3e422e8f952778f02c82eaf13147a9c0ba86290337a",
                  "name": "kibana_sample_data_ecommerce",
                  "runtimeFieldMap": {},
                  "sourceFilters": [],
                  "title": "kibana_sample_data_ecommerce",
                  "type": "esql"
                }
              },
              "datasourceStates": {
                "textBased": {
                  "indexPatternRefs": [
                    {
                      "id": "32eec79c9673ab1b9265f3e422e8f952778f02c82eaf13147a9c0ba86290337a",
                      "title": "kibana_sample_data_ecommerce"
                    }
                  ],
                  "layers": {
                    "44866844-8fca-482a-a769-006e7d029b9b": {
                      "columns": [
                        {
                          "columnId": "6376af5c-fdd1-4d72-a3ec-5686b5049664",
                          "fieldName": "customer_gender",
                          "meta": {
                            "esType": "keyword",
                            "type": "string"
                          }
                        },
                        {
                          "columnId": "a2e3e039-dff6-4893-9c9d-9f0a816207dd",
                          "fieldName": "taxless_total_price",
                          "meta": {
                            "esType": "double",
                            "type": "number"
                          }
                        }
                      ],
                      "index": "32eec79c9673ab1b9265f3e422e8f952778f02c82eaf13147a9c0ba86290337a",
                      "query": {
                        "esql": "FROM kibana_sample_data_ecommerce | LIMIT 100"
                      }
                    },
                    "781db49e-f4f1-42e0-975f-7118d2ef7a18": {
                      "columns": [],
                      "index": "32eec79c9673ab1b9265f3e422e8f952778f02c82eaf13147a9c0ba86290337a",
                      "query": {
                        "esql": "FROM kibana_sample_data_ecommerce | LIMIT 100"
                      }
                    }
                  }
                }
              },
              "filters": [],
              "query": {
                "esql": "FROM kibana_sample_data_ecommerce | LIMIT 100"
              },
              "visualization": {
                "layers": [
                  {
                    "categoryDisplay": "default",
                    "colorMapping": {
                      "assignments": [],
                      "colorMode": {
                        "type": "categorical"
                      },
                      "paletteId": "eui_amsterdam_color_blind",
                      "specialAssignments": [
                        {
                          "color": {
                            "type": "loop"
                          },
                          "rule": {
                            "type": "other"
                          },
                          "touched": false
                        }
                      ]
                    },
                    "layerId": "44866844-8fca-482a-a769-006e7d029b9b",
                    "layerType": "data",
                    "legendDisplay": "default",
                    "metrics": [
                      "a2e3e039-dff6-4893-9c9d-9f0a816207dd"
                    ],
                    "nestedLegend": false,
                    "numberDisplay": "percent",
                    "primaryGroups": [
                      "6376af5c-fdd1-4d72-a3ec-5686b5049664"
                    ]
                  }
                ],
                "shape": "pie"
              }
            },
            "title": "Table category & category.keyword & currency & customer_first_name & customer_first_name.keyword",
            "type": "lens",
            "visualizationType": "lnsPie"
          }
        },
        "gridData": {
          "h": 15,
          "w": 24,
          "x": 0,
          "y": 0
        },
        "type": "lens"
      },
      {
        "panelConfig": {
          "attributes": {
            "references": [],
            "state": {
              "adHocDataViews": {
                "e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a": {
                  "allowHidden": false,
                  "allowNoIndex": false,
                  "fieldFormats": {},
                  "id": "e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a",
                  "name": "kibana_sample_data_logs",
                  "runtimeFieldMap": {},
                  "sourceFilters": [],
                  "timeFieldName": "@timestamp",
                  "title": "kibana_sample_data_logs",
                  "type": "esql"
                }
              },
              "datasourceStates": {
                "textBased": {
                  "indexPatternRefs": [
                    {
                      "id": "e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a",
                      "timeField": "@timestamp",
                      "title": "kibana_sample_data_logs"
                    }
                  ],
                  "layers": {
                    "2e3f211d-289f-4a24-87bb-1ccacd678adb": {
                      "columns": [
                        {
                          "columnId": "AVG(machine.ram)",
                          "fieldName": "AVG(machine.ram)",
                          "inMetricDimension": true,
                          "meta": {
                            "esType": "double",
                            "type": "number"
                          }
                        },
                        {
                          "columnId": "machine.os.keyword",
                          "fieldName": "machine.os.keyword",
                          "meta": {
                            "esType": "keyword",
                            "type": "string"
                          }
                        }
                      ],
                      "index": "e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a",
                      "query": {
                        "esql": "FROM kibana_sample_data_logs| STATS AVG(machine.ram) BY machine.os.keyword "
                      },
                      "timeField": "@timestamp"
                    }
                  }
                }
              },
              "filters": [],
              "query": {
                "esql": "FROM kibana_sample_data_logs| STATS AVG(machine.ram) BY machine.os.keyword "
              },
              "visualization": {
                "axisTitlesVisibilitySettings": {
                  "x": true,
                  "yLeft": true,
                  "yRight": true
                },
                "fittingFunction": "None",
                "gridlinesVisibilitySettings": {
                  "x": true,
                  "yLeft": true,
                  "yRight": true
                },
                "labelsOrientation": {
                  "x": 0,
                  "yLeft": 0,
                  "yRight": 0
                },
                "layers": [
                  {
                    "accessors": [
                      "AVG(machine.ram)"
                    ],
                    "colorMapping": {
                      "assignments": [],
                      "colorMode": {
                        "type": "categorical"
                      },
                      "paletteId": "eui_amsterdam_color_blind",
                      "specialAssignments": [
                        {
                          "color": {
                            "type": "loop"
                          },
                          "rule": {
                            "type": "other"
                          },
                          "touched": false
                        }
                      ]
                    },
                    "layerId": "2e3f211d-289f-4a24-87bb-1ccacd678adb",
                    "layerType": "data",
                    "seriesType": "bar_stacked",
                    "xAccessor": "machine.os.keyword"
                  }
                ],
                "legend": {
                  "isVisible": true,
                  "position": "right"
                },
                "preferredSeriesType": "bar_stacked",
                "tickLabelsVisibilitySettings": {
                  "x": true,
                  "yLeft": true,
                  "yRight": true
                },
                "valueLabels": "hide"
              }
            },
            "title": "Bar vertical stacked",
            "type": "lens",
            "visualizationType": "lnsXY"
          }
        },
        "gridData": {
          "h": 15,
          "w": 24,
          "x": 24,
          "y": 0
        },
        "type": "lens"
      },
      {
        "panelConfig": {
          "attributes": {
            "references": [],
            "state": {
              "adHocDataViews": {
                "5d671714fc025d173ee40f0825b86d59b6e432344593b725be28f1f8f17a8a03": {
                  "allowHidden": false,
                  "allowNoIndex": false,
                  "fieldFormats": {},
                  "id": "5d671714fc025d173ee40f0825b86d59b6e432344593b725be28f1f8f17a8a03",
                  "name": "kibana_sample_data_flights",
                  "runtimeFieldMap": {},
                  "sourceFilters": [],
                  "title": "kibana_sample_data_flights",
                  "type": "esql"
                }
              },
              "datasourceStates": {
                "textBased": {
                  "indexPatternRefs": [
                    {
                      "id": "5d671714fc025d173ee40f0825b86d59b6e432344593b725be28f1f8f17a8a03",
                      "title": "kibana_sample_data_flights"
                    }
                  ],
                  "layers": {
                    "4451c40f-b3ef-464e-b3d4-b10469f65c2a": {
                      "columns": [
                        {
                          "columnId": "AvgDelayMins",
                          "fieldName": "AvgDelayMins",
                          "inMetricDimension": true,
                          "meta": {
                            "esType": "double",
                            "type": "number"
                          }
                        },
                        {
                          "columnId": "Carrier",
                          "fieldName": "Carrier",
                          "meta": {
                            "esType": "keyword",
                            "type": "string"
                          }
                        }
                      ],
                      "index": "5d671714fc025d173ee40f0825b86d59b6e432344593b725be28f1f8f17a8a03",
                      "query": {
                        "esql": "FROM kibana_sample_data_flights| STATS AvgDelayMins = AVG(FlightDelayMin) BY Carrier "
                      }
                    }
                  }
                }
              },
              "filters": [],
              "query": {
                "esql": "FROM kibana_sample_data_flights| STATS AvgDelayMins = AVG(FlightDelayMin) BY Carrier "
              },
              "visualization": {
                "breakdownByAccessor": "Carrier",
                "layerId": "4451c40f-b3ef-464e-b3d4-b10469f65c2a",
                "layerType": "data",
                "metricAccessor": "AvgDelayMins",
                "palette": {
                  "name": "status",
                  "params": {
                    "colorStops": [],
                    "continuity": "all",
                    "maxSteps": 5,
                    "name": "status",
                    "progression": "fixed",
                    "rangeMax": 100,
                    "rangeMin": 0,
                    "rangeType": "percent",
                    "reverse": false,
                    "steps": 3,
                    "stops": [
                      {
                        "color": "#209280",
                        "stop": 33.33
                      },
                      {
                        "color": "#d6bf57",
                        "stop": 66.66
                      },
                      {
                        "color": "#cc5642",
                        "stop": 100
                      }
                    ]
                  },
                  "type": "palette"
                }
              }
            },
            "title": "Bar vertical stacked",
            "type": "lens",
            "visualizationType": "lnsMetric"
          }
        },
        "gridData": {
          "h": 15,
          "w": 24,
          "x": 0,
          "y": 15
        },
        "type": "lens"
      }
    ],
    "timeRestore": false,
    "title": "several es|ql panels",
    "version": 3
  }
}'
```
</details>

<details>
<summary>Create a dashboard with a Links panel</summary>


```
curl  -X POST \
  'http://localhost:5601/api/dashboards/dashboard' \
  --user elastic:changeme \
  --header 'Accept: */*' \
  --header 'elastic-api-version: 2023-10-31' \
  --header 'kbn-xsrf: true' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "attributes": {
    "panels": [
      {
        "panelConfig": {
          "attributes": {
            "layout": "vertical",
            "links": [
              {
                "destinationRefName": "link_1981a00f-8120-4c80-b37f-ed38969afe09_dashboard",
                "id": "1981a00f-8120-4c80-b37f-ed38969afe09",
                "order": 0,
                "type": "dashboardLink"
              },
              {
                "destinationRefName": "link_f2e1a75c-fbca-4f41-a290-d5d89a60a797_dashboard",
                "id": "f2e1a75c-fbca-4f41-a290-d5d89a60a797",
                "order": 1,
                "type": "dashboardLink"
              },
              {
                "destination": "https://example.com",
                "id": "63342ea6-f686-42b2-a526-ec0bcf4476b0",
                "order": 2,
                "type": "externalLink"
              }
            ]
          },
          "enhancements": {},
          "id": "abbbaedc-62f5-46ee-9d17-8367dcf4f52b"
        },
        "gridData": {
          "h": 7,
          "i": "abbbaedc-62f5-46ee-9d17-8367dcf4f52b",
          "w": 8,
          "x": 0,
          "y": 0
        },
        "panelIndex": "abbbaedc-62f5-46ee-9d17-8367dcf4f52b",
        "type": "links"
      }
    ],
    "timeRestore": false,
    "title": "a links panel",
    "version": 3
  },
  "references": [
    {
      "id": "722b74f0-b882-11e8-a6d9-e546fe2bba5f",
      "name": "abbbaedc-62f5-46ee-9d17-8367dcf4f52b:link_1981a00f-8120-4c80-b37f-ed38969afe09_dashboard",
      "type": "dashboard"
    },
    {
      "id": "edf84fe0-e1a0-11e7-b6d5-4dc382ef7f5b",
      "name": "abbbaedc-62f5-46ee-9d17-8367dcf4f52b:link_f2e1a75c-fbca-4f41-a290-d5d89a60a797_dashboard",
      "type": "dashboard"
    }
  ]
}'
```
</details>

<details>
<summary>Create a dashboard with a Maps panel</summary>


```
curl  -X POST \
  'http://localhost:5601/api/dashboards/dashboard' \
  --user elastic:changeme \
  --header 'Accept: */*' \
  --header 'elastic-api-version: 2023-10-31' \
  --header 'kbn-xsrf: true' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "attributes": {
    "panels": [
      {
        "panelConfig": {
          "attributes": {
            "description": "",
            "layerListJSON": "[{\"locale\":\"autoselect\",\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"isAutoSelect\":true,\"lightModeDefault\":\"road_map_desaturated\"},\"id\":\"db63eee8-3dfc-48c6-8c8b-7f2c4e32329d\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":1,\"visible\":true,\"style\":{\"type\":\"EMS_VECTOR_TILE\",\"color\":\"\"},\"includeInFitToBounds\":true,\"type\":\"EMS_VECTOR_TILE\"},{\"sourceDescriptor\":{\"geoField\":\"geoip.location\",\"scalingType\":\"MVT\",\"id\":\"9ee192e4-18f0-41b2-b8b7-89eb91d0e529\",\"type\":\"ES_SEARCH\",\"applyGlobalQuery\":true,\"applyGlobalTime\":true,\"applyForceRefresh\":true,\"filterByMapBounds\":true,\"tooltipProperties\":[],\"sortField\":\"\",\"sortOrder\":\"desc\",\"topHitsGroupByTimeseries\":false,\"topHitsSplitField\":\"\",\"topHitsSize\":1,\"indexPatternRefName\":\"layer_1_source_index_pattern\"},\"id\":\"65710bbc-f41c-4fe7-b0c3-a6dbc0613220\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}},\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"color\":\"Blues\",\"colorCategory\":\"palette_0\",\"field\":{\"name\":\"category.keyword\",\"origin\":\"source\"},\"fieldMetaOptions\":{\"isEnabled\":true,\"sigma\":3},\"type\":\"CATEGORICAL\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#41937c\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":0}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":6}},\"iconOrientation\":{\"type\":\"STATIC\",\"options\":{\"orientation\":0}},\"labelText\":{\"type\":\"STATIC\",\"options\":{\"value\":\"\"}},\"labelColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000000\"}},\"labelSize\":{\"type\":\"STATIC\",\"options\":{\"size\":14}},\"labelZoomRange\":{\"options\":{\"useLayerZoomRange\":true,\"minZoom\":0,\"maxZoom\":24}},\"labelBorderColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"labelBorderSize\":{\"options\":{\"size\":\"SMALL\"}},\"labelPosition\":{\"options\":{\"position\":\"CENTER\"}}},\"isTimeAware\":true},\"includeInFitToBounds\":true,\"type\":\"MVT_VECTOR\",\"joins\":[],\"disableTooltips\":false}]",
            "mapStateJSON": "{\"adHocDataViews\":[],\"zoom\":1.57,\"center\":{\"lon\":0,\"lat\":19.94277},\"timeFilters\":{\"from\":\"now-7d\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":true,\"interval\":60000},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[{\"meta\":{\"disabled\":false,\"negate\":false,\"alias\":\"males only\",\"index\":\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\",\"key\":\"customer_gender\",\"field\":\"customer_gender\",\"params\":{\"query\":\"MALE\"},\"type\":\"phrase\"},\"query\":{\"match_phrase\":{\"customer_gender\":\"MALE\"}},\"$state\":{\"store\":\"appState\"}}],\"settings\":{\"autoFitToDataBounds\":false,\"backgroundColor\":\"#ffffff\",\"customIcons\":[],\"disableInteractive\":false,\"disableTooltipControl\":false,\"hideToolbarOverlay\":false,\"hideLayerControl\":false,\"hideViewControl\":false,\"initialLocation\":\"LAST_SAVED_LOCATION\",\"fixedLocation\":{\"lat\":0,\"lon\":0,\"zoom\":2},\"browserLocation\":{\"zoom\":2},\"keydownScrollZoom\":false,\"maxZoom\":24,\"minZoom\":0,\"showScaleControl\":false,\"showSpatialFilters\":true,\"showTimesliderToggleButton\":true,\"spatialFiltersAlpa\":0.3,\"spatialFiltersFillColor\":\"#DA8B45\",\"spatialFiltersLineColor\":\"#DA8B45\"}}",
            "title": "",
            "uiStateJSON": "{\"isLayerTOCOpen\":true,\"openTOCDetails\":[\"65710bbc-f41c-4fe7-b0c3-a6dbc0613220\"]}"
          },
          "enhancements": {
            "dynamicActions": {
              "events": []
            }
          },
          "hiddenLayers": [],
          "id": "108b2f72-0101-4e09-b8a9-22f7aa9573b0",
          "isLayerTOCOpen": false,
          "mapBuffer": {
            "maxLat": 85.05113,
            "maxLon": 180,
            "minLat": -66.51326,
            "minLon": -180
          },
          "mapCenter": {
            "lat": 19.94277,
            "lon": 0,
            "zoom": 1.57
          },
          "openTOCDetails": [
            "65710bbc-f41c-4fe7-b0c3-a6dbc0613220"
          ]
        },
        "gridData": {
          "h": 25,
          "i": "108b2f72-0101-4e09-b8a9-22f7aa9573b0",
          "w": 38,
          "x": 0,
          "y": 0
        },
        "panelIndex": "108b2f72-0101-4e09-b8a9-22f7aa9573b0",
        "type": "map"
      }
    ],
    "timeRestore": false,
    "title": "a maps panel",
    "version": 3
  },
  "references": [
    {
      "type": "tag",
      "id": "662b28f2-71e4-4c04-b4e5-0c6249b1c08a",
      "name": "tag-ref-662b28f2-71e4-4c04-b4e5-0c6249b1c08a"
    },
    {
      "name": "108b2f72-0101-4e09-b8a9-22f7aa9573b0:layer_1_source_index_pattern",
      "type": "index-pattern",
      "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f"
    }
  ]
}'
```

</details>

<details>
<summary>Create a dashboard with a Filter pill and a Field statistics
panel</summary>


```
curl  -X POST \
  'http://localhost:5601/api/dashboards/dashboard' \
  --user elastic:changeme \
  --header 'Accept: */*' \
  --header 'elastic-api-version: 2023-10-31' \
  --header 'kbn-xsrf: true' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "attributes": {
    "description": "",
    "kibanaSavedObjectMeta": {
      "searchSource": {
        "filter": [
          {
            "$state": {
              "store": "appState"
            },
            "meta": {
              "alias": "gnomehouse",
              "disabled": false,
              "field": "products.manufacturer.keyword",
              "indexRefName": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index",
              "key": "products.manufacturer.keyword",
              "negate": false,
              "params": [
                "Gnomehouse",
                "Gnomehouse mom"
              ],
              "type": "phrases"
            },
            "query": {
              "bool": {
                "minimum_should_match": 1,
                "should": [
                  {
                    "match_phrase": {
                      "products.manufacturer.keyword": "Gnomehouse"
                    }
                  },
                  {
                    "match_phrase": {
                      "products.manufacturer.keyword": "Gnomehouse mom"
                    }
                  }
                ]
              }
            }
          }
        ],
        "query": {
          "language": "kuery",
          "query": ""
        }
      }
    },
    "panels": [
      {
        "panelConfig": {
          "dataViewId": "32eec79c9673ab1b9265f3e422e8f952778f02c82eaf13147a9c0ba86290337a",
          "enhancements": {},
          "id": "3c9dee70-4a01-4c2f-9ccd-0c2812e2a5d4",
          "query": {
            "esql": "from kibana_sample_data_ecommerce | limit 10"
          },
          "viewType": "esql"
        },
        "gridData": {
          "h": 18,
          "i": "3c9dee70-4a01-4c2f-9ccd-0c2812e2a5d4",
          "w": 48,
          "x": 0,
          "y": 0
        },
        "panelIndex": "3c9dee70-4a01-4c2f-9ccd-0c2812e2a5d4",
        "type": "field_stats_table"
      }
    ],
    "timeRestore": false,
    "title": "field stats panel",
    "version": 2
  },
  "references": [
    {
      "id": "32eec79c9673ab1b9265f3e422e8f952778f02c82eaf13147a9c0ba86290337a",
      "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index",
      "type": "index-pattern"
    },
    {
      "id": "662b28f2-71e4-4c04-b4e5-0c6249b1c08a",
      "name": "tag-ref-662b28f2-71e4-4c04-b4e5-0c6249b1c08a",
      "type": "tag"
    },
    {
      "id": "32eec79c9673ab1b9265f3e422e8f952778f02c82eaf13147a9c0ba86290337a",
      "name": "3c9dee70-4a01-4c2f-9ccd-0c2812e2a5d4:fieldStatsTableDataViewId",
      "type": "index-pattern"
    }
  ]
}'
```
</details>

<details>
<summary>Create a dashboard with a Lens panel</summary>

```
curl  -X POST \
  'http://localhost:5601/api/dashboards/dashboard/' \
  --user elastic:changeme \
  --header 'Accept: */*' \
  --header 'elastic-api-version: 2023-10-31' \
  --header 'kbn-xsrf: true' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "attributes": {
    "title": "a lens panel",
    "kibanaSavedObjectMeta": {
      "searchSource": {}
    },
    "timeRestore": false,
    "panels": [
      {
        "panelConfig": {
          "attributes": {
            "title": "",
            "visualizationType": "lnsDatatable",
            "type": "lens",
            "references": [
              {
                "type": "index-pattern",
                "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d",
                "name": "indexpattern-datasource-layer-b9789655-f916-4732-9bf2-641a88075210"
              }
            ],
            "state": {
              "visualization": {
                "layerId": "b9789655-f916-4732-9bf2-641a88075210",
                "layerType": "data",
                "columns": [
                  {
                    "isTransposed": false,
                    "columnId": "4175e737-76b9-46db-894b-57106a06b9cb"
                  },
                  {
                    "isTransposed": false,
                    "columnId": "1494f183-3bfa-4602-a780-6a41624f6c69"
                  },
                  {
                    "isTransposed": false,
                    "columnId": "8eb92ea9-5b76-45a2-865e-d78511c1e506"
                  }
                ]
              },
              "query": {
                "query": "",
                "language": "kuery"
              },
              "filters": [],
              "datasourceStates": {
                "formBased": {
                  "layers": {
                    "b9789655-f916-4732-9bf2-641a88075210": {
                      "columns": {
                        "4175e737-76b9-46db-894b-57106a06b9cb": {
                          "label": "Top 5 values of Carrier",
                          "dataType": "string",
                          "operationType": "terms",
                          "scale": "ordinal",
                          "sourceField": "Carrier",
                          "isBucketed": true,
                          "params": {
                            "size": 5,
                            "orderBy": {
                              "type": "column",
                              "columnId": "1494f183-3bfa-4602-a780-6a41624f6c69"
                            },
                            "orderDirection": "desc",
                            "otherBucket": true,
                            "missingBucket": false,
                            "parentFormat": {
                              "id": "terms"
                            },
                            "include": [],
                            "exclude": [],
                            "includeIsRegex": false,
                            "excludeIsRegex": false
                          }
                        },
                        "1494f183-3bfa-4602-a780-6a41624f6c69": {
                          "label": "Count of records",
                          "dataType": "number",
                          "operationType": "count",
                          "isBucketed": false,
                          "scale": "ratio",
                          "sourceField": "___records___",
                          "params": {
                            "emptyAsNull": true
                          }
                        },
                        "8eb92ea9-5b76-45a2-865e-d78511c1e506": {
                          "label": "Median of AvgTicketPrice",
                          "dataType": "number",
                          "operationType": "median",
                          "sourceField": "AvgTicketPrice",
                          "isBucketed": false,
                          "scale": "ratio",
                          "params": {
                            "emptyAsNull": true
                          }
                        }
                      },
                      "columnOrder": [
                        "4175e737-76b9-46db-894b-57106a06b9cb",
                        "1494f183-3bfa-4602-a780-6a41624f6c69",
                        "8eb92ea9-5b76-45a2-865e-d78511c1e506"
                      ],
                      "incompleteColumns": {},
                      "sampling": 1
                    }
                  }
                },
                "indexpattern": {
                  "layers": {}
                },
                "textBased": {
                  "layers": {}
                }
              },
              "internalReferences": [],
              "adHocDataViews": {}
            }
          },
          "enhancements": {}
        },
        "gridData": {
          "x": 0,
          "y": 0,
          "w": 24,
          "h": 15
        },
        "type": "lens"
      }
    ],
    "options": {
      "hidePanelTitles": false,
      "useMargins": true,
      "syncColors": false,
      "syncTooltips": true,
      "syncCursor": true
    },
    "version": 3
  },
  "references": [
    {
      "type": "index-pattern",
      "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d",
      "name": "indexpattern-datasource-layer-b9789655-f916-4732-9bf2-641a88075210"
    }
  ]
}'
```

</details>


<details>
<summary>Create a dashboard in a specific Space</summary>

```
curl  -X POST \
  'http://localhost:5601/s/space-1/api/dashboards/dashboard/' \
  --user elastic:changeme \
  --header 'Accept: */*' \
  --header 'elastic-api-version: 2023-10-31' \
  --header 'kbn-xsrf: true' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "attributes": {
  "title": "my other demo dashboard",
  "kibanaSavedObjectMeta": {
    "searchSource": {}
  },
  "timeRestore": false,
  "panels": [
    {
      "panelConfig": {
        "savedVis": {
          "description": "",
          "type": "markdown",
          "params": {
            "fontSize": 12,
            "openLinksInNewTab": false,
            "markdown": "## Sample eCommerce Data\nThis dashboard contains sample data for you to play with. You can view it, search it, and interact with the visualizations. For more information about Kibana, check our [docs](https://www.elastic.co/guide/en/kibana/current/index.html)."
          },
          "uiState": {},
          "data": {
            "aggs": [],
            "searchSource": {
              "query": {
                "query": "",
                "language": "kuery"
              },
              "filter": []
            }
          }
        },
        "enhancements": {}
      },
      "gridData": {
        "x": 0,
        "y": 0,
        "w": 24,
        "h": 15,
        "i": "1"
      },
      "type": "visualization",
      "version": "7.9.2"
    }
  ],
  "options": {
    "hidePanelTitles": false,
    "useMargins": true,
    "syncColors": false,
    "syncTooltips": true,
    "syncCursor": true
  },
  "version": 3
  },
  "references": [],
  "spaces": ["space-1"]
}'
```

</details>

## Update

<details>
<summary>Update an existing dashboard</summary>

```
curl  -X PUT \
  'http://localhost:5601/api/dashboards/dashboard/foo-123' \
  --user elastic:changeme \
  --header 'Accept: */*' \
  --header 'elastic-api-version: 2023-10-31' \
  --header 'kbn-xsrf: true' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "attributes": {
    "title": "my demo dashboard",
    "kibanaSavedObjectMeta": {
      "searchSource": {}
    },
    "timeRestore": false,
    "panels": [
      {
        "panelConfig": {
          "savedVis": {
            "description": "",
            "type": "markdown",
            "params": {
              "fontSize": 12,
              "openLinksInNewTab": false,
              "markdown": "## Sample eCommerce Data\nThis dashboard contains sample data for you to play with. You can view it, search it, and interact with the visualizations. For more information about Kibana, check our [docs](https://www.elastic.co/guide/en/kibana/current/index.html).\nWubba lubba dub-dub!"
            },
            "uiState": {},
            "data": {
              "aggs": [],
              "searchSource": {
                "query": {
                  "query": "",
                  "language": "kuery"
                },
                "filter": []
              }
            }
          },
          "enhancements": {}
        },
        "gridData": {
          "x": 0,
          "y": 0,
          "w": 24,
          "h": 15
        },
        "type": "visualization"
      }
    ],
    "version": 3
  },
  "references": []
}'
```

</details>

## Get / List

<details>
<summary>Get a dashboard</summary>

```
curl  -X GET \
  'http://localhost:5601/api/dashboards/dashboard/foo-123' \
    --user elastic:changeme \
  --header 'Accept: */*' \
  --header 'elastic-api-version: 2023-10-31' 
```
</details>

<details>
<summary>Get a paginated list of dashboards</summary>


```
curl  -X GET \
  'http://localhost:5601/api/dashboards/dashboard' \
  --user elastic:changeme \
  --header 'Accept: */*' \
  --header 'elastic-api-version: 2023-10-31' 
```
</details>

## Delete
<details>
<summary>Delete a dashboard</summary>

```
curl  -X DELETE \
  'http://localhost:5601/api/dashboards/dashboard/foo-123' \
  --user elastic:changeme \
  --header 'Accept: */*' \
  --header 'elastic-api-version: 2023-10-31' \
  --header 'kbn-xsrf: true' 
```

</details>

## Open API specification

<details>
<summary>Retrieve the Open API specification</summary>

```
curl  -X GET \
  'http://localhost:5601/api/oas?pathStartsWith=%2Fapi%2Fdashboard' \
  --user elastic:changeme \
  --header 'Accept: */*' 
```

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-08 11:35:13 -05:00
Julia Rechkunova
e883ac5470
[Discover] Remove field popover stats for ES|QL mode (#198948)
- Related to https://github.com/elastic/kibana/pull/197538

## Summary

This PR removes the support of showing stats in the field popover in
ES|QL mode as this UX will be revisited in the future to provide better
results.


### 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>
2024-11-08 05:04:47 -06:00
Marta Bondyra
2ba6560d0d
[Visualize] remove never executing functional tests code (#198512)
## Summary

Removes the code that goes through the condition if the vis comes from
new or legacy library. Pie charts or xy charts don't use vislib
implementation anymore, so the condition will always give the same
result.
2024-11-08 10:00:36 +01:00
Tiago Costa
1e3844619c
skip flaky suite (#198109) 2024-11-07 19:38:54 +00:00
Tiago Costa
777722b38d
skip flaky suite (#184600) 2024-11-07 19:36:55 +00:00
Rachel Shen
4f14c4af41
[Dashboard] Remove modal for inter app from dashboard (#198619)
## Summary

Closes https://github.com/elastic/kibana/issues/184257
This PR removes the modal warning users that unsaved changes would be
lost when navigating away from dashboard to other apps within Kibana.
The modal is not necessary since unsaved changes are saved in session
storage. The benefit is that this removes the unnecessary click for
users.


This does not impact the modal for switching to view mode from edit mode
with unsaved changes as shown below.



https://github.com/user-attachments/assets/c5bdb0ec-b040-40b0-a511-fd16ad084b90


### Checklist

 - [x] Update tests
2024-11-06 15:33:25 -06:00
Matthias Wilhelm
08b83c55f6
[Discover] Fix loading data views in ES|QL mode (#199099)
- Closes https://github.com/elastic/kibana/issues/199065

## Summary

This PR makes sure that data views are loaded so user can view them
after switching from ES|QL mode to data view mode.

Looks like it was introduced in
https://github.com/elastic/kibana/pull/195670

### Testing

On your local instance having `kibana_sample_data_logs` installed

* Open a link to an ES|QL query
[link](http://localhost:5601/xot/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:now-15m,to:now))&_a=(columns:!(),dataSource:(dataViewId:e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a,type:dataView),filters:!(),interval:auto,query:(language:kuery,query:''),sort:!(!(timestamp,desc))))
* Switch to classic
* Open the DataView Picker, to see a list of DataViews, before this fix
there were none

### 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: Julia Rechkunova <julia.rechkunova@gmail.com>
2024-11-06 14:13:33 -04:00
Davis McPhee
bdbfd03213
[Discover] Add support for custom profile context object (#198637)
## Summary

This PR adds support for customizing the context object returned by a
profile provider's `resolve` method, and accessing it within extension
point implementations. The primary use case for this functionality is
passing custom dependencies, or async initializing services, e.g.
initializing a custom state store and passing it to a context provider
in `getRenderAppWrapper`.

Flaky test runs:
- x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7343

### 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/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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2024-11-06 13:44:27 -04:00
Julia Rechkunova
c1e00a8871
[Discover] Show the fetched Discover results even when histogram request fails on some shards (#198553)
- Closes https://github.com/elastic/kibana/issues/198496

## Summary

This PR fixes an issue when the histogram request returns only a partial
result (0 or greater than 0) by adding a warning icon next to the total
hits counter and not blocking the whole page with "No results" message
(when partial result with 0 hits from histogram).

<img width="1436" alt="Screenshot 2024-10-31 at 15 45 17"
src="https://github.com/user-attachments/assets/9a769fe6-bdcf-4d20-ae6e-698a5b08d76f">

### Testing

Execute the following and open `example*` data view in Discover.

```
PUT example1
PUT example1/_mapping
{
  "properties": {
    "message": {
      "type": "text"
    },
    "date": {
      "type": "date"
    }
  }
}
PUT example1/_doc/11
{
    "message": "11",
    "date": "2024-11-11T12:10:30Z"
}
PUT example1/_doc/12
{
    "message": "22",
    "date": "2024-11-12T12:10:30Z"
}

PUT example2
PUT example2/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    },
    "date": {
      "type": "date"
    }
  }
}
PUT example2/_doc/21
{
    "message": "21",
    "date": "2024-12-01T12:10:30Z"
}
PUT example2/_doc/22
{
    "message": "22",
    "date": "2024-12-02T12:10:30Z"
}
```

Then add `message` as a breakdown field.

Notice that the histogram gets some partial results:
<img width="1563" alt="Screenshot 2024-10-31 at 16 11 14"
src="https://github.com/user-attachments/assets/8a53f661-38a2-48f8-b082-823de77ac4f2">

Now, add a filter for `_id: 11` and notice that the histogram request
has no results (it partially failed on some shards) but Discover still
renders the table:
<img width="1564" alt="Screenshot 2024-10-31 at 16 11 31"
src="https://github.com/user-attachments/assets/e154ab5d-c5d4-4703-abd4-7bf3cd7a15fb">


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

---------

Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
2024-11-06 06:45:01 -06:00
Julia Rechkunova
436405fefb
[Discover][UnifiedDataTable] Enable drag&drop for grid columns (#197832)
- Closes https://github.com/elastic/kibana/issues/195769

## Summary

Eui now supports reordering of grid columns by dra&drop
https://github.com/elastic/eui/pull/8015
The PR enables this functionality for UnifiedDataTable.

![Nov-01-2024
10-21-49](https://github.com/user-attachments/assets/bc47507c-7b9e-44c2-88d7-5f48f37924cb)


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2024-11-06 06:00:49 -06:00
Davis McPhee
4a95eec82f
[Discover] Add getRenderAppWrapper extension (#197556)
## Summary

This PR adds a `getRenderAppWrapper` extension to Discover to support
advanced state management use cases. It also includes new documentation
for the extension point, and overriding default profile implementations:


https://github.com/user-attachments/assets/70633cbb-1cfe-47fe-984e-ba8afb18fc90

To test, add the following config to `kibana.dev.yml`:
```yml
discover.experimental.enabledProfiles:
  [
    'example-root-profile',
    'example-solution-view-root-profile',
    'example-data-source-profile',
    'example-document-profile',
  ]
```

Then ingest demo logs and run this in dev tools:
```
POST _aliases
{
  "actions": [
    {
      "add": {
        "index": "kibana_sample_data_logs",
        "alias": "my-example-logs"
      }
    }
  ]
}
```

Flaky test runs:
- 🔴 x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7238
- 🔴 x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7289
- 🟢 x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7291
- x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7303

### 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/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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
2024-11-05 20:48:33 -04:00