Commit graph

1067 commits

Author SHA1 Message Date
Nathan Reese
06b026c114
[maps] fix uncaught errors thrown during layer data fetching (#172501)
Fixes https://github.com/elastic/kibana/issues/172500

PR resolves the issue by not re-throwing errors in GeoJsonVectorLayer
and MvtVectorLayer syncData methods. Error state is stored in data
request and displayed to users. Errors are thrown to stop the flow of
execution for syncData.
2023-12-05 08:39:17 -07:00
Tim Sullivan
f044bcccdb
[shared-ux] no-data analytics page package code cleanup (#172416)
## Summary

1. Update "type" in kibana.jsonc files where applicable for improvement
to developer experience.
2. Create `@kbn/content-management-table-list-view-table-common` package
and update imports

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-04 13:07:59 -07:00
Marta Bondyra
37d5aca592
[Maps] Fix long field truncation on Comboboxes (#171829)
## Summary

Fixes https://github.com/elastic/kibana/issues/171509 (fixed in all the
places in maps)

Adds middle truncation and combobox auto-expansion to the content to
approximate of 60 character maximum for `SingleFieldSelect` and
`FieldSelect` components in maps.
I removed custom `renderOption` prop so the combobox can take care of
the proper truncation while searching through the fields. One case I had
to hack was to display a tooltip for a disabled state. I used `prepend`
and some custom styling to do so - it works as before (check out the
screenshot below).

<details>
 <summary> FieldSelect component before</summary>
<img width="471" alt="Screenshot 2023-11-22 at 16 08 21"
src="eb8a682a-0dfe-4bb0-9a88-8dc5863a5aff">

</details>

<details>
 <summary> FieldSelect component after</summary>
<img width="582" alt="Screenshot 2023-11-22 at 16 10 02"
src="b840fb7e-0789-46b7-b783-8e0aadb270ac">

</details>

<details>
 <summary> SingleFieldSelect component before</summary>
<img width="430" alt="Screenshot 2023-11-23 at 10 23 15"
src="fc4af30c-32ad-40d8-a051-4b123be8aa54">
</details>

<details>
 <summary> SingleFieldSelect component after</summary>
<img width="576" alt="Screenshot 2023-11-22 at 16 32 43"
src="2c3f496e-2e1b-4cf9-aa5b-f38c7a7eace2">

#### disabled state 
<img width="829" alt="Screenshot 2023-11-22 at 17 10 48"
src="8db0b076-d3f5-4ec4-9e7c-0e7121b14e04">

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-29 13:49:41 +01:00
Nathan Reese
d81c367850
[maps] fix tile errors displayed when layer is no longer using tiles (#172019)
Closes https://github.com/elastic/kibana/issues/172013

PR updates TileStatusTracker to clear tile error cache when layer is not
tiled.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-28 12:38:58 -07:00
Nathan Reese
76f6dc3d13
[maps] ignore indices without geometry field in vector tile requests (#171472)
Closes https://github.com/elastic/kibana/issues/170656

PR adds exists filter to ensure geo field exists 

### Test instructions
1. In console, run:
    ```
    PUT geo1
    {}

    PUT geo1/_mapping
    {
      "properties": {
        "location": {
          "type": "geo_point"
        }
      }
    }

    PUT geo1/_doc/1
    {
      "location": "25,25"
    }

    PUT geo2
    {}

    PUT geo2/_doc/1
    {}
    ```
2. Create `geo*` data view
3. create new map
4. add documents layer from `geo*` data view.
5. Add heatmap layer from `geo*` data view.
6. Verify geo1 data is displayed and warning is not displayed fro geo2
shard failures

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-22 12:37:52 -07:00
Hannah Mudge
8eaebb6d47
[Dashboard Navigation] Add Links to Visualization library (#170810)
Closes https://github.com/elastic/kibana/issues/162840

## Summary

This PR adds a visualization alias for the new Links embeddable so that
all Links library items can be managed/edited from the Visualization
library, like so:


8541506b-cfdd-4a2f-8bc2-841220def7a3

However, in order to get the above working, it was unfortunately not as
simple as just adding a visualization alias. Because the Links
embeddable does not have a dedicated editing app (all editing/creation
is done through a flyout), the usual `aliasPath` + `aliasApp` redirect
that happens for editing an alias did not work in this case.

To get around this, I've had to make changes to how aliases are
registered, as well as both the Visualization `VisualizeListing`
component and the generic `TableListViewTableComp` content management
component:

- **Summary of visualization alias changes:**

First off, I made changes to the typing of aliases - specifically,
rather than taking two independent `aliasPath` and `aliasApp` props,
I've combined them into a singular `alias` prop which will either be of
type `{ alias: string; path: string; }` or `{ embeddableType: string;
}`. This makes it easier to determine (a) whether a visualization is of
type `BaseVisType` or `VisTypeAlias` and (b) if it **is** of type
`VisTypeAlias`, how the editing of that vis should be handled.
Specifically, if `alias` is of type `{ alias: string; path: string; }`,
then it is a normal visualization and behaviour should be the same as it
was previously; however, if it is of type `{ embeddableType: string; }`,
then this is an **inline** alias - i.e. editing should be done inline
via the embeddable factory's edit method.

- **Summary of `VisualizeListing`  changes**

The primary changes here were made to the `editItem` callback -
specifically, if the fetched saved object has neither an `editApp` nor
an `editUrl`, then it will now try to fetch the embeddable factory for
the given saved object type and, if this factory exists, it will call
the `getExplicitInput` method in order to handle editing.

- **Summary of `TableListViewTableComp` changes**

Previously, an error would be thrown if both a `getDetailViewLink` and
an `onClickTitle` prop were provided - while I understand the original
reasoning for adding this catch, this no longer works if we want to
support inline editing like this. In this case, I needed **only** the
Link embeddable items to have an `onClick` while keeping the behaviour
for other visualizations the same (i.e. all other visualization types
should continue to link off to their specific editor apps) - however,
since this method is not provided **per item**, I had no way of making
an exception for just one specific item type.

Therefore, to get around this, it is now considered to be valid for
**both** the `getDetailViewLink` and `onClickTitle` props to be defined
for the `TableListViewTableComp` component. In order to prevent conflict
between the two props, I have made it so that, if both are provided,
`getDetailViewLink` **always takes precedence** over `onClickTitle` - in
this case, `onClickTitle` will **only** be called if `getDetailViewLink`
returns `undefined` for a given item. I have added a comment to
hopefully make this clear for consumers.

### 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] 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)
2023-11-22 10:37:27 -07:00
Nathan Reese
95a8d6a18f
[fix] Using max_result_window to set up MVT size request leads to not showing all results (#171344)
Closes https://github.com/elastic/kibana/issues/170272

The cause of the problem is that Maps is not setting
[_mvt](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-vector-tile-api.html)
`size` parameter.

Lets illustrate the problem with an example.
* index.max_result_window is set to 20,000.
* There are 15,000 hits matching the query for the tile, but because
`size` is not provided, the tile returns the default size value of
10,000 hits.
* Tile request sets `track_total_hits` to 20,001. Tile meta returns
`"hits.total.relation": "eq"` and `"hits.total.value": 15000`
properties, indicating that all possible hits are returned in the tile.
* Maps UI does not display "incomplete results" even though 5000 hits
are not contained in the tile.
* This happens because `hits.total` properties from tile meta is used to
indicate "incomplete results" and the returned value indicates that all
results are contained in the tile. We know this is not true because the
tile actually only returned 10,000 hits and not all 15,000 matching
hits. Thus, without setting `size`, the tile is not returning all of the
hits indicated by `track_total_hits`.

### test instructions
1. install web logs sample data set
2. In dev tools, run the following
    ```
    POST kibana_sample_data_logs/_doc/
    {
      "geo": {
        "coordinates": "59,-106.5"
      },
      "@timestamp": "2023-08-01"
    }

    PUT /kibana_sample_data_logs/_settings
    {
      "index" : {
        "max_result_window" : 20000
      }
    }
    ```
3. Create new map
4. Set time range to `1 year ago to 1 year from now` to display all web
logs data
5. add documents layer. Verify point circled in image is displayed.
Without changes, this point would not be returned in the tile because
the tile would only return the first 10000 matches.
<img width="500" alt="Screenshot 2023-11-15 at 11 31 25 AM"
src="2249d571-24c4-41ad-975e-d44ee6d246ce">
2023-11-16 12:11:13 -07:00
Nathan Reese
0b24e40b54
[maps] display incomplete results warning in layer legend (#171144)
Closes https://github.com/elastic/kibana/issues/170653
Closes https://github.com/elastic/kibana/issues/170654

PR updates Maps to display incomplete result warnings in layer legend
(instead of displaying toast)

### Test setup
1. In console, run:
    ```
    PUT geo1
    {}

    PUT geo1/_mapping
    {
      "properties": {
        "location": {
          "type": "geo_point"
        }
      }
    }

    PUT geo1/_doc/1
    {
      "location": "25,25"
    }

    PUT geo2
    {}

    PUT geo2/_mapping
    {
      "properties": {
        "location": {
          "type": "geo_point"
        }
      }
    }

    PUT geo2/_doc/1
    {
      "location": "35,35"
    }
    ```
2. Create `geo*` data view

### Test vector tile request warning
"View details" button for vector tile requests is out of scope for this
PR. Vector tile requests use _mvt API instead of _search API. As such,
vector tile requests do not use search source or request inspector.

1. create new map, add documents layer from `geo*` data view.
2. add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "geo2"
          }
        ]
      }
    }
    ```
<img width="400" alt="Screenshot 2023-11-13 at 2 08 06 PM"
src="8b608400-79d0-4800-9980-5af76b507a43">

### Test geojson incomplete results warning with single request
1. create new map, add documents layer from `geo*` data view.
2. Set scaling to "Limit results to 10000"
3. add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "geo2"
          }
        ]
      }
    }
    ```
<img width="400" alt="Screenshot 2023-11-13 at 2 11 48 PM"
src="e1b1de01-1db7-40ad-b221-29f42baf5735">

### Test geojson incomplete results warning with multiple requests
1. create new map, add documents layer from `geo*` data view.
2. Set scaling to "Show clusters when results exceed 10000"
3. add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "geo2"
          }
        ]
      }
    }
    ```
<img width="400" alt="Screenshot 2023-11-13 at 2 12 57 PM"
src="27beffc4-1dba-4ec4-90f8-e92002f8a63a">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-16 12:09:43 -07:00
Alejandro Fernández Haro
fd09c26d15
async-import plugins in the server side (#170856)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-15 00:55:56 -07:00
Nathan Reese
f9870c160d
On search source error, show 'view details' action that opens request in inspector (#170790)
Closes https://github.com/elastic/kibana/issues/167904

PR updates `EsError` with `getActions` method that returns "View
details" button. Clicking "View details" opens inspector to request that
failed. PR updates Discover and maps to display EsError action.

PR does not update lens to display "View details". Chatted with
@drewdaemon and the implementation path is more involved. This will be
completed in another PR.

### Test setup
1. install sample web logs

### Test discover with EsError
1. open discover 
2. Add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "kibana_sample_data_logs"
          }
        ]
      }
    }
    ```
