mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
only show the reset state button if location param (#1075)
This commit is contained in:
@@ -117,6 +117,7 @@ class SqlEditorTopToolbar extends React.Component {
|
||||
}
|
||||
render() {
|
||||
const tables = this.props.tables.filter((t) => (t.queryEditorId === this.props.queryEditor.id));
|
||||
const shouldShowReset = window.location.search === '?reset=1';
|
||||
return (
|
||||
<div className="clearfix sql-toolbar">
|
||||
<div>
|
||||
@@ -159,9 +160,11 @@ class SqlEditorTopToolbar extends React.Component {
|
||||
<TableElement table={table} queryEditor={this.props.queryEditor} />
|
||||
))}
|
||||
</div>
|
||||
<Button bsSize="small" bsStyle="danger" onClick={this.resetState.bind(this)}>
|
||||
<i className="fa fa-bomb" /> Reset State
|
||||
</Button>
|
||||
{shouldShowReset &&
|
||||
<Button bsSize="small" bsStyle="danger" onClick={this.resetState.bind(this)}>
|
||||
<i className="fa fa-bomb" /> Reset State
|
||||
</Button>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user