Skip to content

Commit

Permalink
[Maps] fix EMS Boundaries with joins not rendering (elastic#101604) (e…
Browse files Browse the repository at this point in the history
…lastic#101635)

* [Maps] fix EMS Boundaries with joins do not rendering

* make newData required

Co-authored-by: Nathan Reese <[email protected]>
  • Loading branch information
kibanamachine and nreese authored Jun 8, 2021
1 parent 67268f7 commit d8719b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/maps/public/actions/data_request_actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -316,7 +316,7 @@ function onDataLoadError(
};
}

export function updateSourceDataRequest(layerId: string, newData: unknown) {
export function updateSourceDataRequest(layerId: string, newData: object) {
return (dispatch: ThunkDispatch<MapStoreState, void, AnyAction>) => {
dispatch({
type: UPDATE_SOURCE_DATA_REQUEST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/maps/public/reducers/map/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>) {
switch (action.type) {
case UPDATE_DRAW_STATE:
return {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d8719b8

Please sign in to comment.