Commit graph

1054 commits

Author SHA1 Message Date
Kibana Machine
7d33d5a8e6
[8.11] [fix] Using max_result_window to set up MVT size request leads to not showing all results (#171344) (#171440)
# Backport

This will backport the following commits from `main` to `8.11`:
- [[fix] Using max_result_window to set up MVT size request leads to not
showing all results
(#171344)](https://github.com/elastic/kibana/pull/171344)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2023-11-16T19:11:13Z","message":"[fix]
Using max_result_window to set up MVT size request leads to not showing
all results (#171344)\n\nCloses
https://github.com/elastic/kibana/issues/170272\r\n\r\nThe cause of the
problem is that Maps is not
setting\r\n[_mvt](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-vector-tile-api.html)\r\n`size`
parameter.\r\n\r\nLets illustrate the problem with an example.\r\n*
index.max_result_window is set to 20,000.\r\n* There are 15,000 hits
matching the query for the tile, but because\r\n`size` is not provided,
the tile returns the default size value of\r\n10,000 hits.\r\n* Tile
request sets `track_total_hits` to 20,001. Tile meta
returns\r\n`\"hits.total.relation\": \"eq\"` and `\"hits.total.value\":
15000`\r\nproperties, indicating that all possible hits are returned in
the tile.\r\n* Maps UI does not display \"incomplete results\" even
though 5000 hits\r\nare not contained in the tile.\r\n* This happens
because `hits.total` properties from tile meta is used to\r\nindicate
\"incomplete results\" and the returned value indicates that
all\r\nresults are contained in the tile. We know this is not true
because the\r\ntile actually only returned 10,000 hits and not all
15,000 matching\r\nhits. Thus, without setting `size`, the tile is not
returning all of the\r\nhits indicated by `track_total_hits`.\r\n\r\n###
test instructions\r\n1. install web logs sample data set\r\n2. In dev
tools, run the following\r\n ```\r\n POST
kibana_sample_data_logs/_doc/\r\n {\r\n \"geo\": {\r\n \"coordinates\":
\"59,-106.5\"\r\n },\r\n \"@timestamp\": \"2023-08-01\"\r\n }\r\n\r\n
PUT /kibana_sample_data_logs/_settings\r\n {\r\n \"index\" : {\r\n
\"max_result_window\" : 20000\r\n }\r\n }\r\n ```\r\n3. Create new
map\r\n4. Set time range to `1 year ago to 1 year from now` to display
all web\r\nlogs data\r\n5. add documents layer. Verify point circled in
image is displayed.\r\nWithout changes, this point would not be returned
in the tile because\r\nthe tile would only return the first 10000
matches.\r\n<img width=\"500\" alt=\"Screenshot 2023-11-15 at 11 31 25
AM\"\r\nsrc=\"2249d571-24c4-41ad-975e-d44ee6d246ce\">","sha":"95a8d6a18f4f6e93ede4efdaaca880fc94378fb1","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","Feature:Maps","v8.12.0","v8.11.2"],"number":171344,"url":"https://github.com/elastic/kibana/pull/171344","mergeCommit":{"message":"[fix]
Using max_result_window to set up MVT size request leads to not showing
all results (#171344)\n\nCloses
https://github.com/elastic/kibana/issues/170272\r\n\r\nThe cause of the
problem is that Maps is not
setting\r\n[_mvt](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-vector-tile-api.html)\r\n`size`
parameter.\r\n\r\nLets illustrate the problem with an example.\r\n*
index.max_result_window is set to 20,000.\r\n* There are 15,000 hits
matching the query for the tile, but because\r\n`size` is not provided,
the tile returns the default size value of\r\n10,000 hits.\r\n* Tile
request sets `track_total_hits` to 20,001. Tile meta
returns\r\n`\"hits.total.relation\": \"eq\"` and `\"hits.total.value\":
15000`\r\nproperties, indicating that all possible hits are returned in
the tile.\r\n* Maps UI does not display \"incomplete results\" even
though 5000 hits\r\nare not contained in the tile.\r\n* This happens
because `hits.total` properties from tile meta is used to\r\nindicate
\"incomplete results\" and the returned value indicates that
all\r\nresults are contained in the tile. We know this is not true
because the\r\ntile actually only returned 10,000 hits and not all
15,000 matching\r\nhits. Thus, without setting `size`, the tile is not
returning all of the\r\nhits indicated by `track_total_hits`.\r\n\r\n###
test instructions\r\n1. install web logs sample data set\r\n2. In dev
tools, run the following\r\n ```\r\n POST
kibana_sample_data_logs/_doc/\r\n {\r\n \"geo\": {\r\n \"coordinates\":
\"59,-106.5\"\r\n },\r\n \"@timestamp\": \"2023-08-01\"\r\n }\r\n\r\n
PUT /kibana_sample_data_logs/_settings\r\n {\r\n \"index\" : {\r\n
\"max_result_window\" : 20000\r\n }\r\n }\r\n ```\r\n3. Create new
map\r\n4. Set time range to `1 year ago to 1 year from now` to display
all web\r\nlogs data\r\n5. add documents layer. Verify point circled in
image is displayed.\r\nWithout changes, this point would not be returned
in the tile because\r\nthe tile would only return the first 10000
matches.\r\n<img width=\"500\" alt=\"Screenshot 2023-11-15 at 11 31 25
AM\"\r\nsrc=\"2249d571-24c4-41ad-975e-d44ee6d246ce\">","sha":"95a8d6a18f4f6e93ede4efdaaca880fc94378fb1"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/171344","number":171344,"mergeCommit":{"message":"[fix]
Using max_result_window to set up MVT size request leads to not showing
all results (#171344)\n\nCloses
https://github.com/elastic/kibana/issues/170272\r\n\r\nThe cause of the
problem is that Maps is not
setting\r\n[_mvt](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-vector-tile-api.html)\r\n`size`
parameter.\r\n\r\nLets illustrate the problem with an example.\r\n*
index.max_result_window is set to 20,000.\r\n* There are 15,000 hits
matching the query for the tile, but because\r\n`size` is not provided,
the tile returns the default size value of\r\n10,000 hits.\r\n* Tile
request sets `track_total_hits` to 20,001. Tile meta
returns\r\n`\"hits.total.relation\": \"eq\"` and `\"hits.total.value\":
15000`\r\nproperties, indicating that all possible hits are returned in
the tile.\r\n* Maps UI does not display \"incomplete results\" even
though 5000 hits\r\nare not contained in the tile.\r\n* This happens
because `hits.total` properties from tile meta is used to\r\nindicate
\"incomplete results\" and the returned value indicates that
all\r\nresults are contained in the tile. We know this is not true
because the\r\ntile actually only returned 10,000 hits and not all
15,000 matching\r\nhits. Thus, without setting `size`, the tile is not
returning all of the\r\nhits indicated by `track_total_hits`.\r\n\r\n###
test instructions\r\n1. install web logs sample data set\r\n2. In dev
tools, run the following\r\n ```\r\n POST
kibana_sample_data_logs/_doc/\r\n {\r\n \"geo\": {\r\n \"coordinates\":
\"59,-106.5\"\r\n },\r\n \"@timestamp\": \"2023-08-01\"\r\n }\r\n\r\n
PUT /kibana_sample_data_logs/_settings\r\n {\r\n \"index\" : {\r\n
\"max_result_window\" : 20000\r\n }\r\n }\r\n ```\r\n3. Create new
map\r\n4. Set time range to `1 year ago to 1 year from now` to display
all web\r\nlogs data\r\n5. add documents layer. Verify point circled in
image is displayed.\r\nWithout changes, this point would not be returned
in the tile because\r\nthe tile would only return the first 10000
matches.\r\n<img width=\"500\" alt=\"Screenshot 2023-11-15 at 11 31 25
AM\"\r\nsrc=\"2249d571-24c4-41ad-975e-d44ee6d246ce\">","sha":"95a8d6a18f4f6e93ede4efdaaca880fc94378fb1"}},{"branch":"8.11","label":"v8.11.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
2023-11-16 13:20:14 -07:00
Kibana Machine
51bebd8f49
[8.11] [maps] fix vector tile layer with joins stuck in loading state when not visible (#170984) (#171031)
# Backport

This will backport the following commits from `main` to `8.11`:
- [[maps] fix vector tile layer with joins stuck in loading state when
not visible (#170984)](https://github.com/elastic/kibana/pull/170984)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2023-11-10T15:20:25Z","message":"[maps]
fix vector tile layer with joins stuck in loading state when not visible
(#170984)\n\nCloses
https://github.com/elastic/kibana/issues/170983\r\n\r\n### Test
instructions\r\n1. Download world countries geojson
from\r\nhttps://maps.elastic.co/v8.12/index.html?locale=en#file/world_countries\r\n2.
upload downloaded world countries\r\n3. create new map\r\n4. add
\"Choropleth\" layer\r\n5. Set boundaries source to \"Points, lines, and
polygons from\r\nelasticsearch\". Select world countries data view. Set
join field to\r\n\"iso2\"\r\n6. Set statistics view to kibana sample web
logs. Set join field to\r\n\"geo.src\"\r\n7. minimize layer TOC\r\n8.
save map and re-open.\r\n9. Minimized layer legend icon should stop
showing loading state once\r\nEMS base map is
loaded\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3c0ba20369d9582e9fcff69e27d6932a0d991646","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","Feature:Maps","v8.12.0","v8.11.1"],"number":170984,"url":"https://github.com/elastic/kibana/pull/170984","mergeCommit":{"message":"[maps]
fix vector tile layer with joins stuck in loading state when not visible
(#170984)\n\nCloses
https://github.com/elastic/kibana/issues/170983\r\n\r\n### Test
instructions\r\n1. Download world countries geojson
from\r\nhttps://maps.elastic.co/v8.12/index.html?locale=en#file/world_countries\r\n2.
upload downloaded world countries\r\n3. create new map\r\n4. add
\"Choropleth\" layer\r\n5. Set boundaries source to \"Points, lines, and
polygons from\r\nelasticsearch\". Select world countries data view. Set
join field to\r\n\"iso2\"\r\n6. Set statistics view to kibana sample web
logs. Set join field to\r\n\"geo.src\"\r\n7. minimize layer TOC\r\n8.
save map and re-open.\r\n9. Minimized layer legend icon should stop
showing loading state once\r\nEMS base map is
loaded\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3c0ba20369d9582e9fcff69e27d6932a0d991646"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/170984","number":170984,"mergeCommit":{"message":"[maps]
fix vector tile layer with joins stuck in loading state when not visible
(#170984)\n\nCloses
https://github.com/elastic/kibana/issues/170983\r\n\r\n### Test
instructions\r\n1. Download world countries geojson
from\r\nhttps://maps.elastic.co/v8.12/index.html?locale=en#file/world_countries\r\n2.
upload downloaded world countries\r\n3. create new map\r\n4. add
\"Choropleth\" layer\r\n5. Set boundaries source to \"Points, lines, and
polygons from\r\nelasticsearch\". Select world countries data view. Set
join field to\r\n\"iso2\"\r\n6. Set statistics view to kibana sample web
logs. Set join field to\r\n\"geo.src\"\r\n7. minimize layer TOC\r\n8.
save map and re-open.\r\n9. Minimized layer legend icon should stop
showing loading state once\r\nEMS base map is
loaded\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3c0ba20369d9582e9fcff69e27d6932a0d991646"}},{"branch":"8.11","label":"v8.11.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
2023-11-10 09:58:26 -07:00
Kibana Machine
900fb0fa07
[8.11] [maps] fix expand layer control is not clickable when layers are loading (#170912) (#171025)
# Backport

This will backport the following commits from `main` to `8.11`:
- [[maps] fix expand layer control is not clickable when layers are
loading (#170912)](https://github.com/elastic/kibana/pull/170912)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2023-11-10T14:00:05Z","message":"[maps]
fix expand layer control is not clickable when layers are loading
(#170912)\n\nCloses
https://github.com/elastic/kibana/issues/170911\r\n\r\nroot problem is
that `EuiButton*` components are disabled when passed\r\n`isLoading`
property. Re-worked component to not pass `isLoading`
to\r\n`EuiButton*`\r\n\r\n### Test instructions\r\n1. create new
map\r\n2. click \"Collapse layers panel\" to collapse layer
control\r\n3. open browser dev tools. Open network tab and select \"Slow
3G\"\r\n4. Pan and zoom map to cause basemap tiles to load. \"Expand
layers\r\npanel\" button should be clickable during
loading\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"bc2202df1ae226f97068b4709050741949f35923","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","Feature:Maps","v8.12.0","v8.11.1"],"number":170912,"url":"https://github.com/elastic/kibana/pull/170912","mergeCommit":{"message":"[maps]
fix expand layer control is not clickable when layers are loading
(#170912)\n\nCloses
https://github.com/elastic/kibana/issues/170911\r\n\r\nroot problem is
that `EuiButton*` components are disabled when passed\r\n`isLoading`
property. Re-worked component to not pass `isLoading`
to\r\n`EuiButton*`\r\n\r\n### Test instructions\r\n1. create new
map\r\n2. click \"Collapse layers panel\" to collapse layer
control\r\n3. open browser dev tools. Open network tab and select \"Slow
3G\"\r\n4. Pan and zoom map to cause basemap tiles to load. \"Expand
layers\r\npanel\" button should be clickable during
loading\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"bc2202df1ae226f97068b4709050741949f35923"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/170912","number":170912,"mergeCommit":{"message":"[maps]
fix expand layer control is not clickable when layers are loading
(#170912)\n\nCloses
https://github.com/elastic/kibana/issues/170911\r\n\r\nroot problem is
that `EuiButton*` components are disabled when passed\r\n`isLoading`
property. Re-worked component to not pass `isLoading`
to\r\n`EuiButton*`\r\n\r\n### Test instructions\r\n1. create new
map\r\n2. click \"Collapse layers panel\" to collapse layer
control\r\n3. open browser dev tools. Open network tab and select \"Slow
3G\"\r\n4. Pan and zoom map to cause basemap tiles to load. \"Expand
layers\r\npanel\" button should be clickable during
loading\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"bc2202df1ae226f97068b4709050741949f35923"}},{"branch":"8.11","label":"v8.11.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
2023-11-10 08:39:25 -07:00
Julia Rechkunova
7fa04e92bc
[Kibana] New "Saved Query Management" privilege to allow saving queries across Kibana (#166937)
- Resolves https://github.com/elastic/kibana/issues/158173

Based on PoC https://github.com/elastic/kibana/pull/166260

## Summary

This PR adds a new "Saved Query Management" privilege with 2 options:
- `All` will override any per app privilege and will allow users to save
queries from any Kibana page
- `None` will default to per app privileges (backward-compatible option)

<img width="600" alt="Screenshot 2023-09-21 at 15 26 25"
src="6d53548e-5c5a-4d6d-a86a-1e639cb77202">

### 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: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-09-29 11:52:39 +02:00
Anton Dosov
6fd9909b5e
[CM] Soften response validation (#166919)
## Summary

Close https://github.com/elastic/kibana/issues/167152

Log a warning instead of throwing an error in
`saved_object_content_storage` when response validation failed.

We decided to do this as a precaution and as a follow up to an issue
found in saved search https://github.com/elastic/kibana/pull/166886
where storage started failing because of too strict validation.

As of this PR the saved_object_content_storage covers and this change
cover:

- `search`
- `index_pattern`
- `dashboard`
- `lens`
- `maps`

For other types we agreed with @dej611 that instead of applying the same
change for other types (visualization, graph, annotation) the team would
look into migrating their types to also use
`saved_object_content_storage`
https://github.com/elastic/kibana/issues/167421
2023-09-28 16:33:04 +02:00
Cee Chen
581b30b743
Upgrade EUI to v88.5.0 (#166868)
`v88.3.0``v88.5.0`

closes #151514

---

## [`88.5.0`](https://github.com/elastic/eui/tree/v88.5.0)

- Updated `EuiCallOut` with a new `onDismiss` prop
([#7156](https://github.com/elastic/eui/pull/7156))
- Added a new `renderCustomToolbar` prop to `EuiDataGrid`, which allows
custom rendering of the toolbar.
([#7190](https://github.com/elastic/eui/pull/7190))
- Added a new `allowResetButton` prop to
`toolbarVisibility.showDisplaySelector` of `EuiDataGrid`, which allows
hiding the "Reset to default" button from the display settings popover.
([#7190](https://github.com/elastic/eui/pull/7190))
- Added a new `additionalDisplaySettings` prop to
`toolbarVisibility.showDisplaySelector` of `EuiDataGrid`, which allows
rendering extra settings inside the display settings popover.
([#7190](https://github.com/elastic/eui/pull/7190))
- Updated `EuiDataGrid`'s toolbar display settings button icon
([#7190](https://github.com/elastic/eui/pull/7190))
- Updated `EuiTextTruncate` with significantly improved iteration
performance. Removed `measurementRenderAPI` prop, as `EuiTextTruncation`
now only uses more performant canvas render API
([#7210](https://github.com/elastic/eui/pull/7210))
- Updated `EuiPopover` with a new configurable `repositionToCrossAxis`
prop ([#7211](https://github.com/elastic/eui/pull/7211))
- Updated `EuiDatePicker` to support `compressed` input styling
([#7218](https://github.com/elastic/eui/pull/7218))
- Added `gradient` and `palette` icon glyphs.
([#7220](https://github.com/elastic/eui/pull/7220))

**Bug fixes**

- Fixed `EuiPopover`'s missing animations on popover close
([#7211](https://github.com/elastic/eui/pull/7211))
- Fixed `EuiInputPopover` anchoring to the wrong side and missing
shadows on smaller screens
([#7211](https://github.com/elastic/eui/pull/7211))
- Fixed `EuiSuperDatePicker` icon spacing on the quick select button
([#7217](https://github.com/elastic/eui/pull/7217))
- Fixed a missing type in `EuiMarkdownEditor`'s default processing
plugins ([#7221](https://github.com/elastic/eui/pull/7221))


## [`88.4.1`](https://github.com/elastic/eui/tree/v88.4.1)

**Bug fixes**

- Fixed missing `className`s on `EuiTextTruncate`
([#7212](https://github.com/elastic/eui/pull/7212))
- Fixed `title`s on `EuiComboBox` dropdown options to always be present
([#7212](https://github.com/elastic/eui/pull/7212))
- Fixed `EuiComboBox` truncation issues when search is an empty space
([#7212](https://github.com/elastic/eui/pull/7212))

## [`88.4.0`](https://github.com/elastic/eui/tree/v88.4.0)

- Updated `EuiComboBox` to allow configuring text truncation behavior
via `truncationProps`. These props can be set on the entire combobox as
well as on on individual dropdown options.
([#7028](https://github.com/elastic/eui/pull/7028))
- Updated `EuiInMemoryTable` with a new `searchFormat` prop (defaults to
`eql`). When setting this prop to `text`, the built-in search bar will
ignore EQL syntax and allow searching for plain strings with special
characters and symbols.
([#7175](https://github.com/elastic/eui/pull/7175))

**Bug fixes**

- `EuiComboBox` now always shows the highlighted search text, even on
truncated text ([#7028](https://github.com/elastic/eui/pull/7028))
- Fixed missing i18n in `EuiSearchBar`'s default placeholder and
aria-label text ([#7175](https://github.com/elastic/eui/pull/7175))
- Fixed the inline compressed styles of `EuiDescriptionListTitle` to use
a taller line-height for readability
([#7185](https://github.com/elastic/eui/pull/7185))
- Fixed `EuiComboBox` to correctly truncate selected items when
displayed as pills and plain text
([#7193](https://github.com/elastic/eui/pull/7193))

**Accessibility**

- Added `aria-current` attribute to `EuiTablePagination`
([#7186](https://github.com/elastic/eui/pull/7186))

**CSS-in-JS conversions**

- Converted `EuiDroppable` and `EuiDraggable` to Emotion; Removed
`$euiDragAndDropSpacing` Sass variables
([#7187](https://github.com/elastic/eui/pull/7187))

---------

Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
Co-authored-by: Jan Monschke <jan.monschke@elastic.co>
Co-authored-by: Thomas Watson <watson@elastic.co>
2023-09-27 13:04:45 -05:00
Nathan Reese
1abe8c02c3
[maps] allow by value styling for EMS boundary fields (#166306)
Closes https://github.com/elastic/kibana/issues/166305

PR:
1) adds getFields implementation to EMSFileSource so that fields can be
used for by-value styling
<img width="600" alt="Screen Shot 2023-09-12 at 4 20 44 PM"
src="5540e18f-4a0f-408a-91ed-f3cea5cc9747">
2) removes `createFields` method from `IVectorStyle`. Duplicate of
`getFieldByNamd` method.
3) Refactored EMSFileSource update editor to functional component and
added loading state.
<img width="497" alt="Screen Shot 2023-09-12 at 4 08 18 PM"
src="d15fddd8-af30-4c9b-8c93-6ab0a431bdcb">

### Test instructions
1) create map and add "EMS boundaries layer".
2) Verify layer allows styling by-value for label with EMS property
fields

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-13 12:51:16 -06:00
Marco Liberati
01ad4c2b44
[ContentManagement] Fix Visualize List search and CRUD operations via CM (#165485)
## Summary

Fix #163246

This PR fixes the CM problems within the Visualize List page leveraging
the services already in place.
The approach here is lighter than #165292 as it passes each client via
the TypesService already used to register extensions in the
Visualization scope. Also the `search` method now transparently uses the
`mSearch` if more content types are detected without leaking any
implementation detail outside the `VisualizationClient` interface.

More fixes/features:
* fixed Maps update operation definition which was missing the
`overwrite` flag
* Allow `mSearch` to accept an options object argument
* Added new helper functions to interact with the metadata flyout in
Listing page


### 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: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-09-13 09:18:03 -07:00
Nathan Reese
691311ce7c
[maps] fix Air-gapped enviroment hitting 400 error loading fonts for layer (#165986)
Closes https://github.com/elastic/kibana/issues/165974

The root cause of the problem is calling `basePath.prepend` on a path
without a leading `/`. Maps is not consistent with path constants. Some
have leading `/` while others do not. To resolve the issue, this PR
updates all path constants to consistently have leading `/`.

PR adds functional test runner with `map.includeElasticMapsService:
false` to ensure maps is tested without EMS enabled to catch future
regressions.

### Test instructions
* set *map.includeElasticMapsService: false* in kibana.dev.yml
* install sample data set
* create new map with documents layer
* Configure label styling
* Verify layer is displayed with labels

<img width="500" alt="Screen Shot 2023-09-13 at 6 26 23 AM"
src="44d12e87-9b80-424c-9bc9-126b373bdf18">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-13 10:06:05 -06:00
Nathan Reese
2ec121850c
[maps][file upload] remove number_of_shards index setting (#165390)
closes https://github.com/elastic/kibana/issues/165366
closes https://github.com/elastic/kibana/issues/165367
close https://github.com/elastic/kibana/issues/165697
replaces https://github.com/elastic/kibana/pull/165337

Serverless elasticsearch does not support index setting
`number_of_shards`

PR resolves issue be removing `number_of_shards`. When
`number_of_shards` was introduced way back when, the default value was
5. Now the default value is one. Therefore there is no point providing
the setting since its the same as the default. Just removing so code
works across both serverless and traditional deployments

PR also cleans up some types that are duplicative of elasticsearch types

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
2023-09-06 13:20:11 -05:00
Nathan Reese
168412ba7b
[maps] fix 'by value' map does not fill dashboard panel on initial page load in 8.10 (#165326)
Fixes https://github.com/elastic/kibana/issues/165183

### Test instructions
1) install any sample data set
2) open new dashboard
3) Use "Add panel" buttons to add by-value map with only base map layer
4) Ensure map tiles fill entire map panel in dashboard

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-08-31 10:33:56 -06:00
Cee Chen
7c896218dd
Remove several @ts-ignore/@ts-expect-errors around EUI imports (#163984)
## Summary

There's a few EUI imports out there that folks are reaching into
`@elastic/eui/lib/` for (which doesn't contain any types - something I'm
looking into separately) that could instead be imported at the top
`@elastic/eui` level, which is properly typed.

### Checklist

N/A - types only

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-22 17:33:37 +02:00
Cee Chen
84ca85d0ef
Upgrade EUI to v87.1.0 (#163961)
`v86.0.0``v87.1.0`

⚠️ The biggest set of type changes in this PR come from the breaking
change that makes `pageSize` and `pageSizeOptions` now optional props
for `EuiBasicTable.pagination`, `EuiInMemoryTable.pagination` and
`EuiDataGrid.pagination`.

This caused several other components that were cloning EUI's pagination
type to start throwing type warnings about `pageSize` being optional.
Where I came across these errors, I modified the extended types to
require `pageSize`. These types and their usages may end up changing
again in any case once the Shared UX team looks into
https://github.com/elastic/kibana/issues/56406.

---

## [`87.1.0`](https://github.com/elastic/eui/tree/v87.1.0)

- Updated the underlying library powering `EuiAutoSizer`. This primarily
affects typing around the `disableHeight` and `disableWidth` props
([#6798](https://github.com/elastic/eui/pull/6798))
- Added new `EuiAutoSize`, `EuiAutoSizeHorizontal`, and
`EuiAutoSizeVertical` types to support `EuiAutoSizer`'s now-stricter
typing ([#6798](https://github.com/elastic/eui/pull/6798))
- Updated `EuiDatePickerRange` to support `compressed` display
([#7058](https://github.com/elastic/eui/pull/7058))
- Updated `EuiFlyoutBody` with a new `scrollableTabIndex` prop
([#7061](https://github.com/elastic/eui/pull/7061))
- Added a new `panelMinWidth` prop to `EuiInputPopover`
([#7071](https://github.com/elastic/eui/pull/7071))
- Added a new `inputPopoverProps` prop for `EuiRange`s and
`EuiDualRange`s with `showInput="inputWithPopover"` set
([#7082](https://github.com/elastic/eui/pull/7082))

**Bug fixes**

- Fixed `EuiToolTip` overriding instead of merging its
`aria-describedby` tooltip ID with any existing `aria-describedby`s
([#7055](https://github.com/elastic/eui/pull/7055))
- Fixed `EuiSuperDatePicker`'s `compressed` display
([#7058](https://github.com/elastic/eui/pull/7058))
- Fixed `EuiAccordion` to remove tabbable children from sequential
keyboard navigation when the accordion is closed
([#7064](https://github.com/elastic/eui/pull/7064))
- Fixed `EuiFlyout`s to accept custom `aria-describedby` IDs
([#7065](https://github.com/elastic/eui/pull/7065))

**Accessibility**

- Removed the default `dialog` role and `tabIndex` from push
`EuiFlyout`s. Push flyouts, compared to overlay flyouts, require manual
accessibility management.
([#7065](https://github.com/elastic/eui/pull/7065))

## [`87.0.0`](https://github.com/elastic/eui/tree/v87.0.0)

- Added beta `componentDefaults` prop to `EuiProvider`, which will allow
configuring certain default props globally. This list of components and
defaults is still under consideration.
([#6923](https://github.com/elastic/eui/pull/6923))
- `EuiPortal`'s `insert` prop can now be configured globally via
`EuiProvider.componentDefaults`
([#6941](https://github.com/elastic/eui/pull/6941))
- `EuiFocusTrap`'s `crossFrame` and `gapMode` props can now be
configured globally via `EuiProvider.componentDefaults`
([#6942](https://github.com/elastic/eui/pull/6942))
- `EuiTablePagination`'s `itemsPerPage`, `itemsPerPageOptions`, and
`showPerPageOptions` props can now be configured globally via
`EuiProvider.componentDefaults`
([#6951](https://github.com/elastic/eui/pull/6951))
- `EuiBasicTable`, `EuiInMemoryTable`, and `EuiDataGrid` now allow
`pagination.pageSize` to be undefined. If undefined, `pageSize` defaults
to `EuiTablePagination`'s `itemsPerPage` component default.
([#6993](https://github.com/elastic/eui/pull/6993))
- `EuiBasicTable`, `EuiInMemoryTable`, and `EuiDataGrid`'s
`pagination.pageSizeOptions` will now fall back to
`EuiTablePagination`'s `itemsPerPageOptions` component default.
([#6993](https://github.com/elastic/eui/pull/6993))
- Updated `EuiHeaderLinks`'s `gutterSize` spacings
([#7005](https://github.com/elastic/eui/pull/7005))
- Updated `EuiHeaderAlert`'s stacking styles
([#7005](https://github.com/elastic/eui/pull/7005))
- Added `toolTipProps` to `EuiListGroupItem` that allows customizing
item tooltips. ([#7018](https://github.com/elastic/eui/pull/7018))
- Updated `EuiBreadcrumbs` to support breadcrumbs that toggle popovers
via `popoverContent` and `popoverProps`
([#7031](https://github.com/elastic/eui/pull/7031))
- Improved the contrast ratio of disabled titles within `EuiSteps` and
`EuiStepsHorizontal` to meet WCAG AA guidelines.
([#7032](https://github.com/elastic/eui/pull/7032))
- Updated `EuiSteps` and `EuiStepsHorizontal` to highlight and provide a
more clear visual indication of the current step
([#7048](https://github.com/elastic/eui/pull/7048))

**Bug fixes**

- Single uses of `<EuiHeaderSectionItem side="right" />` now align right
as expected without needing a previous `side="left"` sibling.
([#7005](https://github.com/elastic/eui/pull/7005))
- `EuiPageTemplate` now correctly displays `panelled={true}`
([#7044](https://github.com/elastic/eui/pull/7044))

**Breaking changes**

- `EuiTablePagination`'s default `itemsPerPage` is now `10` (was
previously `50`). This can be configured through
`EuiProvider.componentDefaults`.
([#6993](https://github.com/elastic/eui/pull/6993))
- `EuiTablePagination`'s default `itemsPerPageOptions` is now `[10, 25,
50]` (was previously `[10, 20, 50, 100]`). This can be configured
through `EuiProvider.componentDefaults`.
([#6993](https://github.com/elastic/eui/pull/6993))
- Removed `border` prop from `EuiHeaderSectionItem` (unused since
Amsterdam theme) ([#7005](https://github.com/elastic/eui/pull/7005))
- Removed `borders` object configuration from `EuiHeader.sections`
([#7005](https://github.com/elastic/eui/pull/7005))

**CSS-in-JS conversions**

- Converted `EuiHeaderAlert` to Emotion; Removed unused
`.euiHeaderAlert__dismiss` CSS
([#7005](https://github.com/elastic/eui/pull/7005))
- Converted `EuiHeaderSection`, `EuiHeaderSectionItem`, and
`EuiHeaderSectionItemButton` to Emotion
([#7005](https://github.com/elastic/eui/pull/7005))
- Converted `EuiHeaderLinks` and `EuiHeaderLink` to Emotion; Removed
`$euiHeaderLinksGutterSizes` Sass variables
([#7005](https://github.com/elastic/eui/pull/7005))
- Removed `$euiHeaderBackgroundColor` Sass variable; use
`$euiColorEmptyShade` instead
([#7005](https://github.com/elastic/eui/pull/7005))
- Removed `$euiHeaderChildSize` Sass variable; use `$euiSizeXXL` instead
([#7005](https://github.com/elastic/eui/pull/7005))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
2023-08-21 15:16:39 -07:00
Trevor Pierce
83d9644b74
Upgrade EUI to v86.0.0 (#163088)
`85.1.0` ➡️ `86.0.0`

⚠️ The biggest change in this PR is migrating the `react-beautiful-dnd`
dependency to it's open-source forked successor, `@hello-pangea/dnd`.
This new fork has better typescript support and additionally supports
both React 17 and React 18.

## [`86.0.0`](https://github.com/elastic/eui/tree/v86.0.0)

- Added React 18 support (StrictMode not yet supported).
([#7012](https://github.com/elastic/eui/pull/7012))

**Deprecations**

- Deprecated `euiPaletteComplimentary`; Use `euiPaletteComplementary`
instead. ([#6992](https://github.com/elastic/eui/pull/6992))

**Breaking changes**

- Replaced the underlying drag-and-drop library from
`react-beautiful-dnd` to its fork `@hello-pangea/dnd`
([#7012](https://github.com/elastic/eui/pull/7012))
([#7012](https://github.com/elastic/eui/pull/7012))
- No code updates are needed if using only `<EuiDragDropContext>`,
`<EuiDroppable>` and `<EuiDraggable>` with no direct imports from
`react-beautiful-dnd`. In case you were importing things from
`react-beautiful-dnd` and using them together with EUI components, you
need to switch to `@hello-pangea/dnd` which has cross-compatible API.

---------

Co-authored-by: Tomasz Kajtoch <tomasz.kajtoch@elastic.co>
Co-authored-by: Tomasz Kajtoch <tomek@kajto.ch>
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
Co-authored-by: Drew Tate <andrew.tate@elastic.co>
2023-08-14 15:45:09 -05:00
Anton Dosov
e944a19cbd
[Serverless] Partially fix lens/maps/visualize breadcrumbs missing title (#163476)
## Summary

Partially address https://github.com/elastic/kibana/issues/163337 for
lens, visualize, maps

### Context:

In serverless navigation, we changed how breadcrumbs work. Instead of
setting the full path manually, we automatically calculate the main
parts of the path from the side nav + current URL. This was done to keep
side nav and breadcrumbs in sync as much as possible and solve
consistency issues with breadcrumbs across apps.

https://docs.elastic.dev/kibana-dev-docs/serverless-project-navigation#breadcrumbs

Apps can append custom deeper context using the
`serverless.setBreadcrumbs` API. Regular `core.chrome.setBreadcrumbs`
has no effect when the serverless nav is rendered.

### Fix

This PR fixes lens, visualize, and maps to add "title" breadcrumb in
serverless. **Unfortunately, it doesn't fully restore the full
breadcrumbs functionality visualize/maps/lens have in the non-serverless
Kibana:**

In the non-serverless Kibana lens/visualize/maps have sophisticated
breadcrumbs where context takes into account `ByValue` and
`originatingApp` and can switch depending on the context. For example,
if the user is coming from "Dashboard" to edit "byValue" Lens
visualization, Lens breadcrumbs display "Dashboard > Create", instead of
"Visualization > Create".

Currently, we can't repeat this behavior with serverless breadcrumbs
because the context is set by the navigation config, e.g.:


9538fab090/x-pack/plugins/serverless_observability/public/components/side_navigation/index.tsx (L136-L141)

In this PR I attempt to do a quick fix for the serverless breadcrumbs by
simply appending the last ("title") part of the breadcrumb. In a follow
up we need to think about how to bring back the original breadcrumbs
functionality with changing `Visualize <-> Dashboard` context. We also
will need to figure out how to sync the changing context with the side
nav, as we don't want to show "Dashboard" in the breadcrumb, but have
"Visualization" highlighted in the side nav. Here is the issue:
https://github.com/elastic/kibana/issues/163488
2023-08-11 10:33:50 +02:00
Nathan Reese
a038fb09ca
add x-elastic-internal-origin header to vector tile, glyphs, and fonts APIs (#163331)
Closes https://github.com/elastic/kibana/issues/163311

To test
* create map with documents layer (that uses vector tile scaling,
default).
* verify header is provided in request

<img width="500" alt="Screen Shot 2023-08-07 at 10 25 11 AM"
src="0a057039-b8b5-4fba-8db2-aec91a2d519f">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-09 15:26:18 -06:00
Nathan Reese
b222f7a7d1
[maps] support null description in saved object (#162145)
Part of https://github.com/elastic/kibana/issues/162069

> This happens in maps too and possibly other SOs that have null
description (not sure if it were ever possible to have null description
in maps.) It seems from the SOs that Bhavya sent that it was possible
for visualizations. With this schema change the bug if fixed
https://github.com/elastic/kibana/pull/162106

> Not sure if it makes sense to also do it in maps. @nreese wdyt?

Add support for null description in maps saved object to be consistent
with visualize saved objects.

### test instructions
1) Install web logs sample data set
2) export map
3) manually change ndjson, changing `description:""` to
`description:null`
4) reimport map saved object
5) verify map can be opened

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-18 11:10:11 -06:00
Nathan Reese
9a87af0cc3
[maps] fix Map layer preview blocks adding layer until all tiles are loaded (#161994)
Closes https://github.com/elastic/kibana/issues/159872

<img width="500" alt="Screen Shot 2023-07-14 at 1 56 45 PM"
src="b4fc762e-dc5e-48dc-a37f-b0936f02b00b">


Do not disable add layer buttons while preview layer is loading

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-18 08:20:35 -06:00
Nathan Reese
2259e91250
[maps] Support time series split for top hits per entity source (#161799)
Closes https://github.com/elastic/kibana/issues/141978

<img width="600" alt="Screen Shot 2023-07-12 at 1 51 45 PM"
src="a71fc82f-31e0-49b2-9178-c70d890a9912">

### Test instructions
* clone https://github.com/thomasneirynck/faketracks
* cd into `faketracks`
* run `npm install`
* run `node ./generate_tracks.js --isTimeSeries`
* In Kibana, create `tracks` data view
* In Maps, create new map and add `Top hits` layer. Select `Tracks` data
view.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-14 13:45:49 -06:00
Nathan Reese
235eac899b
[maps] fix Data Mapper resets after switch to clusters for scaling (#161796)
Closes https://github.com/elastic/kibana/issues/158551

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-14 09:11:56 -06:00
Nathan Reese
9509425349
[Maps] update to maplibre 3.1.0 (#161032)
maplibre change log
https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md#310

Breaking changes that required fixes
* 3.0.0 Remove "mapbox-gl-supported" package from API. If needed, please
reference it directly instead of going through MapLibre.
(https://github.com/maplibre/maplibre-gl-js/pull/2451)
* 3.0.0 Resize map when container element is resized. The
"resize"-related events now has different data associated with it
(https://github.com/maplibre/maplibre-gl-js/pull/2157,
https://github.com/maplibre/maplibre-gl-js/issues/2551). Previously the
originalEvent field was the reason of this change, for example it could
be a resize event from the browser. Now it is ResizeObserverEntry, see
more
[here](https://developer.mozilla.org/en-US/docs/web/api/resizeobserverentry).
* 2.2.0 Improve filter specification typings
(https://github.com/maplibre/maplibre-gl-js/pull/1390)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-13 08:22:15 -06:00
Marta Bondyra
95e50875e1
[Lens] Remove <NativeRenderer /> (#161521)
## Summary

The NativeRenderer component is currently used to mount another
component in a separate mounting point. As far as I recall, we
introduced <NativeRenderer/> to allow users to create visualizations in
non-React frameworks. The idea was that users could write their own Lens
visualizations or datasources code and integrate it with our system.
However, it seems that this concept hasn't gained traction and we don’t
have it prioritized. Even if users express interest in writing their
visualizations outside of React, it is still possible to do so with some
additional boilerplate code (which we could provide as an example
non-React visualization).
Pros:

1. Simplifies and shortens the code:
1.1. Testing and debugging become easier as we no longer need to check
separate React trees when integrating frame, data source, and
visualization components.
1.2. Components communicate using standard React patterns, making
maintenance and comprehension simpler.
1.3. Context providers no longer need to be passed to each separate
component since they are already within the context.
1.4. Easier propagation of events or any other form of inter-component
communication.

2. Greatly improves performance and facilitates maintenance:
2.1. Directly accessing context inside the DatasourcePanel eliminates
the need for context passing, resulting in better performance.
2.2. Removing the requirement for a separate React root also contributes
to improved performance.

3. The render method will be removed when we upgrade to React 18. While
we could replace it with the new createRoot method, it makes sense to
perform some cleanup ;)

Cons:
1. Setting up non-React visualization or data source code might become
slightly more complex.

Performance improvement for drag and drop action with these changes:

before:

<img width="1110" alt="Screenshot 2023-07-10 at 07 14 39"
src="45a1b09b-5189-46f5-af2b-7781fcf4e774">

after:

<img width="1117" alt="Screenshot 2023-07-10 at 07 16 24"
src="0e704da1-3220-4eb9-8fa0-cc3584a90090">

## Single render when dragging:

(the first image is 3 screenshots from 3 different react roots as they
have separate mounting point. The complete render time is ~380ms)
<img width="1117" alt="Screenshot 2023-07-10 at 07 16 24"
src="6d7f2d9f-a758-476e-8efb-38693ae90097">

After we have one common render tree. Because we don't have to pass
context down as a prop, we greatly reduced the number of components
rerendered. (I will be working on reducing the render time for workspace
panel as this seems to still be a bottleneck point)
<img width="732" alt="Screenshot 2023-07-10 at 14 52 41"
src="03ec97b3-8225-490e-8884-0fd4e69587e8">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-11 14:05:45 +02:00
Bree Hall
4cf630bfec
Upgrade EUI to 83.0.0 (#160813)
`eui@82.1.0`  `83.0.0`

⚠️ The biggest change in this PR by far is the `EuiButtonEmpty` Emotion
conversion, which changes the DOM structure of the button slightly as
well as several CSS classes around it.

EUI has attempted to convert any custom EuiButtonEmpty CSS overrides
where possible, but would super appreciate it if CODEOWNERS checked
their touched files. If anything other than a snapshot or test was
touched, please double check the display of your button(s) and confirm
everything still looks shipshape. Feel free to ping us for advice if
not.

---

## [`83.0.0`](https://github.com/elastic/eui/tree/v83.0.0)

**Bug fixes**

- Fixed `EuiPaginationButton` styling affected by `EuiButtonEmpty`'s
Emotion conversion ([#6893](https://github.com/elastic/eui/pull/6893))

**Breaking changes**

- Removed `isPlaceholder` prop from `EuiPaginationButton`
([#6893](https://github.com/elastic/eui/pull/6893))

## [`82.2.1`](https://github.com/elastic/eui/tree/v82.2.1)

- Updated supported Node engine versions to allow Node 16, 18 and >=20
([#6884](https://github.com/elastic/eui/pull/6884))

## [`82.2.0`](https://github.com/elastic/eui/tree/v82.2.0)

- Updated EUI's SVG icons library to use latest SVGO v3 optimization
([#6843](https://github.com/elastic/eui/pull/6843))
- Added success color `EuiNotificationBadge`
([#6864](https://github.com/elastic/eui/pull/6864))
- Added `badgeColor` prop to `EuiFilterButton`
([#6864](https://github.com/elastic/eui/pull/6864))
- Updated `EuiBadge` to use CSS-in-JS for named colors instead of inline
styles. Custom colors will still use inline styles.
([#6864](https://github.com/elastic/eui/pull/6864))

**CSS-in-JS conversions**

- Converted `EuiButtonGroup` and `EuiButtonGroupButton` to Emotion
([#6841](https://github.com/elastic/eui/pull/6841))
- Converted `EuiButtonIcon` to Emotion
([#6844](https://github.com/elastic/eui/pull/6844))
- Converted `EuiButtonEmpty` to Emotion
([#6863](https://github.com/elastic/eui/pull/6863))
- Converted `EuiCollapsibleNav` and `EuiCollapsibleNavGroup` to Emotion
([#6865](https://github.com/elastic/eui/pull/6865))
- Removed Sass variables `$euiCollapsibleNavGroupLightBackgroundColor`,
`$euiCollapsibleNavGroupDarkBackgroundColor`, and
`$euiCollapsibleNavGroupDarkHighContrastColor`
([#6865](https://github.com/elastic/eui/pull/6865))

---------

Co-authored-by: Cee Chen <constance.chen@elastic.co>
Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-06 12:46:55 -07:00
Nathan Reese
b22dd68d39
[maps] replace duplicated elasticsearch geo types with types from elasticsearch-specification (#161011)
https://github.com/elastic/elasticsearch-specification/blob/main/output/typescript/types.ts
defines elasticsearch API types. This PR removes types defined in maps
plugins and replaces them with types from elasticsearch-specification.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-06 10:29:01 -06:00
Sean Sullivan
9a20abc5c3
Add Multi format for geopoint and consolidate geo converstion tools i… (#147272)
Add multiple formats for geo_point fields and make geo conversion tools
part of field_format/common/utils

This is needed because various users need locations displayed in
different formats. It would be problematic to allow users to change the
index field formatting for everyone.

WKT and LL where already formatters availible.

I added MGRS and DMS.
## Summary

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

![image](https://user-images.githubusercontent.com/11495566/206515127-14774b76-49f9-4fed-a306-1b03936c8766.png)



### 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: Sean Sullivan <ssullivan@spectric.com>
Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
2023-07-06 11:23:21 +02:00
Nathan Reese
7340007718
[maps] time series geo line (#159267)
Part of https://github.com/elastic/kibana/issues/141978

PR updates tracks layer with "group by time series" logic. When true,
geo_line metric aggregation is proceeded by `time_series` bucket
aggregation instead of `filters` bucket aggregation (used by existing
terms split).

### UI when creating tracks layer with time series data view

<img width="481" alt="Screen Shot 2023-06-22 at 12 35 46 PM"
src="ccfeb6ef-c714-49a3-a6d6-f6b52cce80be">

<img width="469" alt="Screen Shot 2023-06-22 at 12 35 55 PM"
src="55cba2dc-6326-4141-bde5-7a6cc0f0b333">

<img width="542" alt="Screen Shot 2023-06-22 at 12 49 22 PM"
src="694ce621-2b6e-4a20-ba20-b9f9d20da8ef">

### UI when editing tracks layer with time series data view

<img width="447" alt="Screen Shot 2023-06-22 at 12 36 17 PM"
src="96cbb3f3-4ca5-430f-91b3-71b5013ca6e9">

<img width="457" alt="Screen Shot 2023-06-22 at 12 36 24 PM"
src="4d603809-7e6a-4b72-98d7-d3a516b2c809">

### Test instructions
* clone https://github.com/thomasneirynck/faketracks
* cd into `faketracks`
* run `npm install`
* run `node ./generate_tracks.js --isTimeSeries`
* In Kibana, create `tracks` data view
* In Maps, create new map and add `Tracks` layer. Select `Tracks` data
view.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-29 11:15:20 -06:00
Nathan Reese
2fb4d5fff8
[maps] remove IVectorSource.getFieldNames (#159747)
`IVectorSource` interface has many similar sounding methods that are
used for different purposes. These lead to confusion and an unclear API
* getFieldNames
* getFields
* getFieldByName

Although `getFieldNames` sounds similar to `getFields`, the 2 are used
for very different purposes.
* getFieldNames returns a string array that is used to trigger source
re-fetch
* getFields returns an array of fields to drive UI such as field
selection for data driven styling

`getFieldNames` overlaps 100% in functionality with `getSyncMeta` and is
not needed. Combining output of `getFieldNames` into `getSyncMeta`
simplifies the `IVectorSource` API and removes some confusion.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-27 11:36:43 -06:00
Nathan Reese
c9474270d1
[maps] fix geojson layer with joins and no left source matches stuck in loading state (#160222)
closes https://github.com/elastic/kibana/issues/156630

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-26 09:27:28 -06:00
Patryk Kopyciński
a1d02824f1
[shared-ux-router] Add Router and Routes components (#159834)
## Summary

Why?

To simplify the process of migration to react-router@6.
https://github.com/remix-run/react-router/discussions/8753

What problems exactly it solves?

- In my previous PR I added `CompatRouter`
https://github.com/elastic/kibana/pull/159173, which caused changes in
~50 files and pinged 15 Teams. And this is just meant to be a temporary
change, so when we're done with the migration I would have to revert
these changes and engage everyone to review the PR again. And it is just
a single step in the migration strategy. So to make our lives easier I
think it would be better to have a common place where we do import our
router components because it will allow us to surface some extra logic
in single place instead of going through the whole source code again.

- `react-router@6` doesn't support a custom `Route` component, so that
means our custom `Route` component that we're using almost everywhere
today, will need to be replaced by a different solution. I have decided
to add `Routes` component, which will be responsible for rendering the
proper component (`react-router@6` renamed `Switch` to `Routes`, so I
have named this component to align with the dictionary of the new
router) and also is going to add the logic that today is done in `Route`
(moving logic to `Routes` will be done in the follow-up PR, here I just
wanted to focus on using the common router components to make the review
process easier)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-23 10:02:06 -05:00
Hannah Mudge
f1dc1e1869
[Controls] Move "clear selections" to hover action (#159526)
Closes https://github.com/elastic/kibana/issues/159395
Closes https://github.com/elastic/kibana/issues/153383

## Summary

This PR moves the "clear selections" button for all controls (options
list, range slider, and time slider) from inside their respective
popovers to a general hover action - this not only saves users a click
for this common interaction (which has actually been brought in user
feedback up as a downside of the current controls compared to the legacy
controls), it also allows us to fully move forward with migrating the
range slider control to the `EuiDualRange` component. This will be done
in a follow up PR, which should both (1) clean up our range slider code
significantly and (2) fix the [bug discussed
here](https://github.com/elastic/kibana/pull/159271#pullrequestreview-1477930356).
The related issue can be tracked
[here](https://github.com/elastic/kibana/issues/159724), since we might
not be able to get to it right away.

This "clear selections" action is available in both view and edit mode,
like so:

|  | Edit mode | View mode |
|--------|--------|--------|
| **Range slider** |
![image](83cb1e1a-0b20-43aa-a37b-14484b5f4945)
|
![image](0d28ce03-5242-4f3a-8a05-d447bca50ddb)
|
| **Options list** |
![image](066257f6-c0ce-4e33-a193-5bbc62e341a6)
|
![image](d1ec124c-f5ee-4137-9eb9-33e06d522435)
|
| **Time slider** |
![image](33b8bb80-fa0c-4281-ae81-f1e1b44086f3)
|
![image](bd7c41ae-706c-45f3-8b49-9bd4d259e5cf)
|

You may notice in the above screenshots that the "delete" action is now
represented with a red trash icon rather than a red cross, and the
tooltip text was also changed to use the word "Delete" rather than the
word "Remove" - these changes were both made to be more consistent with
the "Delete panel" action available on dashboards:

| Delete control - Before | Delete control - After | Delete panel |
|--------|--------|--------|
| ![Screenshot 2023-06-13 at 5 32 22
PM](2600b197-653b-43ea-a043-a50be7e6a796)
|
![image](5ef80380-2575-45fc-ba11-c59f3f252ac3)
| <img
src="a7f65777-45cf-44f2-96a7-f1042cb25e02"/>
|

Beyond these changes, I also made a few quick changes to the time slider
control, including:
1. Fixing the appearance so that the background is once again white, as
described
[here](https://github.com/elastic/kibana/pull/159526#discussion_r1229792071)
2. Adding comparison logic so that clearing selections no longer causes
unsaved changes unnecessarily, as described
[here](https://github.com/elastic/kibana/pull/159526#discussion_r1229789753)

### Videos

**Before**


96365c85-748e-4fd7-ae5d-589aa11a23ef


**After**


68352559-e71b-4b5e-8709-587016f0b35a



### 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] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] 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))
- [x] 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))
- [x] 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-20 16:53:10 -06:00
Nathan Reese
9e60627dd1
[maps] fix layer group loading indicator always on when group has non-visible layer (#159517)
closes https://github.com/elastic/kibana/issues/158857

PR resolves issue by adding `isVisible` and `showAtZoomLevel` checks
into `isLayerLoading` and returning false if a layer is not visible (and
therefore, would not load data).

PR also increases test coverage to help ensure regression is not
re-introduced.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-15 09:54:27 -06:00
Drew Tate
6553ebbdd5
[Lens][Visualizations] library annotation groups listing page (#157988) 2023-06-13 20:09:01 -05:00
Nathan Reese
cb7c5b3848
[maps] fix geo line source not loaded unless maps application is opened (#159432)
closes https://github.com/elastic/kibana/issues/159408

PR consolidates source registry into a single file to ensure that all
sources are registered when only map embeddable is loaded. To prevent
regression, unit test added to ensure that all SOURCE_TYPES enum values
are contained in registry.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-12 16:07:11 -06:00
Melissa Alvarez
f2da36215c
[Maps][ML] Add hyperlink to anomaly explorer for job from anomaly layer in maps (#159268)
## Summary

Related issue: https://github.com/elastic/kibana/issues/148665

This PR adds a link to the anomaly explorer for the job corresponding to
the anomalies layer in maps. The link is found under 'Source details'
once the anomalies layer is created.

<img width="1291" alt="image"
src="f109ce21-1aec-40c4-8cf1-fc3dedaef199">

## NOTE

This is dependent on the changes in maps
https://github.com/elastic/kibana/pull/159255

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-09 14:31:28 -06:00
Nathan Reese
43767044cf
[maps] pass dataFilters to ISource.getImmutableProperties (#159255)
https://github.com/elastic/kibana/pull/159161 is adding adding hyperlink
to anomaly explorer for job from anomaly layer in maps. A requirement
from this request is to be able to include timerange and query state in
the hyperlink. This PR updates ISource.getImmutableProperties to take
dataFilters parameter so hyperlink can be updated with latest query
state.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-08 09:26:21 -06:00
Nathan Reese
fcd195050f
[maps] fix Map orphans sources on layer deletion (#159067)
Fixes https://github.com/elastic/kibana/issues/158133

Sources where not getting removed because `return` was used instead of
`continue` in `for...in` loop. This caused the function to return
instead of processing remaining sources.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-06 14:34:40 -06:00
Drew Tate
f630d90697
[Lens] library annotation groups (#152623) 2023-05-31 16:41:21 -04:00
Nathan Reese
47eed48cde
[maps] replace 'refresh: true' with 'refresh: wait_for' (#158220)
Fixes https://github.com/elastic/kibana/issues/157657

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-30 10:01:31 -06:00
Nathan Reese
94d4574b58
[maps] move routes from /api/maps to /internal/maps and add route versioning (#158328)
Fixes https://github.com/elastic/kibana/issues/157104 and
https://github.com/elastic/kibana/issues/156323

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-30 07:51:12 -06:00
Nathan Reese
ff8cebb407
[maps] fix size legend does not indicate when min or max clamped by std range (#156927)
Fixes https://github.com/elastic/kibana/issues/156907 and
https://github.com/elastic/kibana/issues/133810

Display `>` when max is clamped by standard deviation
<img width="200" alt="Screen Shot 2023-05-05 at 3 33 11 PM"
src="https://user-images.githubusercontent.com/373691/236572440-a0395094-5a70-45f8-b64a-dd4ecdc1412a.png">

Bottom label is not cut off when pixel size is 1
<img width="200" alt="Screen Shot 2023-05-05 at 3 33 18 PM"
src="https://user-images.githubusercontent.com/373691/236572444-51b5af9e-fa31-4033-a671-0a9642d10e3e.png">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-30 07:28:45 -06:00
Nathan Reese
33f5bb6ba5
[maps] fix toolbar action button not filled when selected (#158284)
Fixes https://github.com/elastic/kibana/issues/158221

Updated CSS selector to look for any class containing
"euiButtonIcon-fill" instead of old "euiButtonIcon--fill". Had to use
wild card select because class name as dynamic id in it, for example
"css-1q7ycil-euiButtonIcon-empty-primary-hoverStyles"

Now, button is filled and icon is white when selected.
<img width="400" alt="Screen Shot 2023-05-23 at 10 34 42 AM"
src="821d95da-df7a-4779-a7fa-2ce2aa61fa7d">

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-26 06:20:48 -06:00
Nathan Reese
34e26250f0
[tsvb] read only mode (#157920)
part of https://github.com/elastic/kibana/issues/154307

PR adds ability to put TSVB into read only mode - preventing TSVB
visualizations from being created and edited.

To test:
* start kibana with `yarn start --serverless=es`
* add `vis_type_timeseries.readOnly: true` to kibana.yml

Visualization public plugin changes:
* Removes `hideTypes` from VisualizationSetup contract. Used by Maps
plugin to set "hidden" to true for tile_map and region_map visualization
types. In 8.0, tile_map and region_map visualization type registration
moved into maps plugin so `hideTypes` no longer needed.
* Renamed vis type definition `hidden` to `disableCreate`.
* Added `disableEdit` to vis type definition.
* Hide edit link in dashboard panel options when `disableEdit` is true
* Does not display links and edit action in listing table when
`disableEdit` is true

Visualization server plugin changes:
* Add `readOnlyVisType` registry to set up contract
* Update visualization savedObject.management.getInAppUrl to return
undefined when vis type has been registered as readOnly.
* Prevents "readOnly "visualization types from being displayed in global
search results
* Prevents "readOnly "visualization types from having links in saved
object management listing table.

Timeseries server plugin changes:
* Add `readOnly` yaml configuration
* Expose `readOnly` yaml configuration to public
* When `readOnly` is true, call
VisualizationsServerSetup.registerReadOnlyVisType to mark vis type as
read only

Timeseries public plugin changes:
* Set disableCreate and disableEdit to true when `readOnly` is true

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-05-24 15:28:25 -06:00
Matthew Kime
5fa2226b06
[data views] Content management api implementation (#155803)
## Summary

Data views implements the content management api and associated minor
changes. The bulk of the changes are in
`(common|public|server)/content_management)`

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Lukas Olson <olson.lukas@gmail.com>
2023-05-24 13:29:59 -05:00
Nathan Reese
bb1cf6609a
[maps] fix Maps don't display darktheme when user has dark theme enabled in profile (#158219)
Fixes https://github.com/elastic/kibana/issues/158050

PR updates `getIsDarkMode` to read value from theme$ instead of
UiSettings, since UiSettings does not contain profile theming. Part of
https://github.com/elastic/kibana/issues/158201

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-23 08:33:41 -06:00
Pierre Gayvallet
8453fe820a
Cleanup spread operators in reduce calls (#157471)
## Summary

The spread operator is costly and put pressure on GC. It should be
avoided when possible, especially in loops.

This PR adapts a lot of `reduce` calls in the codebase to remove the
usages of the diabolic spread operator, when possible.

Note: the PR is not fully exhaustive. I focused on the server-side, as
we're more directly impacted than on browser-side code regarding
performances.

## Removing `...` usages in `kittens.reduce()`

For `reduce` loops, the spread operator can usually easily be replaced:

#### - setting a value on the accum object and returning it

#### BAD
```ts
  return this.toArray().reduce(
      (acc, renderer) => ({
        ...acc,
        [renderer.name]: renderer,
      }),
      {} as Record<string, ExpressionRenderer>
    );
```

#### GOOD
```ts
  return this.toArray().reduce((acc, renderer) => {
      acc[renderer.name] = renderer;
      return acc;
    }, {} as Record<string, ExpressionRenderer>);
```


#### - assigning values to the accum object and returning it 

#### BAD
```ts
  const allAggs: Record<string, any> = fieldAggRequests.reduce(
      (aggs: Record<string, any>, fieldAggRequest: unknown | null) => {
        return fieldAggRequest ? { ...aggs, ...(fieldAggRequest as Record<string, any>) } : aggs;
      },
      {}
    );
```

#### GOOD
```ts
  const allAggs = fieldAggRequests.reduce<Record<string, any>>(
      (aggs: Record<string, any>, fieldAggRequest: unknown | null) => {
        if (fieldAggRequest) {
          Object.assign(aggs, fieldAggRequest);
        }
        return aggs;
      },
      {}
    );
```

#### - pushing items to the accum list and returning it 

#### BAD
```ts
  const charsFound = charToArray.reduce(
    (acc, char) => (value.includes(char) ? [...acc, char] : acc),
    [] as string[]
  );
```

#### GOOD
```ts
  const charsFound = charToArray.reduce((acc, char) => {
    if (value.includes(char)) {
      acc.push(char);
    }
    return acc;
  }, [] as string[]);
```

## Questions

#### Are you sure all the changes in this are strictly better for
runtime performances?

Yes, yes I am.

#### How much better?

Likely not much.

#### Are you planning on analyzing the perf gain?

Nope.

#### So why did you do it?

I got tired of seeing badly used spread operators in my team's owned
code, and I had some extra time during on-week, so I spent a few hours
adapting the usages in all our runtime/production codebase.

#### Was it fun?

Take your best guess.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-22 04:50:24 -07:00
Tomasz Kajtoch
b754a2df75
Upgrade EUI to v80.0.0 (#157939)
## Summary

`@elastic/eui@79.0.1`  `@elastic/eui@80.0.0`

---

## [`80.0.0`](https://github.com/elastic/eui/tree/v80.0.0)

- Improved the contrast ratio of meta labels within
`EuiSelectableTemplateSitewide` to meet WCAG AA guidelines.
([#6761](https://github.com/elastic/eui/pull/6761))
- Added `vulnerabilityManagementApp` glyph to `EuiIcon`
([#6762](https://github.com/elastic/eui/pull/6762))
- Added `logoVulnerabilityManagement` icon to `EuiIcon`
([#6763](https://github.com/elastic/eui/pull/6763))
- Added `onPanelChange` callback to `EuiContextMenu` to provide consumer
access to `panelId` and `direction`.
([#6767](https://github.com/elastic/eui/pull/6767))

**Bug fixes**

- Fixed `EuiComboBox` so `append` and `prepend` icon buttons are full
height and vertically centered.
([#6766](https://github.com/elastic/eui/pull/6766))
- Improved the uniformity of dropdown components by hiding the dropdown
icon of disabled `EuiComboBox`s.
([#6768](https://github.com/elastic/eui/pull/6768))

**Breaking changes**

- `EuiFieldNumber` now defaults the `step` prop to `"any"`
([#6760](https://github.com/elastic/eui/pull/6760))
- EUI now globally resets a default Chromium browser style that was
decreasing the opacity of disabled `select` items.
([#6768](https://github.com/elastic/eui/pull/6768))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-18 18:52:40 +02:00
Nathan Reese
596c7b3e70
[maps] distance spatial join (#156618)
Fixes https://github.com/elastic/kibana/issues/154605

PR adds new layer wizard for spatial join. Wizard provides an easy
interface to create spatial join as well as advertising the capability
in the main layer creation work flow.
<img width="200" alt="Screen Shot 2023-05-04 at 12 16 45 PM"
src="https://user-images.githubusercontent.com/373691/236293473-8a740171-0910-4574-8e38-0ba1ab38a5fd.png">
<img width="400" alt="Screen Shot 2023-05-04 at 12 17 07 PM"
src="https://user-images.githubusercontent.com/373691/236293475-ad04cb1c-b49f-46aa-8ae6-2df62123b516.png">

PR renames `Terms joins` editor panel to `Joins` and updates panel to
accommodate spatial joins. Displays UI for creating, editing and
deleting spatial joins.
<img width="200" alt="Screen Shot 2023-05-04 at 12 17 20 PM"
src="https://user-images.githubusercontent.com/373691/236293486-49aa8063-0860-4aa7-af85-e47f899a3885.png">
<img width="400" alt="Screen Shot 2023-05-04 at 12 41 39 PM"
src="https://user-images.githubusercontent.com/373691/236298721-e237b801-0539-4960-82e6-d992f5bd8bb4.png">
<img width="300" alt="Screen Shot 2023-05-04 at 12 17 25 PM"
src="https://user-images.githubusercontent.com/373691/236293489-b18c7a0a-b339-42f0-870d-88785175c1f6.png">
<img width="300" alt="Screen Shot 2023-05-04 at 12 17 37 PM"
src="https://user-images.githubusercontent.com/373691/236293492-f4ea3b9b-d28d-46d8-a243-c0e82cb5efda.png">

PR also updates inspector request registration name and description to
provide less technical names that provide better meaning of what request
is fetching and how everything fits together. I think this really helps
understandability of join requests
<img width="500" alt="Screen Shot 2023-05-04 at 12 22 56 PM"
src="https://user-images.githubusercontent.com/373691/236294739-53d32f65-a5e5-4b6d-b41a-7f76fcd731b5.png">


#### Known issues
Issues discovered by this PR that are in main and will be resolved
separately.
* When using spatial join wizard, if there are no matches to left source
then layer gets stuck in loading state
https://github.com/elastic/kibana/issues/156630
* Term join left field change not applied as expected
https://github.com/elastic/kibana/issues/156631

#### Developer level changes

LayerDescriptor
* Changes joins from `JoinDescriptor` to `Partial<JoinDescriptor>`. This
did not change the content, just updated the type to better reflect
contents.

JoinDescriptor
* Changes right from `JoinSourceDescriptor` to
`Partial<JoinSourceDescriptor>`. This did not change the content, just
updated the type to better reflect contents.

IVectorLayer interface changes
* Remove getJoinsDisabledReason
* Remove showJoinEditor

IVectorSource interface changes
* Replaced showJoinEditor with supportsJoins
* Removed getJoinsDisabledReason

Replaced GeoIndexPatternSelect prop `value` with `dataView`.
1) provides better symmetry since on change return DataView
2) First time GeoIndexPatternSelect need to use a pre-loaded data view.
By passing in DataView, loading state can be more easily handled.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
2023-05-17 06:20:04 -06:00
Nathan Reese
556ba07452
[maps] fix double encoding MVT request body (#157788)
Fixes https://github.com/elastic/kibana/issues/157219

On the client, `URLSearchParams.set` encodes strings. On the server,
`query` values are passed to the route decoded. Therefore, there is no
need for special encoding or decoding of requestBody, other then rison
encoding.

PR creates `getTileUrlParams` to standardize vector tile URL creation
across sources. `getTileUrlParams` is placed in a package so it can be
used in integration tests. This greatly increases the maintainability of
integration tests as it makes them ore readable and creates tileUrls
just like the client does to ensure testing is as close to the real
thing as possible.

PR also updates getTileUrl generation to only pick requestBody keys used
by vector tile routes to avoid sending unnecessary data to the server.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-16 14:45:40 -06:00
Matthew Kime
a4a2e86faa
[content mgmt / maps] Saved Object wrapper for Content Management API (#155680)
## Summary

Abstract class for implementing content storage for saved objects. 

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-16 07:11:21 -07:00
Cee Chen
b9ea4ce4f5
Upgrade EUI to v79.0.1 (#156925)
## Summary

`eui@77.2.2`  `eui@79.0.1`

🦴 The primary changes in this upgrade are around the deprecated
`EuiLoadingContent` being removed in favor of `EuiSkeletonText`.
- Most instances have been a [direct swap of
usage](327626a7be),
but [some replacements were a bit more
opinionated](e6ceb36a75)
as I saw them as potential to take advantage of `EuiSkeletonText`'s
syntactical sugar and screen reader announcements for when state
switches to loaded.

---

## [`79.0.1`](https://github.com/elastic/eui/tree/v79.0.1)

**Bug fixes**

- Fixed broken push `EuiFlyout` behavior
([#6764](https://github.com/elastic/eui/pull/6764))


## [`79.0.0`](https://github.com/elastic/eui/tree/v79.0.0)

- Updated all `EuiSkeleton` components with new props that allow for
more control over screen reader live announcements:
`announceLoadingStatus`, `announceLoadedStatus`, and `ariaLiveProps`
([#6752](https://github.com/elastic/eui/pull/6752))
- Improved keyboard accessibility in `EuiPageHeader` by ensuring the
right side menu items come into focus from left to right.
([#6753](https://github.com/elastic/eui/pull/6753))

**Breaking changes**

- Removed deprecated `EuiLoadingContent`. Use the `EuiSkeleton`
components instead. ([#6754](https://github.com/elastic/eui/pull/6754))


## [`78.0.0`](https://github.com/elastic/eui/tree/v78.0.0)

- Improved the contrast ratio of `EuiCheckbox`, `EuiRadio`, and
`EuiSwitch` in their unchecked states to meet WCAG AA guidelines.
([#6729](https://github.com/elastic/eui/pull/6729))
- Added React Testing Library `*ByTestSubject` custom commands to
`within()`. RTL utilities can be imported from
`@elastic/eui/lib/test/rtl`.
([#6737](https://github.com/elastic/eui/pull/6737))
- Updated `EuiAvatar` to support a new letter `casing` prop that allow
customizing text capitalization
([#6739](https://github.com/elastic/eui/pull/6739))
- Updated `EuiFocusTrap` to support the `gapMode` prop configuration
(now defaults to `padding`)
([#6744](https://github.com/elastic/eui/pull/6744))

**Bug fixes**

- Fixed inconsistency in `EuiSearchBar`'s AND/OR semantics between DSL
and query string generation
([#6717](https://github.com/elastic/eui/pull/6717))
- Fixed `EuiFieldNumber`'s native browser validity detection causing
extra unnecessary rerenders
([#6741](https://github.com/elastic/eui/pull/6741))
- Fixed the `scrollLock` property on `EuiFocusTrap` (and other
components using `EuiFocusTrap`, such as `EuiFlyout` and `EuiModal`) to
no longer block scrolling on nested portalled content, such as combobox
dropdowns ([#6744](https://github.com/elastic/eui/pull/6744))

**Breaking changes**

- `EuiAvatar`s with the default `user` type will now default to
capitalizing all initials in uppercase
([#6739](https://github.com/elastic/eui/pull/6739))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-15 16:09:31 -05:00