From 436132496ce643d171c85820787742f571c74582 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 8 Jun 2021 14:21:13 -0400 Subject: [PATCH] [Maps] fix EMS Boundaries with joins not rendering (#101604) (#101636) * [Maps] fix EMS Boundaries with joins do not rendering * make newData required Co-authored-by: Nathan Reese --- x-pack/plugins/maps/public/actions/data_request_actions.ts | 4 ++-- x-pack/plugins/maps/public/reducers/map/data_request_utils.ts | 2 +- x-pack/plugins/maps/public/reducers/map/map.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/maps/public/actions/data_request_actions.ts b/x-pack/plugins/maps/public/actions/data_request_actions.ts index 6b57da132e895..a2a811a8a4223 100644 --- a/x-pack/plugins/maps/public/actions/data_request_actions.ts +++ b/x-pack/plugins/maps/public/actions/data_request_actions.ts @@ -123,7 +123,7 @@ function getDataRequestContext( dispatch(endDataLoad(layerId, dataId, requestToken, data, meta)), onLoadError: (dataId: string, requestToken: symbol, errorMessage: string) => dispatch(onDataLoadError(layerId, dataId, requestToken, errorMessage)), - updateSourceData: (newData: unknown) => { + updateSourceData: (newData: object) => { dispatch(updateSourceDataRequest(layerId, newData)); }, isRequestStillActive: (dataId: string, requestToken: symbol) => { @@ -316,7 +316,7 @@ function onDataLoadError( }; } -export function updateSourceDataRequest(layerId: string, newData: unknown) { +export function updateSourceDataRequest(layerId: string, newData: object) { return (dispatch: ThunkDispatch) => { dispatch({ type: UPDATE_SOURCE_DATA_REQUEST, diff --git a/x-pack/plugins/maps/public/reducers/map/data_request_utils.ts b/x-pack/plugins/maps/public/reducers/map/data_request_utils.ts index 637f06f1d2e81..18a3fd3d6c150 100644 --- a/x-pack/plugins/maps/public/reducers/map/data_request_utils.ts +++ b/x-pack/plugins/maps/public/reducers/map/data_request_utils.ts @@ -38,7 +38,7 @@ export function startDataRequest( export function updateSourceDataRequest( state: MapState, layerId: string, - newData?: object + newData: object ): MapState { const dataRequest = getDataRequest(state, layerId, SOURCE_DATA_REQUEST_ID); return dataRequest ? setDataRequest(state, layerId, { ...dataRequest, data: newData }) : state; diff --git a/x-pack/plugins/maps/public/reducers/map/map.ts b/x-pack/plugins/maps/public/reducers/map/map.ts index ec622e01dab38..e259e97bf260f 100644 --- a/x-pack/plugins/maps/public/reducers/map/map.ts +++ b/x-pack/plugins/maps/public/reducers/map/map.ts @@ -84,7 +84,7 @@ export const DEFAULT_MAP_STATE: MapState = { __rollbackSettings: null, }; -export function map(state: MapState = DEFAULT_MAP_STATE, action: any) { +export function map(state: MapState = DEFAULT_MAP_STATE, action: Record) { switch (action.type) { case UPDATE_DRAW_STATE: return { @@ -183,7 +183,7 @@ export function map(state: MapState = DEFAULT_MAP_STATE, action: any) { ], }; case UPDATE_SOURCE_DATA_REQUEST: - return updateSourceDataRequest(state, action); + return updateSourceDataRequest(state, action.layerId, action.newData); case LAYER_DATA_LOAD_STARTED: return startDataRequest( state,