mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
This commit is contained in:
parent
b2c0d456fe
commit
23af014b05
3 changed files with 21 additions and 17 deletions
|
@ -136,12 +136,13 @@ export function addLayer(layerDescriptor) {
|
|||
};
|
||||
}
|
||||
|
||||
export function setLayerErrorStatus(layerId, errorMessage) {
|
||||
function setLayerDataLoadErrorStatus(layerId, errorMessage) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: SET_LAYER_ERROR_STATUS,
|
||||
isInErrorState: errorMessage !== null,
|
||||
layerId,
|
||||
errorMessage,
|
||||
errorMessage
|
||||
});
|
||||
};
|
||||
}
|
||||
|
@ -366,14 +367,20 @@ export function updateSourceDataRequest(layerId, newData) {
|
|||
}
|
||||
|
||||
export function endDataLoad(layerId, dataId, requestToken, data, meta) {
|
||||
return ({
|
||||
type: LAYER_DATA_LOAD_ENDED,
|
||||
layerId,
|
||||
dataId,
|
||||
data,
|
||||
meta,
|
||||
requestToken
|
||||
});
|
||||
return async (dispatch) => {
|
||||
dispatch({
|
||||
type: LAYER_DATA_LOAD_ENDED,
|
||||
layerId,
|
||||
dataId,
|
||||
data,
|
||||
meta,
|
||||
requestToken
|
||||
});
|
||||
//Clear any data-load errors when there is a succesful data return.
|
||||
//Co this on end-data-load iso at start-data-load to avoid blipping the error status between true/false.
|
||||
//This avoids jitter in the warning icon of the TOC when the requests continues to return errors.
|
||||
dispatch(setLayerDataLoadErrorStatus(layerId, null));
|
||||
};
|
||||
}
|
||||
|
||||
export function onDataLoadError(layerId, dataId, requestToken, errorMessage) {
|
||||
|
@ -385,7 +392,7 @@ export function onDataLoadError(layerId, dataId, requestToken, errorMessage) {
|
|||
requestToken,
|
||||
});
|
||||
|
||||
dispatch(setLayerErrorStatus(layerId, errorMessage));
|
||||
dispatch(setLayerDataLoadErrorStatus(layerId, errorMessage));
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -12,8 +12,7 @@ import {
|
|||
mapDestroyed,
|
||||
setMouseCoordinates,
|
||||
clearMouseCoordinates,
|
||||
clearGoto,
|
||||
setLayerErrorStatus,
|
||||
clearGoto
|
||||
} from '../../../actions/store_actions';
|
||||
import { getLayerList, getMapReady, getGoto } from "../../../selectors/map_selectors";
|
||||
|
||||
|
@ -46,9 +45,7 @@ function mapDispatchToProps(dispatch) {
|
|||
},
|
||||
clearGoto: () => {
|
||||
dispatch(clearGoto());
|
||||
},
|
||||
setLayerErrorStatus: (id, msg) =>
|
||||
dispatch(setLayerErrorStatus(id, msg))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ export function map(state = INITIAL_STATE, action) {
|
|||
...layerList.slice(0, layerIdx),
|
||||
{
|
||||
...layerList[layerIdx],
|
||||
__isInErrorState: true,
|
||||
__isInErrorState: action.isInErrorState,
|
||||
__errorMessage: action.errorMessage
|
||||
},
|
||||
...layerList.slice(layerIdx + 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue