diff --git a/client/app/scripts/actions/app-actions.js b/client/app/scripts/actions/app-actions.js
index 514190450..755375af7 100644
--- a/client/app/scripts/actions/app-actions.js
+++ b/client/app/scripts/actions/app-actions.js
@@ -339,15 +339,14 @@ export function clickNode(nodeId, label, origin, topologyId = null) {
export function pauseTimeAtNow() {
return (dispatch, getState) => {
- const getScopeState = () => getState().scope || getState();
dispatch({
type: ActionTypes.PAUSE_TIME_AT_NOW
});
- updateRoute(getScopeState);
- if (!getScopeState().get('nodesLoaded')) {
- getNodes(getScopeState, dispatch);
- if (isResourceViewModeSelector(getScopeState())) {
- getResourceViewNodesSnapshot(getScopeState(), dispatch);
+ updateRoute(getState);
+ if (!getState().get('nodesLoaded')) {
+ getNodes(getState, dispatch);
+ if (isResourceViewModeSelector(getState())) {
+ getResourceViewNodesSnapshot(getState(), dispatch);
}
}
};
@@ -550,8 +549,7 @@ export function receiveNodeDetails(details, requestTimestamp) {
export function receiveNodesDelta(delta) {
return (dispatch, getState) => {
- const getScopeState = () => getState().scope || getState();
- if (!isPausedSelector(getScopeState())) {
+ if (!isPausedSelector(getState())) {
// Allow css-animation to run smoothly by scheduling it to run on the
// next tick after any potentially expensive canvas re-draws have been
// completed.
@@ -561,7 +559,7 @@ export function receiveNodesDelta(delta) {
// only when the first batch of nodes delta has been received. We
// do that because we want to keep the previous state blurred instead
// of transitioning over an empty state like when switching topologies.
- if (getScopeState().get('timeTravelTransitioning')) {
+ if (getState().get('timeTravelTransitioning')) {
dispatch({ type: ActionTypes.FINISH_TIME_TRAVEL_TRANSITION });
}
@@ -578,37 +576,17 @@ export function receiveNodesDelta(delta) {
export function resumeTime() {
return (dispatch, getState) => {
- const getScopeState = () => getState().scope || getState();
- if (isPausedSelector(getScopeState())) {
+ if (isPausedSelector(getState())) {
dispatch({
type: ActionTypes.RESUME_TIME
});
- updateRoute(getScopeState);
+ updateRoute(getState);
// After unpausing, all of the following calls will re-activate polling.
- getTopologies(getScopeState, dispatch);
- getNodes(getScopeState, dispatch, true);
- if (isResourceViewModeSelector(getScopeState())) {
- getResourceViewNodesSnapshot(getScopeState(), dispatch);
- }
- }
- };
-}
-
-export function startTimeTravel(timestamp = null) {
- return (dispatch, getState) => {
- dispatch({
- type: ActionTypes.START_TIME_TRAVEL,
- timestamp,
- });
- updateRoute(getState);
- if (!getState().get('nodesLoaded')) {
- getNodes(getState, dispatch);
+ getTopologies(getState, dispatch);
+ getNodes(getState, dispatch, true);
if (isResourceViewModeSelector(getState())) {
getResourceViewNodesSnapshot(getState(), dispatch);
}
- } else {
- // Get most recent details before freezing the state.
- getNodeDetails(getState, dispatch);
}
};
}
@@ -622,16 +600,20 @@ export function receiveNodes(nodes) {
export function jumpToTime(timestamp) {
return (dispatch, getState) => {
- const getScopeState = () => getState().scope || getState();
dispatch({
type: ActionTypes.JUMP_TO_TIME,
timestamp,
});
- updateRoute(getScopeState);
- getNodes(getScopeState, dispatch);
- getTopologies(getScopeState, dispatch);
- if (isResourceViewModeSelector(getScopeState())) {
- getResourceViewNodesSnapshot(getScopeState(), dispatch);
+ updateRoute(getState);
+ getTopologies(getState, dispatch);
+ if (!getState().get('nodesLoaded')) {
+ getNodes(getState, dispatch);
+ if (isResourceViewModeSelector(getState())) {
+ getResourceViewNodesSnapshot(getState(), dispatch);
+ }
+ } else {
+ // Get most recent details before freezing the state.
+ getNodeDetails(getState, dispatch);
}
};
}
@@ -646,15 +628,14 @@ export function receiveNodesForTopology(nodes, topologyId) {
export function receiveTopologies(topologies) {
return (dispatch, getState) => {
- const getScopeState = () => getState().scope || getState();
- const firstLoad = !getScopeState().get('topologiesLoaded');
+ const firstLoad = !getState().get('topologiesLoaded');
dispatch({
type: ActionTypes.RECEIVE_TOPOLOGIES,
topologies
});
- getNodes(getScopeState, dispatch);
+ getNodes(getState, dispatch);
// Populate search matches on first load
- const state = getScopeState();
+ const state = getState();
if (firstLoad && state.get('searchQuery')) {
dispatch(focusSearch());
}
@@ -687,7 +668,7 @@ export function receiveApiDetails(apiDetails) {
// we have no prior info on whether time travel would be available.
if (isFirstTime && pausedAt) {
if (apiDetails.capabilities && apiDetails.capabilities.historic_reports) {
- dispatch(startTimeTravel(pausedAt));
+ dispatch(jumpToTime(pausedAt));
} else {
dispatch(pauseTimeAtNow());
}
@@ -796,7 +777,7 @@ export function route(urlState) {
if (!urlState.pausedAt) {
dispatch(resumeTime());
} else {
- dispatch(startTimeTravel(urlState.pausedAt));
+ dispatch(jumpToTime(urlState.pausedAt));
}
// update all request workers with new options
getTopologies(getState, dispatch);
@@ -870,12 +851,6 @@ export function getImagesForService(orgId, serviceId) {
};
}
-export function getFluxHistory(...params) {
- return (dispatch, getState, { actions }) => (
- dispatch(actions.getFluxHistory(...params))
- );
-}
-
export function setMonitorState(monitor) {
return {
type: ActionTypes.MONITOR_STATE,
diff --git a/client/app/scripts/components/app.js b/client/app/scripts/components/app.js
index 60a645a6b..e3c0ccf64 100644
--- a/client/app/scripts/components/app.js
+++ b/client/app/scripts/components/app.js
@@ -1,5 +1,6 @@
import debug from 'debug';
import React from 'react';
+import PropTypes from 'prop-types';
import classNames from 'classnames';
import { connect } from 'react-redux';
import { debounce } from 'lodash';
@@ -11,7 +12,6 @@ import Logo from './logo';
import Footer from './footer';
import Sidebar from './sidebar';
import HelpPanel from './help-panel';
-import CloudFeature from './cloud-feature';
import TroubleshootingMenu from './troubleshooting-menu';
import Search from './search';
import Status from './status';
@@ -59,7 +59,6 @@ import {
const keyPressLog = debug('scope:app-key-press');
-
class App extends React.Component {
constructor(props, context) {
super(props, context);
@@ -205,11 +204,7 @@ class App extends React.Component {
{showingDetails &&