diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/public/embeddable/visualize_embeddable.ts b/src/legacy/core_plugins/visualizations/public/np_ready/public/embeddable/visualize_embeddable.ts index 0c34a38e7dc3e..551fe12a43559 100644 --- a/src/legacy/core_plugins/visualizations/public/np_ready/public/embeddable/visualize_embeddable.ts +++ b/src/legacy/core_plugins/visualizations/public/np_ready/public/embeddable/visualize_embeddable.ts @@ -65,7 +65,6 @@ export interface VisualizeInput extends EmbeddableInput { colors?: { [key: string]: string }; }; visObject: SerializedVis; - visType: string; } export interface VisualizeOutput extends EmbeddableOutput { @@ -80,7 +79,7 @@ function getOutput( input: VisualizeInput, { savedVisualizations, editable }: VisualizeEmbeddableConfiguration ): VisualizeOutput { - const vis = new Vis(input.visType, input.visObject); + const vis = new Vis(input.visObject.type, input.visObject); const indexPattern = vis.data.indexPattern; const indexPatterns = indexPattern ? [indexPattern] : []; const editUrl = input.visObject.id @@ -117,7 +116,7 @@ export class VisualizeEmbeddable extends Embeddable void) | null; - renderTooltipContent?: (params: RenderTooltipContentParams) => React.ComponentType; + renderTooltipContent?: RenderToolTipContent; }>; diff --git a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.tsx b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.tsx index ad0a511064035..207a857f98a18 100644 --- a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.tsx +++ b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.tsx @@ -56,7 +56,7 @@ import { } from '../../../../../plugins/maps/public/reducers/non_serializable_instances'; import { getMapCenter, getMapZoom, getHiddenLayerIds } from '../selectors/map_selectors'; import { MAP_SAVED_OBJECT_TYPE } from '../../common/constants'; -import { RenderTooltipContentParams } from './types'; +import { RenderToolTipContent } from './types'; interface MapConfig { editUrl?: string; @@ -92,7 +92,7 @@ export interface MapOutput extends EmbeddableOutput { export class MapEmbeddable extends Embeddable { type = MAP_SAVED_OBJECT_TYPE; - private _renderTooltipContent?: (params: RenderTooltipContentParams) => React.ComponentType; + private _renderTooltipContent?: RenderToolTipContent; private _eventHandlers?: unknown; private _layerList: unknown[]; private _store: MapStore; @@ -108,7 +108,7 @@ export class MapEmbeddable extends Embeddable { config: MapConfig, initialInput: MapEmbeddableInput, parent?: IContainer, - renderTooltipContent?: (params: unknown) => React.ComponentType, + renderTooltipContent?: RenderToolTipContent, eventHandlers?: unknown ) { super( @@ -130,7 +130,7 @@ export class MapEmbeddable extends Embeddable { this._subscription = this.getInput$().subscribe(input => this.onContainerStateChanged(input)); } - setRenderTooltipContent = (renderTooltipContent: (params: unknown) => React.ComponentType) => { + setRenderTooltipContent = (renderTooltipContent: RenderToolTipContent) => { this._renderTooltipContent = renderTooltipContent; }; diff --git a/x-pack/legacy/plugins/maps/public/embeddable/types.ts b/x-pack/legacy/plugins/maps/public/embeddable/types.ts index 32fd589340928..da18daa8115d6 100644 --- a/x-pack/legacy/plugins/maps/public/embeddable/types.ts +++ b/x-pack/legacy/plugins/maps/public/embeddable/types.ts @@ -32,3 +32,5 @@ export interface RenderTooltipContentParams { loadFeatureProperties({ layerId, featureId }: LoadFeatureProps): Promise; loadFeatureGeometry({ layerId, featureId }: LoadFeatureProps): FeatureGeometry; } + +export type RenderToolTipContent = (params: RenderTooltipContentParams) => JSX.Element; diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx index 6646b7844beb3..c04af5c0ea43d 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx @@ -8,11 +8,14 @@ import uuid from 'uuid'; import React from 'react'; import { OutPortal, PortalNode } from 'react-reverse-portal'; import minimatch from 'minimatch'; -import { ViewMode } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { IndexPatternMapping, SetQuery } from './types'; import { getLayerList } from './map_config'; import { MAP_SAVED_OBJECT_TYPE } from '../../../../../../plugins/maps/public'; -import { MapEmbeddable, RenderTooltipContentParams } from '../../../../maps/public'; +import { + MapEmbeddable, + RenderTooltipContentParams, + MapEmbeddableInput, +} from '../../../../maps/public'; import * as i18n from './translations'; import { Query, Filter } from '../../../../../../../src/plugins/data/public'; import {