Merge pull request #2390 from weaveworks/fix-resource-view-not-loading-topologies

Fetch resource view topologies on first topologies load
This commit is contained in:
Filip Barl
2017-03-24 19:11:38 +01:00
committed by GitHub
2 changed files with 7 additions and 6 deletions

View File

@@ -618,10 +618,14 @@ export function receiveTopologies(topologies) {
state.get('nodeDetails'),
dispatch
);
// populate search matches on first load
// Populate search matches on first load
if (firstLoad && state.get('searchQuery')) {
dispatch(focusSearch());
}
// Fetch all the relevant nodes once on first load
if (firstLoad && isResourceViewModeSelector(state)) {
getResourceViewNodesSnapshot(getState, dispatch);
}
};
}

View File

@@ -188,14 +188,11 @@ export function getAllNodes(getState, dispatch) {
/**
* One-time update of all the nodes of topologies that appear in the current resource view.
* TODO: Replace the one-time snapshot with periodic polling.
*/
export function getResourceViewNodesSnapshot(getState, dispatch) {
const topologyIds = layersTopologyIdsSelector(getState());
// TODO: Remove the timeout and replace it with normal polling once we figure how to make
// resource view dynamic (from the UI point of view, the challenge is to make it stable).
setTimeout(() => {
getNodesForTopologies(getState, dispatch, topologyIds);
}, 1200);
getNodesForTopologies(getState, dispatch, topologyIds);
}
export function getTopologies(options, dispatch, initialPoll) {