Skip to content

Commit

Permalink
Moved pause button back to footer. (#2585)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarl authored Jun 14, 2017
1 parent 83f557b commit c4e0be4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
6 changes: 4 additions & 2 deletions client/app/scripts/actions/app-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,13 +635,15 @@ function updateFromNodesDeltaBuffer(dispatch, state) {
}

export function clickResumeUpdate() {
return (dispatch, getServiceState) => {
return (dispatch, getState) => {
dispatch({
type: ActionTypes.CLICK_RESUME_UPDATE
});
// TODO: Find a better way to do this (see the comment above).
const state = getState().scope || getState();
// Periodically merge buffered nodes deltas until the buffer is emptied.
nodesDeltaBufferUpdateTimer = setInterval(
() => updateFromNodesDeltaBuffer(dispatch, getServiceState().scope),
() => updateFromNodesDeltaBuffer(dispatch, state),
NODES_DELTA_BUFFER_FEED_INTERVAL,
);
};
Expand Down
2 changes: 2 additions & 0 deletions client/app/scripts/components/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { connect } from 'react-redux';

import Plugins from './plugins';
import PauseButton from './pause-button';
import { trackMixpanelEvent } from '../utils/tracking-utils';
import {
clickDownloadGraph,
Expand Down Expand Up @@ -65,6 +66,7 @@ class Footer extends React.Component {
</div>

<div className="footer-tools">
<PauseButton />
<a
className="footer-icon"
onClick={this.handleRelayoutClick}
Expand Down
14 changes: 7 additions & 7 deletions client/app/scripts/components/pause-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ class PauseButton extends React.Component {
}
}

function mapStateToProps({ scope }) {
function mapStateToProps(state) {
return {
hasUpdates: !scope.get('nodesDeltaBuffer').isEmpty(),
updateCount: scope.get('nodesDeltaBuffer').size,
updatePausedAt: scope.get('updatePausedAt'),
topologyViewMode: scope.get('topologyViewMode'),
currentTopology: scope.get('currentTopology'),
isPaused: isPausedSelector(scope),
hasUpdates: !state.get('nodesDeltaBuffer').isEmpty(),
updateCount: state.get('nodesDeltaBuffer').size,
updatePausedAt: state.get('updatePausedAt'),
topologyViewMode: state.get('topologyViewMode'),
currentTopology: state.get('currentTopology'),
isPaused: isPausedSelector(state),
};
}

Expand Down
4 changes: 1 addition & 3 deletions client/app/scripts/components/time-travel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import classNames from 'classnames';
import { connect } from 'react-redux';
import { debounce } from 'lodash';

import PauseButton from './pause-button';
import TimeTravelTimestamp from './time-travel-timestamp';
import { trackMixpanelEvent } from '../utils/tracking-utils';
import {
Expand Down Expand Up @@ -260,7 +259,6 @@ class TimeTravel extends React.Component {
selected={showSliderPanel}
/>
{!isCurrent && this.renderJumpToNowButton()}
<PauseButton />
</div>
</div>
);
Expand All @@ -271,7 +269,7 @@ function mapStateToProps({ scope, root }, { params }) {
const cloudInstance = root.instances[params.orgId] || {};
const featureFlags = cloudInstance.featureFlags || [];
return {
hasTimeTravel: featureFlags.includes('timeline-control'),
hasTimeTravel: featureFlags.includes('time-travel'),
websocketTransitioning: scope.get('websocketTransitioning'),
topologyViewMode: scope.get('topologyViewMode'),
currentTopology: scope.get('currentTopology'),
Expand Down
2 changes: 1 addition & 1 deletion client/app/styles/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
margin-right: 1em;
}

&-label {
&-label, .pause-text {
text-transform: uppercase;
margin: 0 0.25em;
}
Expand Down

0 comments on commit c4e0be4

Please sign in to comment.