Skip to content

Commit

Permalink
tslint
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Sep 20, 2024
1 parent 6b61221 commit 25703b3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export function TileMapVisualization(props: Props) {
}
});
}}
isSharable={false}
/>
);
}
3 changes: 1 addition & 2 deletions x-pack/plugins/maps/public/lens/passive_map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export function PassiveMap(props: Props) {
<ReactEmbeddableRenderer<MapSerializedState, MapRuntimeState, MapApi>
type={MAP_SAVED_OBJECT_TYPE}
getParentApi={() => ({
hideFilterActions: true,
getSerializedStateForChild: () => {
const basemapLayerDescriptor = createBasemapLayerDescriptor();
const intialLayers = basemapLayerDescriptor ? [basemapLayerDescriptor] : [];
Expand All @@ -66,7 +67,6 @@ export function PassiveMap(props: Props) {
hidePanelTitles: true,
viewMode: ViewMode.VIEW,
isLayerTOCOpen: false,
hideFilterActions: true,
mapSettings: {
disableInteractive: false,
hideToolbarOverlay: false,
Expand All @@ -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: [],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down Expand Up @@ -236,7 +236,8 @@ export const mapEmbeddableFactory: ReactEmbeddableFactory<
<MapContainer
onSingleValueTrigger={actionHandlers.onSingleValueTrigger}
addFilters={
(isMapRendererApi(parent) && parent.hideFilterActions) || areTriggersDisabled(api)
(apiHidesFilterActions(parent) && parent.hideFilterActions) ||
areTriggersDisabled(api)
? null
: actionHandlers.addFilters
}
Expand Down
16 changes: 10 additions & 6 deletions x-pack/plugins/maps/public/react_embeddable/map_renderer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,21 @@ import { MapSerializedState } from '../types';

export const MAP_RENDERER_TYPE = 'mapRenderer';

interface HidesFilterActions {
hideFilterActions: boolean;
}

export type MapRendererApi = HasType<typeof MAP_RENDERER_TYPE> &
HasSerializedChildState<MapSerializedState> &
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);
}

0 comments on commit 25703b3

Please sign in to comment.