From 6b612212a45eac011bd78fadf4a89e53185f3c36 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 20 Sep 2024 12:40:26 -0600 Subject: [PATCH 1/6] [maps embeddable] fix map layers disappear from map panel when using session storage to continue editing a dashboard --- x-pack/plugins/maps/public/api/start_api.ts | 2 +- .../region_map/region_map_visualization.tsx | 3 +- .../tile_map/tile_map_visualization.tsx | 2 +- x-pack/plugins/maps/public/plugin.ts | 2 +- .../react_embeddable/map_react_embeddable.tsx | 29 ++++++---- .../{ => map_renderer}/map_renderer.tsx | 54 +++++++++---------- .../{ => map_renderer}/map_renderer_lazy.tsx | 0 .../react_embeddable/map_renderer/types.ts | 28 ++++++++++ .../maps/public/react_embeddable/types.ts | 7 --- 9 files changed, 78 insertions(+), 49 deletions(-) rename x-pack/plugins/maps/public/react_embeddable/{ => map_renderer}/map_renderer.tsx (64%) rename x-pack/plugins/maps/public/react_embeddable/{ => map_renderer}/map_renderer_lazy.tsx (100%) create mode 100644 x-pack/plugins/maps/public/react_embeddable/map_renderer/types.ts diff --git a/x-pack/plugins/maps/public/api/start_api.ts b/x-pack/plugins/maps/public/api/start_api.ts index fcf9dab69e40a..4047c88268e04 100644 --- a/x-pack/plugins/maps/public/api/start_api.ts +++ b/x-pack/plugins/maps/public/api/start_api.ts @@ -9,7 +9,7 @@ import type { LayerDescriptor } from '../../common/descriptor_types'; import type { CreateLayerDescriptorParams } from '../classes/sources/es_search_source'; import type { SampleValuesConfig, EMSTermJoinConfig } from '../ems_autosuggest'; import type { Props as PassiveMapProps } from '../lens/passive_map'; -import type { Props as MapProps } from '../react_embeddable/map_renderer'; +import type { Props as MapProps } from '../react_embeddable/map_renderer/map_renderer'; export interface MapsStartApi { createLayerDescriptors: { diff --git a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx index d8bc9a56f062a..a3488d97f06de 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx @@ -11,7 +11,7 @@ import { first } from 'rxjs'; import type { Filter } from '@kbn/es-query'; import type { Query, TimeRange } from '@kbn/es-query'; import { RegionMapVisConfig } from './types'; -import { MapRenderer } from '../../react_embeddable/map_renderer'; +import { MapRenderer } from '../../react_embeddable/map_renderer/map_renderer'; import { createRegionMapLayerDescriptor } from '../../classes/layers/create_region_map_layer_descriptor'; interface Props { @@ -55,7 +55,6 @@ export function RegionMapVisualization(props: Props) { } }); }} - isSharable={false} /> ); } diff --git a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx index f1cc8d437e082..35960c0c0dead 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx @@ -11,7 +11,7 @@ import { first } from 'rxjs'; import type { Filter } from '@kbn/es-query'; import type { Query, TimeRange } from '@kbn/es-query'; import type { TileMapVisConfig } from './types'; -import { MapRenderer } from '../../react_embeddable/map_renderer'; +import { MapRenderer } from '../../react_embeddable/map_renderer/map_renderer'; import { createTileMapLayerDescriptor } from '../../classes/layers/create_tile_map_layer_descriptor'; interface Props { diff --git a/x-pack/plugins/maps/public/plugin.ts b/x-pack/plugins/maps/public/plugin.ts index cc4cc4bcc91e8..fbdb2ef67d2ed 100644 --- a/x-pack/plugins/maps/public/plugin.ts +++ b/x-pack/plugins/maps/public/plugin.ts @@ -88,7 +88,7 @@ import { VectorTileInspectorView } from './inspector/vector_tile_adapter/vector_ import { PassiveMapLazy, setupLensChoroplethChart } from './lens'; import { CONTENT_ID, LATEST_VERSION } from '../common/content_management'; import { setupMapEmbeddable } from './react_embeddable/setup_map_embeddable'; -import { MapRendererLazy } from './react_embeddable/map_renderer_lazy'; +import { MapRendererLazy } from './react_embeddable/map_renderer/map_renderer_lazy'; export interface MapsPluginSetupDependencies { cloud?: CloudSetup; diff --git a/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx b/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx index 28a14592a8c32..82628ca5ce3a5 100644 --- a/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx +++ b/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx @@ -40,6 +40,9 @@ import { initializeDataViews } from './initialize_data_views'; import { initializeFetch } from './initialize_fetch'; import { initializeEditApi } from './initialize_edit_api'; import { extractReferences } from '../../common/migrations/references'; +import { MapAttributes } from '../../common/content_management'; +import { MapSettings } from '../../common/descriptor_types'; +import { isMapRendererApi } from './map_renderer/types'; export function getControlledBy(id: string) { return `mapEmbeddablePanel${id}`; @@ -65,6 +68,10 @@ export const mapEmbeddableFactory: ReactEmbeddableFactory< }); await savedMap.whenReady(); + const attributes$ = new BehaviorSubject(state.attributes); + const mapSettings$ = new BehaviorSubject | undefined>(state.mapSettings); + const savedObjectId$ = new BehaviorSubject(state.savedObjectId); + // eslint bug, eslint thinks api is never reassigned even though it is // eslint-disable-next-line prefer-const let api: MapApi | undefined; @@ -171,14 +178,14 @@ export const mapEmbeddableFactory: ReactEmbeddableFactory< }), ...crossPanelActions.comparators, ...reduxSync.comparators, + attributes: [attributes$, (next: MapAttributes | undefined) => attributes$.next(next)], + mapSettings: [ + mapSettings$, + (next: Partial | undefined) => mapSettings$.next(next), + ], + savedObjectId: [savedObjectId$, (next: string | undefined) => savedObjectId$.next(next)], // readonly comparators - attributes: getUnchangingComparator(), mapBuffer: getUnchangingComparator(), - savedObjectId: getUnchangingComparator(), - mapSettings: getUnchangingComparator(), - hideFilterActions: getUnchangingComparator(), - isSharable: getUnchangingComparator(), - tooltipRenderer: getUnchangingComparator(), } ); @@ -229,17 +236,21 @@ export const mapEmbeddableFactory: ReactEmbeddableFactory< ); diff --git a/x-pack/plugins/maps/public/react_embeddable/map_renderer.tsx b/x-pack/plugins/maps/public/react_embeddable/map_renderer/map_renderer.tsx similarity index 64% rename from x-pack/plugins/maps/public/react_embeddable/map_renderer.tsx rename to x-pack/plugins/maps/public/react_embeddable/map_renderer/map_renderer.tsx index 7701c7ebbe11b..5821fe82d6615 100644 --- a/x-pack/plugins/maps/public/react_embeddable/map_renderer.tsx +++ b/x-pack/plugins/maps/public/react_embeddable/map_renderer/map_renderer.tsx @@ -9,11 +9,16 @@ import React, { useEffect, useRef } from 'react'; import type { Filter, Query, TimeRange } from '@kbn/es-query'; import { ReactEmbeddableRenderer } from '@kbn/embeddable-plugin/public'; import { useSearchApi } from '@kbn/presentation-publishing'; -import type { LayerDescriptor, MapCenterAndZoom, MapSettings } from '../../common/descriptor_types'; -import { createBasemapLayerDescriptor } from '../classes/layers/create_basemap_layer_descriptor'; -import { MapApi, MapRuntimeState, MapSerializedState } from './types'; -import { MAP_SAVED_OBJECT_TYPE } from '../../common/constants'; -import { RenderToolTipContent } from '../classes/tooltips/tooltip_property'; +import type { + LayerDescriptor, + MapCenterAndZoom, + MapSettings, +} from '../../../common/descriptor_types'; +import { createBasemapLayerDescriptor } from '../../classes/layers/create_basemap_layer_descriptor'; +import { MapApi, MapRuntimeState, MapSerializedState } from '../types'; +import { MAP_SAVED_OBJECT_TYPE } from '../../../common/constants'; +import { RenderToolTipContent } from '../../classes/tooltips/tooltip_property'; +import { MAP_RENDERER_TYPE } from './types'; function getLayers(layerList: LayerDescriptor[]) { const basemapLayer = createBasemapLayerDescriptor(); @@ -32,10 +37,6 @@ export interface Props { mapCenter?: MapCenterAndZoom; getTooltipRenderer?: () => RenderToolTipContent; onApiAvailable?: (api: MapApi) => void; - /* - * Set to false to exclude sharing attributes 'data-*'. - */ - isSharable?: boolean; } export function MapRenderer(props: Props) { @@ -61,30 +62,27 @@ export function MapRenderer(props: Props) { type={MAP_SAVED_OBJECT_TYPE} getParentApi={() => ({ - ...searchApi, + type: MAP_RENDERER_TYPE, + getTooltipRenderer: props.getTooltipRenderer, + hideFilterActions: + typeof props.hideFilterActions === 'boolean' ? props.hideFilterActions : false, getSerializedStateForChild: () => { - const rawState: MapSerializedState = { - attributes: { - title: props.title ?? '', - layerListJSON: JSON.stringify(getLayers(props.layerList)), - }, - hidePanelTitles: !Boolean(props.title), - isLayerTOCOpen: - typeof props.isLayerTOCOpen === 'boolean' ? props.isLayerTOCOpen : false, - hideFilterActions: - typeof props.hideFilterActions === 'boolean' ? props.hideFilterActions : false, - mapCenter: props.mapCenter, - mapSettings: props.mapSettings ?? {}, - isSharable: props.isSharable, - }; - if (props.getTooltipRenderer) { - rawState.tooltipRenderer = props.getTooltipRenderer(); - } return { - rawState, + rawState: { + attributes: { + title: props.title ?? '', + layerListJSON: JSON.stringify(getLayers(props.layerList)), + }, + hidePanelTitles: !Boolean(props.title), + isLayerTOCOpen: + typeof props.isLayerTOCOpen === 'boolean' ? props.isLayerTOCOpen : false, + mapCenter: props.mapCenter, + mapSettings: props.mapSettings ?? {}, + }, references: [], }; }, + ...searchApi, })} onApiAvailable={(api) => { mapApiRef.current = api; diff --git a/x-pack/plugins/maps/public/react_embeddable/map_renderer_lazy.tsx b/x-pack/plugins/maps/public/react_embeddable/map_renderer/map_renderer_lazy.tsx similarity index 100% rename from x-pack/plugins/maps/public/react_embeddable/map_renderer_lazy.tsx rename to x-pack/plugins/maps/public/react_embeddable/map_renderer/map_renderer_lazy.tsx diff --git a/x-pack/plugins/maps/public/react_embeddable/map_renderer/types.ts b/x-pack/plugins/maps/public/react_embeddable/map_renderer/types.ts new file mode 100644 index 0000000000000..44a9f8e998553 --- /dev/null +++ b/x-pack/plugins/maps/public/react_embeddable/map_renderer/types.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { HasType, PublishesUnifiedSearch, apiIsOfType } from '@kbn/presentation-publishing'; +import { HasSerializedChildState } from '@kbn/presentation-containers'; +import { RenderToolTipContent } from '../../classes/tooltips/tooltip_property'; +import { MapSerializedState } from '../types'; + +export const MAP_RENDERER_TYPE = 'mapRenderer'; + +export type MapRendererApi = HasType & + HasSerializedChildState & + PublishesUnifiedSearch & { + getTooltipRenderer?: () => RenderToolTipContent; + hideFilterActions: boolean; + }; + +export function isMapRendererApi(api: unknown): api is MapRendererApi { + return Boolean( + api && + apiIsOfType(api, MAP_RENDERER_TYPE) && + (api as MapRendererApi).hideFilterActions !== undefined + ); +} diff --git a/x-pack/plugins/maps/public/react_embeddable/types.ts b/x-pack/plugins/maps/public/react_embeddable/types.ts index f020e75723c6c..a61a7e1ce6a03 100644 --- a/x-pack/plugins/maps/public/react_embeddable/types.ts +++ b/x-pack/plugins/maps/public/react_embeddable/types.ts @@ -31,7 +31,6 @@ import { MapSettings, } from '../../common/descriptor_types'; import { ILayer } from '../classes/layers/layer'; -import { RenderToolTipContent } from '../classes/tooltips/tooltip_property'; import { EventHandlers } from '../reducers/non_serializable_instances'; export type MapSerializedState = SerializedTitles & @@ -47,15 +46,9 @@ export type MapSerializedState = SerializedTitles & mapBuffer?: MapExtent; mapSettings?: Partial; hiddenLayers?: string[]; - hideFilterActions?: boolean; timeRange?: TimeRange; filterByMapExtent?: boolean; isMovementSynchronized?: boolean; - - // Configuration item that are never persisted - // Putting in state as a temporary work around - isSharable?: boolean; - tooltipRenderer?: RenderToolTipContent; }; export type MapRuntimeState = MapSerializedState; From 25703b363ea0535e704e583d49405ec3402ac3b4 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 20 Sep 2024 13:40:21 -0600 Subject: [PATCH 2/6] tslint --- .../tile_map/tile_map_visualization.tsx | 1 - x-pack/plugins/maps/public/lens/passive_map.tsx | 3 +-- .../react_embeddable/map_react_embeddable.tsx | 5 +++-- .../react_embeddable/map_renderer/types.ts | 16 ++++++++++------ 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx index 35960c0c0dead..0f66713a1819d 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx @@ -55,7 +55,6 @@ export function TileMapVisualization(props: Props) { } }); }} - isSharable={false} /> ); } diff --git a/x-pack/plugins/maps/public/lens/passive_map.tsx b/x-pack/plugins/maps/public/lens/passive_map.tsx index 30a4b8013b8ab..53b3799b0480f 100644 --- a/x-pack/plugins/maps/public/lens/passive_map.tsx +++ b/x-pack/plugins/maps/public/lens/passive_map.tsx @@ -53,6 +53,7 @@ export function PassiveMap(props: Props) { type={MAP_SAVED_OBJECT_TYPE} getParentApi={() => ({ + hideFilterActions: true, getSerializedStateForChild: () => { const basemapLayerDescriptor = createBasemapLayerDescriptor(); const intialLayers = basemapLayerDescriptor ? [basemapLayerDescriptor] : []; @@ -66,7 +67,6 @@ export function PassiveMap(props: Props) { hidePanelTitles: true, viewMode: ViewMode.VIEW, isLayerTOCOpen: false, - hideFilterActions: true, mapSettings: { disableInteractive: false, hideToolbarOverlay: false, @@ -75,7 +75,6 @@ export function PassiveMap(props: Props) { initialLocation: INITIAL_LOCATION.AUTO_FIT_TO_BOUNDS, // this will startup based on data-extent autoFitToDataBounds: true, // this will auto-fit when there are changes to the filter and/or query }, - isSharable: false, }, references: [], }; diff --git a/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx b/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx index 82628ca5ce3a5..e3f8038a51716 100644 --- a/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx +++ b/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx @@ -42,7 +42,7 @@ import { initializeEditApi } from './initialize_edit_api'; import { extractReferences } from '../../common/migrations/references'; import { MapAttributes } from '../../common/content_management'; import { MapSettings } from '../../common/descriptor_types'; -import { isMapRendererApi } from './map_renderer/types'; +import { apiHidesFilterActions, isMapRendererApi } from './map_renderer/types'; export function getControlledBy(id: string) { return `mapEmbeddablePanel${id}`; @@ -236,7 +236,8 @@ export const mapEmbeddableFactory: ReactEmbeddableFactory< & HasSerializedChildState & + HidesFilterActions & PublishesUnifiedSearch & { getTooltipRenderer?: () => RenderToolTipContent; - hideFilterActions: boolean; }; export function isMapRendererApi(api: unknown): api is MapRendererApi { - return Boolean( - api && - apiIsOfType(api, MAP_RENDERER_TYPE) && - (api as MapRendererApi).hideFilterActions !== undefined - ); + return Boolean(api && apiIsOfType(api, MAP_RENDERER_TYPE) && apiHidesFilterActions(api)); +} + +export function apiHidesFilterActions(api: unknown): api is HidesFilterActions { + return Boolean(api && (api as HidesFilterActions).hideFilterActions !== undefined); } From 477d92c50dc70d85f167af4faff0077689a7f564 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 20 Sep 2024 15:05:09 -0600 Subject: [PATCH 3/6] use parentApi instead of parent --- .../maps/public/react_embeddable/map_react_embeddable.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx b/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx index e3f8038a51716..aa123a6be9e97 100644 --- a/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx +++ b/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx @@ -236,7 +236,7 @@ export const mapEmbeddableFactory: ReactEmbeddableFactory< ); From cbc00690c27e72668c178c9f5b74d7d06af379a8 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 23 Sep 2024 08:02:16 -0600 Subject: [PATCH 4/6] make isSharable a prop --- .../region_map/region_map_visualization.tsx | 1 + .../tile_map/tile_map_visualization.tsx | 1 + .../plugins/maps/public/lens/passive_map.tsx | 1 + .../react_embeddable/map_react_embeddable.tsx | 12 ++++++--- .../react_embeddable/map_renderer/types.ts | 25 ++++++------------- 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx index a3488d97f06de..09cf94a097767 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx @@ -55,6 +55,7 @@ export function RegionMapVisualization(props: Props) { } }); }} + isSharable={false} /> ); } diff --git a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx index 0f66713a1819d..35960c0c0dead 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx @@ -55,6 +55,7 @@ export function TileMapVisualization(props: Props) { } }); }} + isSharable={false} /> ); } diff --git a/x-pack/plugins/maps/public/lens/passive_map.tsx b/x-pack/plugins/maps/public/lens/passive_map.tsx index 53b3799b0480f..1be544a8cb423 100644 --- a/x-pack/plugins/maps/public/lens/passive_map.tsx +++ b/x-pack/plugins/maps/public/lens/passive_map.tsx @@ -75,6 +75,7 @@ export function PassiveMap(props: Props) { initialLocation: INITIAL_LOCATION.AUTO_FIT_TO_BOUNDS, // this will startup based on data-extent autoFitToDataBounds: true, // this will auto-fit when there are changes to the filter and/or query }, + isSharable: false, }, references: [], }; diff --git a/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx b/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx index aa123a6be9e97..883e57664ea9a 100644 --- a/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx +++ b/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx @@ -42,7 +42,7 @@ import { initializeEditApi } from './initialize_edit_api'; import { extractReferences } from '../../common/migrations/references'; import { MapAttributes } from '../../common/content_management'; import { MapSettings } from '../../common/descriptor_types'; -import { apiHidesFilterActions, isMapRendererApi } from './map_renderer/types'; +import { isMapRendererApi } from './map_renderer/types'; export function getControlledBy(id: string) { return `mapEmbeddablePanel${id}`; @@ -236,7 +236,9 @@ export const mapEmbeddableFactory: ReactEmbeddableFactory< ); diff --git a/x-pack/plugins/maps/public/react_embeddable/map_renderer/types.ts b/x-pack/plugins/maps/public/react_embeddable/map_renderer/types.ts index 9d9582b678e0e..0e92e551c821a 100644 --- a/x-pack/plugins/maps/public/react_embeddable/map_renderer/types.ts +++ b/x-pack/plugins/maps/public/react_embeddable/map_renderer/types.ts @@ -5,28 +5,17 @@ * 2.0. */ -import { HasType, PublishesUnifiedSearch, apiIsOfType } from '@kbn/presentation-publishing'; -import { HasSerializedChildState } from '@kbn/presentation-containers'; +import { HasType, apiIsOfType } from '@kbn/presentation-publishing'; import { RenderToolTipContent } from '../../classes/tooltips/tooltip_property'; -import { MapSerializedState } from '../types'; export const MAP_RENDERER_TYPE = 'mapRenderer'; -interface HidesFilterActions { - hideFilterActions: boolean; -} - -export type MapRendererApi = HasType & - HasSerializedChildState & - HidesFilterActions & - PublishesUnifiedSearch & { - getTooltipRenderer?: () => RenderToolTipContent; - }; +export type MapRendererApi = HasType & { + getTooltipRenderer?: () => RenderToolTipContent; + hideFilterActions?: boolean; + isSharable?: boolean; +}; export function isMapRendererApi(api: unknown): api is MapRendererApi { - return Boolean(api && apiIsOfType(api, MAP_RENDERER_TYPE) && apiHidesFilterActions(api)); -} - -export function apiHidesFilterActions(api: unknown): api is HidesFilterActions { - return Boolean(api && (api as HidesFilterActions).hideFilterActions !== undefined); + return Boolean(api && apiIsOfType(api, MAP_RENDERER_TYPE)); } From 1150b46a2522425cb187144688d774ae26086c5a Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 23 Sep 2024 08:03:27 -0600 Subject: [PATCH 5/6] clean up --- .../maps/public/react_embeddable/map_react_embeddable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx b/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx index 883e57664ea9a..b20c05dba244b 100644 --- a/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx +++ b/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx @@ -237,7 +237,7 @@ export const mapEmbeddableFactory: ReactEmbeddableFactory< onSingleValueTrigger={actionHandlers.onSingleValueTrigger} addFilters={ (isMapRendererApi(parentApi) && - typeof parentApi.isSharable === 'boolean' && + typeof parentApi.hideFilterActions === 'boolean' && parentApi.hideFilterActions) || areTriggersDisabled(api) ? null From 66ac6229418217a19c14656182ec7121b98643cb Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 23 Sep 2024 08:04:27 -0600 Subject: [PATCH 6/6] unsaved changes --- .../public/react_embeddable/map_renderer/map_renderer.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/maps/public/react_embeddable/map_renderer/map_renderer.tsx b/x-pack/plugins/maps/public/react_embeddable/map_renderer/map_renderer.tsx index 5821fe82d6615..459c99f9d981c 100644 --- a/x-pack/plugins/maps/public/react_embeddable/map_renderer/map_renderer.tsx +++ b/x-pack/plugins/maps/public/react_embeddable/map_renderer/map_renderer.tsx @@ -37,6 +37,10 @@ export interface Props { mapCenter?: MapCenterAndZoom; getTooltipRenderer?: () => RenderToolTipContent; onApiAvailable?: (api: MapApi) => void; + /* + * Set to false to exclude sharing attributes 'data-*'. + */ + isSharable?: boolean; } export function MapRenderer(props: Props) { @@ -64,8 +68,8 @@ export function MapRenderer(props: Props) { getParentApi={() => ({ type: MAP_RENDERER_TYPE, getTooltipRenderer: props.getTooltipRenderer, - hideFilterActions: - typeof props.hideFilterActions === 'boolean' ? props.hideFilterActions : false, + hideFilterActions: props.hideFilterActions, + isSharable: props.isSharable, getSerializedStateForChild: () => { return { rawState: {