Ability to remove charts from Runs page entirely.
@@ -37,6 +37,7 @@ import {
setServerViews,
setBrowserViews,
setActiveView,
+ addView,
} from '../actions/view';
import update from 'immutability-helper';
import {BOARD} from '../util/board';
@@ -261,6 +262,7 @@ class Runs extends React.Component {
</Grid.Column>
</Grid.Row>
<Grid.Column width={16}>
+ {this.props.haveViews && (
<ViewModifier
viewType="runs"
data={this.props.data}
@@ -274,6 +276,7 @@ class Runs extends React.Component {
})
}
/>
+ )}
</Grid.Column>
<Grid.Column width={16} style={{zIndex: 2}}>
<Popup
@@ -286,6 +289,14 @@ class Runs extends React.Component {
on="click"
position="bottom left"
/>
+ {!this.props.haveViews && (
+ <Button
+ floated="right"
+ content="Add Charts"
+ icon="area chart"
+ onClick={() => this.props.addView('runs', 'New View', [])}
+ />
+ )}
<Button
floated="right"
disabled={this.props.data.selectedRuns.length === 0}
@@ -381,6 +392,9 @@ function mapStateToProps(state, ownProps) {
reduxServerViews: state.views.server,
reduxBrowserViews: state.views.browser,
activeView: state.views.other.runs.activeView,
+ haveViews:
+ !_.isEqual(state.views.browser, state.views.server) ||
+ state.views.browser.runs.tabs.length > 0,
};
}
@@ -397,6 +411,7 @@ const mapDispatchToProps = (dispatch, ownProps) => {
setBrowserViews,
setActiveView,
resetViews,
+ addView,
},
dispatch,
);
