Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time Travel: remove the feature flag and make the availability depend on historic reports capability #2616

Merged
merged 1 commit into from
Aug 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/app/scripts/actions/app-actions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import debug from 'debug';
import { find } from 'lodash';
import { fromJS } from 'immutable';

import ActionTypes from '../constants/action-types';
import { saveGraph } from '../utils/file-utils';
Expand Down Expand Up @@ -657,6 +658,7 @@ export function receiveTopologies(topologies) {
export function receiveApiDetails(apiDetails) {
return {
type: ActionTypes.RECEIVE_API_DETAILS,
capabilities: fromJS(apiDetails.capabilities),
hostname: apiDetails.hostname,
version: apiDetails.version,
newVersion: apiDetails.newVersion,
Expand Down
20 changes: 10 additions & 10 deletions client/app/scripts/components/time-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import moment from 'moment';
import classNames from 'classnames';
import { connect } from 'react-redux';

import CloudFeature from './cloud-feature';
import TimeTravelButton from './time-travel-button';
import { trackMixpanelEvent } from '../utils/tracking-utils';
import { pauseTimeAtNow, resumeTime, startTimeTravel } from '../actions/app-actions';

Expand Down Expand Up @@ -65,7 +63,8 @@ class TimeControl extends React.Component {
}

render() {
const { showingTimeTravel, pausedAt, timeTravelTransitioning, topologiesLoaded } = this.props;
const { showingTimeTravel, pausedAt, timeTravelTransitioning, topologiesLoaded,
hasHistoricReports } = this.props;

const isPausedNow = pausedAt && !showingTimeTravel;
const isTimeTravelling = showingTimeTravel;
Expand Down Expand Up @@ -95,13 +94,13 @@ class TimeControl extends React.Component {
{isPausedNow && <span className="fa fa-pause" />}
<span className="label">{isPausedNow ? 'Paused' : 'Pause'}</span>
</span>
<CloudFeature>
<TimeTravelButton
className={className(isTimeTravelling)}
onClick={this.handleTravelClick}
isTimeTravelling={isTimeTravelling}
/>
</CloudFeature>
{hasHistoricReports && <span
className={className(isTimeTravelling)}
onClick={this.handleTravelClick}
title="Travel back in time">
{isTimeTravelling && <span className="fa fa-clock-o" />}
<span className="label">Time Travel</span>
</span>}
</div>
</div>
{(isPausedNow || isTimeTravelling) && <span
Expand All @@ -120,6 +119,7 @@ class TimeControl extends React.Component {

function mapStateToProps(state) {
return {
hasHistoricReports: state.getIn(['capabilities', 'historic_reports']),
topologyViewMode: state.get('topologyViewMode'),
topologiesLoaded: state.get('topologiesLoaded'),
currentTopology: state.get('currentTopology'),
Expand Down
29 changes: 0 additions & 29 deletions client/app/scripts/components/time-travel-button.js

This file was deleted.

6 changes: 4 additions & 2 deletions client/app/scripts/reducers/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const topologySorter = topology => topology.get('rank');
// Initial values

export const initialState = makeMap({
capabilities: makeMap(),
contrastMode: false,
controlPipes: makeOrderedMap(), // pipeId -> controlPipe
controlStatus: makeMap(),
Expand Down Expand Up @@ -658,10 +659,11 @@ export function rootReducer(state = initialState, action) {
state = state.set('errorUrl', null);

return state.merge({
capabilities: action.capabilities,
hostname: action.hostname,
version: action.version,
plugins: action.plugins,
versionUpdate: action.newVersion
version: action.version,
versionUpdate: action.newVersion,
});
}

Expand Down