## 📓 Summary
Closes#153360
To correctly sync the brush selection with the time service there was
the need for a refactor on how we handle the host filters, simplifying a
bit the code implementation and re-using existing abstractions.
## 🧪 Testing
- Navigate to Hosts View
- Create an Inventory Alert that can easily trigger
- Reload the search until the alerts are triggered
- Click on the alerts tab to preview them
- Select a time range on the chart and see the changes reflected on the
chart and the time range globally applied.
https://user-images.githubusercontent.com/34506779/230015011-1b48deba-7c05-47df-80b1-37e8ee046b05.mov
---------
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Fixes https://github.com/elastic/kibana/issues/154375
### background
https://github.com/elastic/kibana/pull/105326 replaced tile_map
visualization implementation with a new implementation that is a wrapper
around MapEmbeddable.
https://github.com/elastic/kibana/pull/152952 removed geohash_grid
aggregation. This causes a regression where existing tile_map
visualizations no longer work. Even though geohash_grid aggregation is
no longer used, the AggType is still needed so that new tile_map
visualization wrapper can access aggregation configuration state.
This PR adds back geohash_grid AggType in `legacyAggs` for this purpose.
PR also adds a functional test to better prevent regressions with
tile_map
### Test
* install web logs sample data
* install legacy tile_map saved objects from
```
{"attributes":{"fieldFormatMap":"{\"hour_of_day\":{}}","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_logs"},"coreMigrationVersion":"7.17.5","id":"90943e30-9a47-11e8-b64d-95841ca0b247","migrationVersion":{"index-pattern":"7.11.0"},"references":[],"type":"index-pattern","updated_at":"2022-08-17T20:25:52.585Z","version":"WzEzMDQsMV0="}
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"},"title":"region_map","uiStateJSON":"{}","version":1,"visState":"{\"aggs\":[{\"enabled\":true,\"id\":\"1\",\"params\":{},\"schema\":\"metric\",\"type\":\"count\"},{\"enabled\":true,\"id\":\"2\",\"params\":{\"field\":\"geo.dest\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"size\":5},\"schema\":\"segment\",\"type\":\"terms\"}],\"params\":{\"addTooltip\":true,\"colorSchema\":\"Yellow
to
Red\",\"emsHotLink\":\"https://maps.elastic.co/v7.16?locale=en#file/world_countries\",\"isDisplayWarning\":true,\"legendPosition\":\"bottomright\",\"mapCenter\":[0,0],\"mapZoom\":2,\"outlineWeight\":1,\"selectedJoinField\":{\"description\":\"ISO
3166-1 alpha-2
code\",\"name\":\"iso2\",\"type\":\"id\"},\"selectedLayer\":{\"attribution\":\"<a
rel=\\\"noreferrer noopener\\\"
href=\\\"http://www.naturalearthdata.com/about/terms-of-use\\\">Made
with NaturalEarth</a> | <a rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.openstreetmap.org/copyright\\\">OpenStreetMap
contributors</a> | <a rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.elastic.co/elastic-maps-service\\\">Elastic Maps
Service</a>\",\"created_at\":\"2020-10-28T16:16:08.720286\",\"fields\":[{\"description\":\"ISO
3166-1 alpha-2
code\",\"name\":\"iso2\",\"type\":\"id\"},{\"description\":\"ISO 3166-1
alpha-3 code\",\"name\":\"iso3\",\"type\":\"id\"},{\"description\":\"ISO
3166-1 numeric
code\",\"name\":\"iso_numeric\",\"type\":\"id\"},{\"description\":\"name\",\"name\":\"name\",\"type\":\"property\"}],\"format\":\"topojson\",\"id\":\"world_countries\",\"isEMS\":true,\"layerId\":\"elastic_maps_service.World
Countries\",\"meta\":{\"feature_collection_path\":\"data\"},\"name\":\"World
Countries\",\"origin\":\"elastic_maps_service\"},\"showAllShapes\":true,\"wms\":{\"enabled\":false,\"options\":{\"attribution\":\"\",\"format\":\"image/png\",\"layers\":\"\",\"styles\":\"\",\"transparent\":true,\"version\":\"\"},\"selectedTmsLayer\":{\"attribution\":\"<a
rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.openstreetmap.org/copyright\\\">OpenStreetMap
contributors</a> | <a rel=\\\"noreferrer noopener\\\"
href=\\\"https://openmaptiles.org\\\">OpenMapTiles</a> | <a
rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.elastic.co/elastic-maps-service\\\">Elastic Maps
Service</a>\",\"id\":\"road_map\",\"maxZoom\":20,\"minZoom\":0,\"origin\":\"elastic_maps_service\"},\"url\":\"\"}},\"title\":\"region_map\",\"type\":\"region_map\"}"},"coreMigrationVersion":"7.17.5","id":"64a5b9f0-1e6b-11ed-833b-a105e9534fa9","migrationVersion":{"visualization":"7.17.0"},"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","updated_at":"2022-08-17T20:30:50.288Z","version":"WzE0MDIsMV0="}
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"},"title":"tile_map","uiStateJSON":"{\"mapZoom\":2,\"mapCenter\":[13.64385981167601,-135.97675761558068]}","version":1,"visState":"{\"title\":\"tile_map\",\"type\":\"tile_map\",\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"params\":{},\"schema\":\"metric\"},{\"id\":\"2\",\"enabled\":true,\"type\":\"geohash_grid\",\"params\":{\"field\":\"geo.coordinates\",\"autoPrecision\":true,\"precision\":2,\"useGeocentroid\":true,\"isFilteredByCollar\":true},\"schema\":\"segment\"}],\"params\":{\"colorSchema\":\"Yellow
to Red\",\"mapType\":\"Scaled Circle
Markers\",\"isDesaturated\":true,\"addTooltip\":true,\"heatClusterSize\":1.5,\"legendPosition\":\"bottomright\",\"mapZoom\":2,\"mapCenter\":[0,0],\"wms\":{\"enabled\":false,\"url\":\"\",\"options\":{\"version\":\"\",\"layers\":\"\",\"format\":\"image/png\",\"transparent\":true,\"attribution\":\"\",\"styles\":\"\"},\"selectedTmsLayer\":{\"origin\":\"elastic_maps_service\",\"id\":\"road_map\",\"minZoom\":0,\"maxZoom\":20,\"attribution\":\"<a
rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.openstreetmap.org/copyright\\\">OpenStreetMap
contributors</a> | <a rel=\\\"noreferrer noopener\\\"
href=\\\"https://openmaptiles.org\\\">OpenMapTiles</a> | <a
rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.elastic.co/elastic-maps-service\\\">Elastic Maps
Service</a>\"}}}}"},"coreMigrationVersion":"7.17.5","id":"4b073190-1e6b-11ed-833b-a105e9534fa9","migrationVersion":{"visualization":"7.17.0"},"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","updated_at":"2022-08-17T20:29:28.769Z","version":"WzEzNDksMV0="}
{"attributes":{"description":"","hits":0,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}"},"optionsJSON":"{\"useMargins\":true,\"syncColors\":false,\"hidePanelTitles\":false}","panelsJSON":"[{\"version\":\"7.17.5\",\"type\":\"visualization\",\"gridData\":{\"x\":24,\"y\":0,\"w\":24,\"h\":15,\"i\":\"ad02c99b-8bae-42e0-8a43-d27762f1e607\"},\"panelIndex\":\"ad02c99b-8bae-42e0-8a43-d27762f1e607\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_ad02c99b-8bae-42e0-8a43-d27762f1e607\"},{\"version\":\"7.17.5\",\"type\":\"visualization\",\"gridData\":{\"x\":0,\"y\":0,\"w\":24,\"h\":15,\"i\":\"8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee\"},\"panelIndex\":\"8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee\"}]","timeRestore":false,"title":"dash
with legacy map
visualizations","version":1},"coreMigrationVersion":"7.17.5","id":"97437d70-1e6b-11ed-833b-a105e9534fa9","migrationVersion":{"dashboard":"7.17.3"},"references":[{"id":"64a5b9f0-1e6b-11ed-833b-a105e9534fa9","name":"ad02c99b-8bae-42e0-8a43-d27762f1e607:panel_ad02c99b-8bae-42e0-8a43-d27762f1e607","type":"visualization"},{"id":"4b073190-1e6b-11ed-833b-a105e9534fa9","name":"8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee:panel_8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee","type":"visualization"}],"type":"dashboard","updated_at":"2022-08-17T20:31:36.656Z","version":"WzE0MzEsMV0="}
{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":4,"missingRefCount":0,"missingReferences":[]}
```
* Open dashboard and verify tile_map renders
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
> ⚠️ Synthetic failures are not related to any EUI changes and are
likely already failing on main. Please ignore the failing CI status when
reviewing.
## [`77.0.0`](https://github.com/elastic/eui/tree/v77.0.0)
**Bug fixes**
- Fixed named `EuiBadge` colors to reflect custom theme overrides
([#6659](https://github.com/elastic/eui/pull/6659))
- Fixed user-defined SCSS variables failing to override variables
defined in Amsterdam typography overrides.
([#6665](https://github.com/elastic/eui/pull/6665))
- Fixed bold `EuiCode` tokens to actually be bold
([#6666](https://github.com/elastic/eui/pull/6666))
**Breaking changes**
- Success- and accent-colored `EuiBadge`s and `EuiButton`s have had
their fill colors tinted slightly on light mode to be more readable
([#6659](https://github.com/elastic/eui/pull/6659))
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jon <jon@elastic.co>
## Summary
Part of https://github.com/elastic/kibana/pull/153070.
Cleans up the saved object mappings for search session saved objects.
Removes the non-searchable/sortable properties from the `mappings`
property and introduces a `schema` property for validation.
## Summary
When creating an ML inference pipeline that uses the new ELSER model, we
need to be able to specify which fields to apply it to, and where the
resulting values should go. These fields can then determine what mapping
changes need to be made to the underlying index (setting `rank_features`
fields).
This PR adds `field_mappings` as a param to our kibana endpoint for
creating these ML Inference pipelines, and based on that parameter,
attempts to update mappings.
A sample request might be:
```
curl -XPOST -u elastic:changeme "http://localhost:5601/mob/internal/enterprise_search/indices/search-test/ml_inference/pipeline_processors" \
-H 'kbn-xsrf: kibana' \
-H 'Content-Type: application/json' \
-d '{
"field_mappings": {
"input": "output"
},
"pipeline_definition": {
"description" : "text",
"processors": []
},
"pipeline_name": "test"
}' | jq
```
And sample output might be:
```
{
"created": "ml-inference-test",
"mapping_updated": true
}
```
OR
```
{
"statusCode": 409,
"error": "Conflict",
"message": "One or more target fields for this pipeline already exist with a type that is incompatible with the specified model. Ensure that each target field is unique and not already in use.",
"attributes": {
"error_code": "mapping_update_failed"
}
}
```
### 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
### 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)
## Summary
Closes https://github.com/elastic/kibana/issues/154585
Allow `PUT`ing partial request bodies for experimental features, which
ensures we don't break package policies from prior versions of Kibana
where not all experimental features were available.
Added an FTR test to catch the error, which is an API schema validation
one. Verified the test fails before the schema changes are made.
### Checklist
Delete any items that are not applicable to this PR.
- [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
## Summary
Fixes#152943
- Error message will no longer flash when switching notify when to `On
custom action intervals`
- Switching away and back to `On custom action intervals` will preserve
the throttle value as well as the throttle unit
This PR extends the case deletion functionality to delete any files that
are attached to the case when a case is deleted.
To avoid attempting to delete too many files at once I chunk case ids
into 50 at a time such that we're at most only deleting 5000 (50 case *
100 files per case) at once. That way we don't exceed the 10k find api
limit.
## Testing
Run the python script from here:
https://github.com/elastic/cases-files-generator to generate some files
for a case
Deleting the case should remove all files
## Summary
Shows shell name, shell execution return code, and current working
directory info along with the command execution output for `execute`
action response.
## Summary
This PR changes the type of `fieldMappings` in
`generateMlInferencePipelineBody()` to be an array of `FieldMapping`
elements (instead of `Record<string, string | undefined>`). There are no
functional changes.
## Summary
The purpose of this PR is to give users the ability to share a given
alert on the alert's page. This is possible via two changes. First, the
simple state of the details flyout is now stored in a url query param
`eventFlyout=(...flyoutState)`, when opened. Secondly, the addition of a
`Share Alert` button which allows users to share a link directly to the
alert page filtered for the given alert and the flyout opened.
### Caveats
1. **The share button is much more reliable than copying the url from
the browser url bar.**
Ideally storing the url state in the url should have been enough, but
because of the potential for relative time ranges in the global kql
query bar (which are also stored in the url), it it is possible to share
a url by copying the browser url that doesn't actually open the given
alert.
As an example: A user with a relative time range of `last 24 hours`
opens an alert that was created this morning with a colleague. The
colleague doesn't actually visit the link till the following afternoon.
When the user visits the link, they _may_ see the flyout open, but may
not actually see the associated alert in the alert table. This is
because the relative time range of `last 24 hours` doesn't contain the
alert that was opened the previous morning. The flyout _may_ open
because it is not constrained by the relative time range, but the
primary alert table may easily be out of sync. Given this, the `Share
Alert` button creates a custom url
`alerts/alertId?index='blah'×tamp='...'` which redirects the user
to the specific alert and time range of their given alert.
2. **Storing of the alert flyout url state only works on the alerts
page. The url state is not stored on the cases or rules pages.**
Although this flyout is used in multiple locations, we only want to
preserve it on this singular page to keep the user flow simple, and also
allow us to more smoothly transition to the future flyout experience.
## Demo
### Sharing via the browser url
https://user-images.githubusercontent.com/17211684/227567405-37589def-b1be-406e-802e-764b49bee5f6.mov
### Sharing via the `Share alert` button
https://user-images.githubusercontent.com/17211684/230382767-0e6bf3d0-6ed1-442f-921a-db5eeec7592f.mov
## Follow up work
Revert/Delete the changes of the old Alerts Page POC:
https://github.com/elastic/kibana/issues/154477