Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maps] Switch to SavedObjectClient.resolve #112606

Merged
merged 13 commits into from
Oct 5, 2021
Merged

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Sep 20, 2021

Part of #101177
Replaces #111195

Changes to lens plugin:

  • Moves SavedObjectConflictMessage to spaces so that Maps can use the same component to show conflicts in MapEmbeddable

Changes to spaces plugin:

  • Adds SavedObjectConflictMessage to spaces.ui.components interface to provide common component for displaying conflict error.

Changes to maps plugin:

  • Replaces savedObjectClient.get with savedObjectClient.resolve and adds logic to handle the resolve states: exactMatch, aliasMatch, and conflict.

exactMatch outcome

The behavior doesn't change

aliasMatch

For the dashboard, the behavior doesn't change.
For the editor, it redirects to the new url and displays the notification:

conflict

For the dashboard:
Screen Shot 2021-09-20 at 1 45 03 PM

For the editor:
Screen Shot 2021-09-20 at 1 46 08 PM

@nreese nreese added [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 labels Sep 20, 2021
@nreese nreese marked this pull request as ready for review September 20, 2021 21:21
@nreese nreese requested review from a team as code owners September 20, 2021 21:21
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@nreese
Copy link
Contributor Author

nreese commented Sep 22, 2021

@elasticmachine merge upstream

@jportner
Copy link
Contributor

@elasticmachine merge upstream

@jportner
Copy link
Contributor

@nreese we recently introduced some regressions in the client-side bulkResolve that will prevent us from testing this properly. After #113188 is merged into master, we can merge upstream into this branch again and I will be able to review/test this 👍

@ryankeairns
Copy link
Contributor

👋 @miukimiu will you be doing the review on behalf of kibana-design?

@jportner
Copy link
Contributor

@nreese we recently introduced some regressions in the client-side bulkResolve that will prevent us from testing this properly. After #113188 is merged into master, we can merge upstream into this branch again and I will be able to review/test this 👍

The linked PR is merged, so I'll merge upstream into this PR again and test it soon!

@jportner
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@jportner jportner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you took this PR over from Aaron, so let me know if you need any additional context on my comments. Overall this is looking great, some minor things need to be changed and that's about it!

I tested as follows:

  1. Start Kibana and add flights sample data
  2. Use the generate_resolve_staging_data script to generate staging data:
    POST .kibana/_bulk
    {"index":{"_id":"test1:index-pattern:d3d7af60-4c81-11e8-b3d7-01146121b73d-test1"}}
    {"index-pattern":{"fieldFormatMap":"{\"hour_of_day\":{\"id\":\"number\",\"params\":{\"pattern\":\"00\"}},\"AvgTicketPrice\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}}}","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_flights"},"coreMigrationVersion":"8.0.0","migrationVersion":{"index-pattern":"7.11.0"},"references":[],"type":"index-pattern","updated_at":"2021-09-29T18:21:11.033Z","namespace":"test1"}
    {"index":{"_id":"test2:index-pattern:d3d7af60-4c81-11e8-b3d7-01146121b73d-test2-newId"}}
    {"index-pattern":{"fieldFormatMap":"{\"hour_of_day\":{\"id\":\"number\",\"params\":{\"pattern\":\"00\"}},\"AvgTicketPrice\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}}}","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_flights"},"coreMigrationVersion":"8.0.0","migrationVersion":{"index-pattern":"7.11.0"},"references":[],"type":"index-pattern","updated_at":"2021-09-29T18:21:11.033Z","namespace":"test2"}
    {"index":{"_id":"test3:index-pattern:d3d7af60-4c81-11e8-b3d7-01146121b73d-test3"}}
    {"index-pattern":{"fieldFormatMap":"{\"hour_of_day\":{\"id\":\"number\",\"params\":{\"pattern\":\"00\"}},\"AvgTicketPrice\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}}}","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_flights"},"coreMigrationVersion":"8.0.0","migrationVersion":{"index-pattern":"7.11.0"},"references":[],"type":"index-pattern","updated_at":"2021-09-29T18:21:11.033Z","namespace":"test3"}
    {"index":{"_id":"test3:index-pattern:d3d7af60-4c81-11e8-b3d7-01146121b73d-test3-newId"}}
    {"index-pattern":{"fieldFormatMap":"{\"hour_of_day\":{\"id\":\"number\",\"params\":{\"pattern\":\"00\"}},\"AvgTicketPrice\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}}}","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_flights"},"coreMigrationVersion":"8.0.0","migrationVersion":{"index-pattern":"7.11.0"},"references":[],"type":"index-pattern","updated_at":"2021-09-29T18:21:11.033Z","namespace":"test3"}
    {"index":{"_id":"legacy-url-alias:test2:index-pattern:d3d7af60-4c81-11e8-b3d7-01146121b73d-test2"}}
    {"legacy-url-alias":{"targetNamespace":"test2","targetType":"index-pattern","targetId":"d3d7af60-4c81-11e8-b3d7-01146121b73d-test2-newId","sourceId":"d3d7af60-4c81-11e8-b3d7-01146121b73d-test2"},"type":"legacy-url-alias","references":[]}
    {"index":{"_id":"legacy-url-alias:test3:index-pattern:d3d7af60-4c81-11e8-b3d7-01146121b73d-test3"}}
    {"legacy-url-alias":{"targetNamespace":"test3","targetType":"index-pattern","targetId":"d3d7af60-4c81-11e8-b3d7-01146121b73d-test3-newId","sourceId":"d3d7af60-4c81-11e8-b3d7-01146121b73d-test3"},"type":"legacy-url-alias","references":[]}
    {"index":{"_id":"test1:map:5dd88580-1906-11e9-919b-ffe5949a18d2-test1"}}
    {"map":{"description":"","layerListJSON":"[{\"id\":\"0hmz5\",\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"isAutoSelect\":true},\"visible\":true,\"style\":{},\"type\":\"VECTOR_TILE\",\"minZoom\":0,\"maxZoom\":24},{\"id\":\"jzppx\",\"label\":\"Flights\",\"minZoom\":8,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"id\":\"040e0f25-9687-4569-a1e0-76f1a108da56\",\"type\":\"ES_SEARCH\",\"geoField\":\"DestLocation\",\"limit\":2048,\"filterByMapBounds\":true,\"tooltipProperties\":[\"Carrier\",\"DestCityName\",\"DestCountry\",\"OriginCityName\",\"OriginCountry\",\"FlightDelayMin\",\"FlightTimeMin\",\"DistanceMiles\",\"AvgTicketPrice\",\"FlightDelay\"],\"applyGlobalQuery\":true,\"scalingType\":\"MVT\",\"sortField\":\"timestamp\",\"indexPatternRefName\":\"layer_1_source_index_pattern\"},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}},\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"FlightDelayMin\",\"origin\":\"source\"},\"color\":\"Yellow to Red\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3},\"type\":\"ORDINAL\",\"useCustomColorRamp\":false}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":6}},\"iconOrientation\":{\"type\":\"STATIC\",\"options\":{\"orientation\":0}},\"labelText\":{\"type\":\"STATIC\",\"options\":{\"value\":\"\"}},\"labelColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000000\"}},\"labelSize\":{\"type\":\"STATIC\",\"options\":{\"size\":14}},\"labelBorderColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"labelBorderSize\":{\"options\":{\"size\":\"SMALL\"}}},\"isTimeAware\":true},\"type\":\"TILED_VECTOR\"},{\"id\":\"y4jsz\",\"label\":\"Flight Origin Location\",\"minZoom\":0,\"maxZoom\":8,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"resolution\":\"COARSE\",\"id\":\"fe893f84-388e-4865-8df4-650748533a77\",\"geoField\":\"OriginLocation\",\"requestType\":\"point\",\"metrics\":[{\"type\":\"count\",\"label\":\"flight count\"},{\"type\":\"sum\",\"field\":\"FlightDelayMin\"}],\"applyGlobalQuery\":true,\"indexPatternRefName\":\"layer_2_source_index_pattern\"},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}},\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"color\":\"Yellow to Red\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3},\"type\":\"ORDINAL\",\"useCustomColorRamp\":false,\"field\":{\"name\":\"sum_of_FlightDelayMin\",\"origin\":\"source\"}}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#110081\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"origin\":\"source\",\"name\":\"doc_count\"},\"minSize\":4,\"maxSize\":32,\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"iconOrientation\":{\"type\":\"STATIC\",\"options\":{\"orientation\":0}},\"labelText\":{\"type\":\"STATIC\",\"options\":{\"value\":\"\"}},\"labelColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000000\"}},\"labelSize\":{\"type\":\"STATIC\",\"options\":{\"size\":14}},\"labelBorderColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"labelBorderSize\":{\"options\":{\"size\":\"SMALL\"}}},\"isTimeAware\":true},\"type\":\"VECTOR\"}]","mapStateJSON":"{\"zoom\":4.28,\"center\":{\"lon\":-112.44472,\"lat\":34.65823},\"timeFilters\":{\"from\":\"now-7d\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":true,\"interval\":0},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[],\"settings\":{\"autoFitToDataBounds\":false,\"backgroundColor\":\"#ffffff\",\"disableInteractive\":false,\"disableTooltipControl\":false,\"hideToolbarOverlay\":false,\"hideLayerControl\":false,\"hideViewControl\":false,\"initialLocation\":\"LAST_SAVED_LOCATION\",\"fixedLocation\":{\"lat\":0,\"lon\":0,\"zoom\":2},\"browserLocation\":{\"zoom\":2},\"maxZoom\":24,\"minZoom\":0,\"showScaleControl\":false,\"showSpatialFilters\":true,\"showTimesliderToggleButton\":true,\"spatialFiltersAlpa\":0.3,\"spatialFiltersFillColor\":\"#DA8B45\",\"spatialFiltersLineColor\":\"#DA8B45\"}}","title":"[Flights] Origin Time Delayed","uiStateJSON":"{\"isLayerTOCOpen\":true,\"openTOCDetails\":[]}"},"coreMigrationVersion":"8.0.0","migrationVersion":{"map":"7.14.0"},"references":[{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d-test1","name":"layer_1_source_index_pattern","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d-test1","name":"layer_2_source_index_pattern","type":"index-pattern"}],"type":"map","updated_at":"2021-09-29T18:21:11.033Z","namespace":"test1"}
    {"index":{"_id":"test2:map:5dd88580-1906-11e9-919b-ffe5949a18d2-test2-newId"}}
    {"map":{"description":"","layerListJSON":"[{\"id\":\"0hmz5\",\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"isAutoSelect\":true},\"visible\":true,\"style\":{},\"type\":\"VECTOR_TILE\",\"minZoom\":0,\"maxZoom\":24},{\"id\":\"jzppx\",\"label\":\"Flights\",\"minZoom\":8,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"id\":\"040e0f25-9687-4569-a1e0-76f1a108da56\",\"type\":\"ES_SEARCH\",\"geoField\":\"DestLocation\",\"limit\":2048,\"filterByMapBounds\":true,\"tooltipProperties\":[\"Carrier\",\"DestCityName\",\"DestCountry\",\"OriginCityName\",\"OriginCountry\",\"FlightDelayMin\",\"FlightTimeMin\",\"DistanceMiles\",\"AvgTicketPrice\",\"FlightDelay\"],\"applyGlobalQuery\":true,\"scalingType\":\"MVT\",\"sortField\":\"timestamp\",\"indexPatternRefName\":\"layer_1_source_index_pattern\"},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}},\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"FlightDelayMin\",\"origin\":\"source\"},\"color\":\"Yellow to Red\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3},\"type\":\"ORDINAL\",\"useCustomColorRamp\":false}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":6}},\"iconOrientation\":{\"type\":\"STATIC\",\"options\":{\"orientation\":0}},\"labelText\":{\"type\":\"STATIC\",\"options\":{\"value\":\"\"}},\"labelColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000000\"}},\"labelSize\":{\"type\":\"STATIC\",\"options\":{\"size\":14}},\"labelBorderColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"labelBorderSize\":{\"options\":{\"size\":\"SMALL\"}}},\"isTimeAware\":true},\"type\":\"TILED_VECTOR\"},{\"id\":\"y4jsz\",\"label\":\"Flight Origin Location\",\"minZoom\":0,\"maxZoom\":8,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"resolution\":\"COARSE\",\"id\":\"fe893f84-388e-4865-8df4-650748533a77\",\"geoField\":\"OriginLocation\",\"requestType\":\"point\",\"metrics\":[{\"type\":\"count\",\"label\":\"flight count\"},{\"type\":\"sum\",\"field\":\"FlightDelayMin\"}],\"applyGlobalQuery\":true,\"indexPatternRefName\":\"layer_2_source_index_pattern\"},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}},\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"color\":\"Yellow to Red\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3},\"type\":\"ORDINAL\",\"useCustomColorRamp\":false,\"field\":{\"name\":\"sum_of_FlightDelayMin\",\"origin\":\"source\"}}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#110081\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"origin\":\"source\",\"name\":\"doc_count\"},\"minSize\":4,\"maxSize\":32,\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"iconOrientation\":{\"type\":\"STATIC\",\"options\":{\"orientation\":0}},\"labelText\":{\"type\":\"STATIC\",\"options\":{\"value\":\"\"}},\"labelColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000000\"}},\"labelSize\":{\"type\":\"STATIC\",\"options\":{\"size\":14}},\"labelBorderColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"labelBorderSize\":{\"options\":{\"size\":\"SMALL\"}}},\"isTimeAware\":true},\"type\":\"VECTOR\"}]","mapStateJSON":"{\"zoom\":4.28,\"center\":{\"lon\":-112.44472,\"lat\":34.65823},\"timeFilters\":{\"from\":\"now-7d\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":true,\"interval\":0},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[],\"settings\":{\"autoFitToDataBounds\":false,\"backgroundColor\":\"#ffffff\",\"disableInteractive\":false,\"disableTooltipControl\":false,\"hideToolbarOverlay\":false,\"hideLayerControl\":false,\"hideViewControl\":false,\"initialLocation\":\"LAST_SAVED_LOCATION\",\"fixedLocation\":{\"lat\":0,\"lon\":0,\"zoom\":2},\"browserLocation\":{\"zoom\":2},\"maxZoom\":24,\"minZoom\":0,\"showScaleControl\":false,\"showSpatialFilters\":true,\"showTimesliderToggleButton\":true,\"spatialFiltersAlpa\":0.3,\"spatialFiltersFillColor\":\"#DA8B45\",\"spatialFiltersLineColor\":\"#DA8B45\"}}","title":"[Flights] Origin Time Delayed","uiStateJSON":"{\"isLayerTOCOpen\":true,\"openTOCDetails\":[]}"},"coreMigrationVersion":"8.0.0","migrationVersion":{"map":"7.14.0"},"references":[{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d-test2-newId","name":"layer_1_source_index_pattern","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d-test2-newId","name":"layer_2_source_index_pattern","type":"index-pattern"}],"type":"map","updated_at":"2021-09-29T18:21:11.033Z","namespace":"test2"}
    {"index":{"_id":"test3:map:5dd88580-1906-11e9-919b-ffe5949a18d2-test3"}}
    {"map":{"description":"","layerListJSON":"[{\"id\":\"0hmz5\",\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"isAutoSelect\":true},\"visible\":true,\"style\":{},\"type\":\"VECTOR_TILE\",\"minZoom\":0,\"maxZoom\":24},{\"id\":\"jzppx\",\"label\":\"Flights\",\"minZoom\":8,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"id\":\"040e0f25-9687-4569-a1e0-76f1a108da56\",\"type\":\"ES_SEARCH\",\"geoField\":\"DestLocation\",\"limit\":2048,\"filterByMapBounds\":true,\"tooltipProperties\":[\"Carrier\",\"DestCityName\",\"DestCountry\",\"OriginCityName\",\"OriginCountry\",\"FlightDelayMin\",\"FlightTimeMin\",\"DistanceMiles\",\"AvgTicketPrice\",\"FlightDelay\"],\"applyGlobalQuery\":true,\"scalingType\":\"MVT\",\"sortField\":\"timestamp\",\"indexPatternRefName\":\"layer_1_source_index_pattern\"},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}},\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"FlightDelayMin\",\"origin\":\"source\"},\"color\":\"Yellow to Red\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3},\"type\":\"ORDINAL\",\"useCustomColorRamp\":false}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":6}},\"iconOrientation\":{\"type\":\"STATIC\",\"options\":{\"orientation\":0}},\"labelText\":{\"type\":\"STATIC\",\"options\":{\"value\":\"\"}},\"labelColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000000\"}},\"labelSize\":{\"type\":\"STATIC\",\"options\":{\"size\":14}},\"labelBorderColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"labelBorderSize\":{\"options\":{\"size\":\"SMALL\"}}},\"isTimeAware\":true},\"type\":\"TILED_VECTOR\"},{\"id\":\"y4jsz\",\"label\":\"Flight Origin Location\",\"minZoom\":0,\"maxZoom\":8,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"resolution\":\"COARSE\",\"id\":\"fe893f84-388e-4865-8df4-650748533a77\",\"geoField\":\"OriginLocation\",\"requestType\":\"point\",\"metrics\":[{\"type\":\"count\",\"label\":\"flight count\"},{\"type\":\"sum\",\"field\":\"FlightDelayMin\"}],\"applyGlobalQuery\":true,\"indexPatternRefName\":\"layer_2_source_index_pattern\"},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}},\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"color\":\"Yellow to Red\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3},\"type\":\"ORDINAL\",\"useCustomColorRamp\":false,\"field\":{\"name\":\"sum_of_FlightDelayMin\",\"origin\":\"source\"}}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#110081\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"origin\":\"source\",\"name\":\"doc_count\"},\"minSize\":4,\"maxSize\":32,\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"iconOrientation\":{\"type\":\"STATIC\",\"options\":{\"orientation\":0}},\"labelText\":{\"type\":\"STATIC\",\"options\":{\"value\":\"\"}},\"labelColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000000\"}},\"labelSize\":{\"type\":\"STATIC\",\"options\":{\"size\":14}},\"labelBorderColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"labelBorderSize\":{\"options\":{\"size\":\"SMALL\"}}},\"isTimeAware\":true},\"type\":\"VECTOR\"}]","mapStateJSON":"{\"zoom\":4.28,\"center\":{\"lon\":-112.44472,\"lat\":34.65823},\"timeFilters\":{\"from\":\"now-7d\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":true,\"interval\":0},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[],\"settings\":{\"autoFitToDataBounds\":false,\"backgroundColor\":\"#ffffff\",\"disableInteractive\":false,\"disableTooltipControl\":false,\"hideToolbarOverlay\":false,\"hideLayerControl\":false,\"hideViewControl\":false,\"initialLocation\":\"LAST_SAVED_LOCATION\",\"fixedLocation\":{\"lat\":0,\"lon\":0,\"zoom\":2},\"browserLocation\":{\"zoom\":2},\"maxZoom\":24,\"minZoom\":0,\"showScaleControl\":false,\"showSpatialFilters\":true,\"showTimesliderToggleButton\":true,\"spatialFiltersAlpa\":0.3,\"spatialFiltersFillColor\":\"#DA8B45\",\"spatialFiltersLineColor\":\"#DA8B45\"}}","title":"[Flights] Origin Time Delayed","uiStateJSON":"{\"isLayerTOCOpen\":true,\"openTOCDetails\":[]}"},"coreMigrationVersion":"8.0.0","migrationVersion":{"map":"7.14.0"},"references":[{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d-test3","name":"layer_1_source_index_pattern","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d-test3","name":"layer_2_source_index_pattern","type":"index-pattern"}],"type":"map","updated_at":"2021-09-29T18:21:11.033Z","namespace":"test3"}
    {"index":{"_id":"test3:map:5dd88580-1906-11e9-919b-ffe5949a18d2-test3-newId"}}
    {"map":{"description":"","layerListJSON":"[{\"id\":\"0hmz5\",\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"isAutoSelect\":true},\"visible\":true,\"style\":{},\"type\":\"VECTOR_TILE\",\"minZoom\":0,\"maxZoom\":24},{\"id\":\"jzppx\",\"label\":\"Flights\",\"minZoom\":8,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"id\":\"040e0f25-9687-4569-a1e0-76f1a108da56\",\"type\":\"ES_SEARCH\",\"geoField\":\"DestLocation\",\"limit\":2048,\"filterByMapBounds\":true,\"tooltipProperties\":[\"Carrier\",\"DestCityName\",\"DestCountry\",\"OriginCityName\",\"OriginCountry\",\"FlightDelayMin\",\"FlightTimeMin\",\"DistanceMiles\",\"AvgTicketPrice\",\"FlightDelay\"],\"applyGlobalQuery\":true,\"scalingType\":\"MVT\",\"sortField\":\"timestamp\",\"indexPatternRefName\":\"layer_1_source_index_pattern\"},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}},\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"FlightDelayMin\",\"origin\":\"source\"},\"color\":\"Yellow to Red\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3},\"type\":\"ORDINAL\",\"useCustomColorRamp\":false}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":6}},\"iconOrientation\":{\"type\":\"STATIC\",\"options\":{\"orientation\":0}},\"labelText\":{\"type\":\"STATIC\",\"options\":{\"value\":\"\"}},\"labelColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000000\"}},\"labelSize\":{\"type\":\"STATIC\",\"options\":{\"size\":14}},\"labelBorderColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"labelBorderSize\":{\"options\":{\"size\":\"SMALL\"}}},\"isTimeAware\":true},\"type\":\"TILED_VECTOR\"},{\"id\":\"y4jsz\",\"label\":\"Flight Origin Location\",\"minZoom\":0,\"maxZoom\":8,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"resolution\":\"COARSE\",\"id\":\"fe893f84-388e-4865-8df4-650748533a77\",\"geoField\":\"OriginLocation\",\"requestType\":\"point\",\"metrics\":[{\"type\":\"count\",\"label\":\"flight count\"},{\"type\":\"sum\",\"field\":\"FlightDelayMin\"}],\"applyGlobalQuery\":true,\"indexPatternRefName\":\"layer_2_source_index_pattern\"},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}},\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"color\":\"Yellow to Red\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3},\"type\":\"ORDINAL\",\"useCustomColorRamp\":false,\"field\":{\"name\":\"sum_of_FlightDelayMin\",\"origin\":\"source\"}}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#110081\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"origin\":\"source\",\"name\":\"doc_count\"},\"minSize\":4,\"maxSize\":32,\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"iconOrientation\":{\"type\":\"STATIC\",\"options\":{\"orientation\":0}},\"labelText\":{\"type\":\"STATIC\",\"options\":{\"value\":\"\"}},\"labelColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000000\"}},\"labelSize\":{\"type\":\"STATIC\",\"options\":{\"size\":14}},\"labelBorderColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"labelBorderSize\":{\"options\":{\"size\":\"SMALL\"}}},\"isTimeAware\":true},\"type\":\"VECTOR\"}]","mapStateJSON":"{\"zoom\":4.28,\"center\":{\"lon\":-112.44472,\"lat\":34.65823},\"timeFilters\":{\"from\":\"now-7d\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":true,\"interval\":0},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[],\"settings\":{\"autoFitToDataBounds\":false,\"backgroundColor\":\"#ffffff\",\"disableInteractive\":false,\"disableTooltipControl\":false,\"hideToolbarOverlay\":false,\"hideLayerControl\":false,\"hideViewControl\":false,\"initialLocation\":\"LAST_SAVED_LOCATION\",\"fixedLocation\":{\"lat\":0,\"lon\":0,\"zoom\":2},\"browserLocation\":{\"zoom\":2},\"maxZoom\":24,\"minZoom\":0,\"showScaleControl\":false,\"showSpatialFilters\":true,\"showTimesliderToggleButton\":true,\"spatialFiltersAlpa\":0.3,\"spatialFiltersFillColor\":\"#DA8B45\",\"spatialFiltersLineColor\":\"#DA8B45\"}}","title":"[Flights] Origin Time Delayed","uiStateJSON":"{\"isLayerTOCOpen\":true,\"openTOCDetails\":[]}"},"coreMigrationVersion":"8.0.0","migrationVersion":{"map":"7.14.0"},"references":[{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d-test3-newId","name":"layer_1_source_index_pattern","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d-test3-newId","name":"layer_2_source_index_pattern","type":"index-pattern"}],"type":"map","updated_at":"2021-09-29T18:21:11.033Z","namespace":"test3"}
    {"index":{"_id":"legacy-url-alias:test2:map:5dd88580-1906-11e9-919b-ffe5949a18d2-test2"}}
    {"legacy-url-alias":{"targetNamespace":"test2","targetType":"map","targetId":"5dd88580-1906-11e9-919b-ffe5949a18d2-test2-newId","sourceId":"5dd88580-1906-11e9-919b-ffe5949a18d2-test2"},"type":"legacy-url-alias","references":[]}
    {"index":{"_id":"legacy-url-alias:test3:map:5dd88580-1906-11e9-919b-ffe5949a18d2-test3"}}
    {"legacy-url-alias":{"targetNamespace":"test3","targetType":"map","targetId":"5dd88580-1906-11e9-919b-ffe5949a18d2-test3-newId","sourceId":"5dd88580-1906-11e9-919b-ffe5949a18d2-test3"},"type":"legacy-url-alias","references":[]}
    {"index":{"_id":"space:test1"}}
    {"space":{"name":"Test 1: Resolve Exact Match","initials":"T1","description":"In this space, test object(s) will resolve with an \"exactMatch\" outcome.","disabledFeatures":[]},"type":"space"}
    {"index":{"_id":"space:test2"}}
    {"space":{"name":"Test 2: Resolve Alias Match","initials":"T2","description":"In this space, test object(s) will resolve with an \"aliasMatch\" outcome.","disabledFeatures":[]},"type":"space"}
    {"index":{"_id":"space:test3"}}
    {"space":{"name":"Test 3: Resolve Conflict","initials":"T3","description":"In this space, test object(s) will resolve with a \"conflict\" outcome.","disabledFeatures":[]},"type":"space"}
    
  3. Add the staging data using Kibana Dev Tools
  4. Use the maps provided by the staging data to test the three different outcomes:
    1. "exactMatch" outcome: http://localhost:5601/s/test1/app/maps/map/5dd88580-1906-11e9-919b-ffe5949a18d2-test1
    2. "aliasMatch" outcome: http://localhost:5601/s/test2/app/maps/map/5dd88580-1906-11e9-919b-ffe5949a18d2-test2
    3. "conflict" outcome: http://localhost:5601/s/test3/app/maps/map/5dd88580-1906-11e9-919b-ffe5949a18d2-test3
  5. I also added a dashboard in the "Test 3" space and embedded both map objects to show the different behavior, it looks like this:
    image

We should tag @mbondyra for the Lens codeowner review, she did the same implementation for Lens.
Marta: this PR abstracts out the embeddable "legacy URL conflict" error pane that you added, and puts it in the Spaces plugin instead so other consumers can take advantage of it 😄

@mbondyra
Copy link
Contributor

mbondyra commented Oct 1, 2021

@elasticmachine merge upstream

Copy link
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lens changes LGTM, didn't test map behavior in depth, I focused on Lens only.

@nreese
Copy link
Contributor Author

nreese commented Oct 5, 2021

@elasticmachine merge upstream

@nreese nreese requested a review from jportner October 5, 2021 13:50
Copy link
Contributor

@jportner jportner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
spaces 239 241 +2

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
spaces 20 21 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.0MB 1.0MB -938.0B
maps 2.7MB 2.7MB +1.2KB
spaces 162.6KB 164.0KB +1.4KB
total +1.7KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
spaces 1 2 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
lens 39.1KB 39.1KB +34.0B
maps 43.2KB 43.3KB +51.0B
spaces 20.2KB 20.4KB +156.0B
total +241.0B
Unknown metric groups

API count

id before after diff
spaces 203 205 +2

async chunk count

id before after diff
spaces 10 11 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nreese nreese merged commit a9a923d into elastic:master Oct 5, 2021
@kibanamachine
Copy link
Contributor

💔 Backport failed

Status Branch Result
7.x Commit could not be cherrypicked due to conflicts

To backport manually run:
node scripts/backport --pr 112606

nreese added a commit to nreese/kibana that referenced this pull request Oct 5, 2021
* [Maps] Switch to SavedObjectClient.resolve

* spaces tslint

* aliasMatch

* maps eslint

* update lens to use spaces.ui.components.getSavedObjectConflictMessage

* lens eslint

* spaces eslint

* review feedback

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/maps/public/embeddable/_index.scss
#	x-pack/plugins/maps/public/embeddable/map_embeddable.tsx
#	x-pack/plugins/maps/public/plugin.ts
@nreese
Copy link
Contributor Author

nreese commented Oct 5, 2021

7.x #114004

Merge conflicts with #105326 changes that are not backported to 7.x

nreese added a commit that referenced this pull request Oct 5, 2021
* [Maps] Switch to SavedObjectClient.resolve

* spaces tslint

* aliasMatch

* maps eslint

* update lens to use spaces.ui.components.getSavedObjectConflictMessage

* lens eslint

* spaces eslint

* review feedback

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/maps/public/embeddable/_index.scss
#	x-pack/plugins/maps/public/embeddable/map_embeddable.tsx
#	x-pack/plugins/maps/public/plugin.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation release_note:skip Skip the PR/issue when compiling release notes v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants