mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
[explore] convert query and save btns to react (#690)
* start to convert query and save btns to react * more explore.jsx to explore/
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import classnames from 'classnames';
|
||||
|
||||
const propTypes = {
|
||||
canAdd: PropTypes.string.isRequired,
|
||||
onQuery: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default class QueryAndSaveBtns extends React.Component {
|
||||
render() {
|
||||
const saveClasses = classnames('btn btn-default', {
|
||||
'disabled disabledButton': this.props.canAdd !== 'True',
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="btn-group query-and-save">
|
||||
<button type="button" className="btn btn-primary" onClick={this.props.onQuery}>
|
||||
<i className="fa fa-bolt"></i>Query
|
||||
</button>
|
||||
<button type="button"
|
||||
className={saveClasses}
|
||||
onClick={this.props.onSave}
|
||||
data-target="#save_modal"
|
||||
data-toggle="modal"
|
||||
>
|
||||
<i className="fa fa-plus-circle"></i>Save as
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
QueryAndSaveBtns.propTypes = propTypes;
|
||||
Reference in New Issue
Block a user