3. Verify `View details` action is displayed and clicking action opens
inspector
<img width="300" alt="Screenshot 2023-11-07 at 12 53 31 PM"
src="6b43e9c8-daab-4782-876e-ded6958d15cf">

### Test search embeddable with EsError
1. create new dashboard. Add saved search from `kibana_sample_data_logs`
data view
2. Add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "kibana_sample_data_logs"
          }
        ]
      }
    }
    ```
3. Verify `View details` action is displayed and clicking action opens
inspector
<img width="300" alt="Screenshot 2023-11-07 at 12 55 46 PM"
src="5ebe37c6-467a-4d72-89e3-21fc53f59d89">

### Test discover with PainlessError
<img width="300" alt="Screenshot 2023-11-07 at 12 52 51 PM"
src="6d17498f-657c-46e8-86e8-dde461599267">

### Test Maps error
1. create new map
2. Add `documents` layer
3. Set scaling to "limit to 10000"
4. Add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "kibana_sample_data_logs"
          }
        ]
      }
    }
    ```
5. Verify "View details" button is displayed in maps legend in error
callout
<img width="500" alt="Screenshot 2023-11-08 at 12 07 42 PM"
src="2eb2cc41-0919-49a3-9792-fda9707973cb">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-14 14:52:24 -07:00
Nathan Reese
0d5f83da2b
[maps] fix blank screen when switching to Full Screen (#170915)
Fixes https://github.com/elastic/kibana/issues/170467

### test instructions
1. create new map
2. Click "Full screen"
3. Verify map is displayed
2023-11-14 09:30:08 -07:00
Nathan Reese
3c0ba20369
[maps] fix vector tile layer with joins stuck in loading state when not visible (#170984)
Closes https://github.com/elastic/kibana/issues/170983

### Test instructions
1. Download world countries geojson from
https://maps.elastic.co/v8.12/index.html?locale=en#file/world_countries
2. upload downloaded world countries
3. create new map
4. add "Choropleth" layer
5. Set boundaries source to "Points, lines, and polygons from
elasticsearch". Select world countries data view. Set join field to
"iso2"
6. Set statistics view to kibana sample web logs. Set join field to
"geo.src"
7. minimize layer TOC
8. save map and re-open.
9. Minimized layer legend icon should stop showing loading state once
EMS base map is loaded

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-10 08:20:25 -07:00
Nathan Reese
bc2202df1a
[maps] fix expand layer control is not clickable when layers are loading (#170912)
Closes https://github.com/elastic/kibana/issues/170911

root problem is that `EuiButton*` components are disabled when passed
`isLoading` property. Re-worked component to not pass `isLoading` to
`EuiButton*`

### Test instructions
1. create new map
2. click "Collapse layers panel" to collapse layer control
3. open browser dev tools. Open network tab and select "Slow 3G"
4. Pan and zoom map to cause basemap tiles to load. "Expand layers
panel" button should be clickable during loading

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-10 07:00:05 -07:00
Nathan Reese
30c17e0222
[maps] fix layer shows no data instead of error (#170084)
Closes https://github.com/elastic/kibana/issues/169545
Closes https://github.com/elastic/kibana/issues/170657

While investigating https://github.com/elastic/kibana/issues/169545, it
was determined that Maps current error handling leaves a lot to be
desired. This PR cleans up several problems at once since they are all
intertwined.

#### Problem 1 - layer error removed when another data request finished
Redux store contains error state in a single location, `__errorMessage`
key in `LayerDescriptor`. This resulted in other operations, like
"fitting to bounds", "fetching supports feature state", or "fetching
style meta" clearing layer error state.

#### Solution to problem 1
Redux store updated to contain isolated error state
1) `error` key added `DataRequestDescriptor`, allowing each data request
to store independent error state. This will capture data fetching errors
when fetching features and join metrics.
2) `error` key added to `JoinDescriptor`, allowing each join to store
independent error state. This will capture join errors like mismatched
join keys
3) `__tileErrors` added to `LayerDescriptor`, allowing each tile error
to be stored independently. This will capture tile fetch errors.

#### Problem 2 - tile status tracker clears error cache when map center
tile changes
This resulted in removing tile errors that may still be relevant if
tiles have not been refetched.

#### Solution to problem 2
Updated tile status tracker to only clear a tile error when the tile is
reloaded.

#### Problem 3 - Tile Errors do not surface elasticsearch ErrorCause
This results in useless error messages like in the screen shot below
<img width="300" alt="Screenshot 2023-11-01 at 2 39 01 PM"
src="75546228-24c6-4855-bea7-39ed421ee3f4">

#### Solution to problem 3
Updated tile status tracker to read and persist elasticsearch ErrorCause
from tile error. Now tile error messages contain more relevant
information about the problem.
<img width="200" alt="Screenshot 2023-11-03 at 9 56 41 AM"
src="b9ddff98-049e-4f22-8249-3f5988fa93a5">

#### Problem 4 - error UI is not interactive when layer editor is not
available, in dashboards or read only user

#### Solution to problem 4
* Updated layer tooltip to only display error title
<img width="200" alt="Screenshot 2023-11-03 at 11 22 50 AM"
src="6943aead-a7d6-4da3-8ecc-bb6065e0406a">
* Moved error callout from editor to legend so its visible when map is
in dashboard and by readonly users.
<img width="200" alt="Screenshot 2023-11-03 at 11 23 45 AM"
src="358fe133-4c5a-4f06-a03e-e96a16b7afb6">

Moving error details from tooltip to legend allowed error details to
contain interactive elements. For example, display a tile picker so that
users can see each tile's error. This will be useful in the future where
search source requests can display "view details" button that opens
request in inspector.

#### Problem 5 - error UI displayed as warning
This results in inconsistent view between kibana applications

#### Solution to problem 5
Updated error UI to use danger callout and error icon

### test instructions
1) install sample web logs
2) create map
3) add documents layer with vector tiles scaling
4) add documents layer with geojson scaling
5) add join layer
6) add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "kibana_sample_data_logs"
          }
        ]
      }
    }
    ```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-06 17:00:15 -07:00
Cee Chen
d079e9573d
Upgrade EUI to v90.0.0 (#170179)
`v89.1.0``v90.0.0`

The majority of changes in this PR come from:

- **EuiContextMenu** being converted to Emotion
(https://github.com/elastic/eui/pull/7312). If your usage of
`EuiContextMenu` was significantly affected, we recommend pulling down
this PR and QAing it locally.

- `defaultProps` being removed from some very widespread components,
particularly **EuiButton**, in anticipation of React's upcoming
deprecation.
(b7dc9b4e89)
**NOTE**: This only affected Enzyme snapshots, and did not affect
production behavior.

[Commits](https://github.com/elastic/kibana/pull/170179/commits) have
been broken up by component changes as well as types of changes.

---

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

- Updated the `eventColor` prop on `EuiCommentEvent` to apply the color
to the entire comment header.
([#7288](https://github.com/elastic/eui/pull/7288))
- Updated `EuiBasicTable` and `EuiInMemoryTable` to support a new
controlled selection API: `selection.selected`
([#7321](https://github.com/elastic/eui/pull/7321))

**Bug fixes**

- Fixed controlled `EuiFieldNumbers` not correctly updating native
validity state ([#7291](https://github.com/elastic/eui/pull/7291))
- Fixed `EuiListGroupItem` to pass `style` props to the wrapping `<li>`
element alongside `className` and `css`. All other props will be passed
to the underlying content.
([#7298](https://github.com/elastic/eui/pull/7298))
- Fixed `EuiListGroupItem`'s non-transitioned transform on hover/focus
([#7298](https://github.com/elastic/eui/pull/7298))
- Fixed `EuiDataGrid`s with `gridStyle.stripes` sometimes showing buggy
row striping after being sorted
([#7301](https://github.com/elastic/eui/pull/7301))
- Fixed `EuiDataGrid`'s `gridStyle.rowClasses` API to not conflict with
`gridStyle.stripes` if dynamically updated
([#7301](https://github.com/elastic/eui/pull/7301))
- Fixed `EuiDataGrid`'s `gridStyle.rowClasses` API to support multiple
space-separated classes
([#7301](https://github.com/elastic/eui/pull/7301))
- Fixed `EuiInputPopover` not calling `onPanelResize` callback prop
([#7305](https://github.com/elastic/eui/pull/7305))
- Fixed `EuiDualRange` incorrectly positioning highlights when rendered
with `showInput="inputWithPopover"`
([#7305](https://github.com/elastic/eui/pull/7305))
- Fixed `EuiTabs` incorrectly wrapping text when it should instead
either scroll or truncate
([#7309](https://github.com/elastic/eui/pull/7309))
- `EuiContextMenu` now renders text colors correctly when used within an
`EuiBottomBar` ([#7312](https://github.com/elastic/eui/pull/7312))
- Fixed the width of `EuiSuperDatePicker`'s Absolute date picker
([#7313](https://github.com/elastic/eui/pull/7313))
- Fixed `EuiDataGrid` cells visually cutting off overflowing content a
little too quickly ([#7320](https://github.com/elastic/eui/pull/7320))

**Deprecations**

- Deprecated `EuiBasicTable` and `EuiInMemoryTable`'s ref `setSelection`
API. Use the new `selection.selected` API instead.
([#7321](https://github.com/elastic/eui/pull/7321))

**Breaking changes**

- Removed `EuiPageTemplate_Deprecated`, `EuiPageSideBar_Deprecated`, and
`EuiPageContent*_Deprecated`
([#7265](https://github.com/elastic/eui/pull/7265))
- Removed the `ghost` color option from `EuiButton`, `EuiButtonEmpty`,
and `EuiButtonIcon`. Use an `<EuiThemeProvider colorMode="dark">`
wrapper and `color="text"` instead.
([#7296](https://github.com/elastic/eui/pull/7296))

**Dependency updates**

- Updated `refractor` to v3.6.0
([#7127](https://github.com/elastic/eui/pull/7127))
- Updated `rehype-raw` to v5.1.0
([#7127](https://github.com/elastic/eui/pull/7127))
- Updated `vfile` to v4.2.1
([#7127](https://github.com/elastic/eui/pull/7127))

**Accessibility**

- `EuiContextMenu` now correctly respects reduced motion preferences
([#7312](https://github.com/elastic/eui/pull/7312))
- `EuiAccordion`s no longer attempt to focus child content when the
accordion is externally opened via `forceState`, but will continue to
focus expanded content when users click the toggle button.
([#7314](https://github.com/elastic/eui/pull/7314))

**CSS-in-JS conversions**

- Converted `EuiContextMenu`, `EuiContextMenuPanel`, and
`EuiContextMenuItem` to Emotion; Removed `$euiContextMenuWidth`
([#7312](https://github.com/elastic/eui/pull/7312))
2023-11-03 10:19:31 -07:00
Nathan Reese
dbc64e526e
[maps] only show vector tile inspector panel when map uses elasticsearch vector tile API (#170043)
Closes https://github.com/elastic/kibana/issues/170042

PR disables vector tile adapter when map does not contain vector tile
layers

### Test
1) create new map
2) add documents layer
3) set scaling to "limit to 10000"
4) open inspector. Notice inspector only displays request adapter
5) change scaling to "vector tiles"
6) open inspector. Notice inspector displays vector tile adapter and
request adapter

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-10-30 12:06:23 -06: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