mirror of
https://github.com/apache/superset.git
synced 2026-04-10 11:55:24 +00:00
* Get query buttonw working in explorev2 - Create new endpoint for updating explore viz - Send over new form_data when query button is pressed * Added endpoint test * Changes based on comments * Added docstring for endpoint, and query spec * Remove white space around docstring
32 lines
849 B
JavaScript
32 lines
849 B
JavaScript
import React, { PropTypes } from 'react';
|
|
import classnames from 'classnames';
|
|
|
|
const propTypes = {
|
|
canAdd: PropTypes.string.isRequired,
|
|
onQuery: PropTypes.func.isRequired,
|
|
};
|
|
|
|
export default function QueryAndSaveBtns({ canAdd, onQuery }) {
|
|
const saveClasses = classnames('btn btn-default btn-sm', {
|
|
'disabled disabledButton': canAdd !== 'True',
|
|
});
|
|
|
|
return (
|
|
<div className="btn-group query-and-save">
|
|
<button id="query_button" type="button" className="btn btn-primary btn-sm" onClick={onQuery}>
|
|
<i className="fa fa-bolt"></i> Query
|
|
</button>
|
|
<button
|
|
type="button"
|
|
className={saveClasses}
|
|
data-target="#save_modal"
|
|
data-toggle="modal"
|
|
>
|
|
<i className="fa fa-plus-circle"></i> Save as
|
|
</button>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
QueryAndSaveBtns.propTypes = propTypes;
|