mirror of
https://github.com/apache/superset.git
synced 2026-04-17 23:25:05 +00:00
Save modal component for explore v2 (#1612)
* Added specs for SaveModal * Move datasource_id and datasource_name to form_data * Add comments * Deleted redundant fetchDashboard * Replcae has_key for python3 * More react and less jquery * Added alert for save slice * Small changes based on comments * Use react bootstrap
This commit is contained in:
@@ -4,9 +4,14 @@ import classnames from 'classnames';
|
||||
const propTypes = {
|
||||
canAdd: PropTypes.string.isRequired,
|
||||
onQuery: PropTypes.func.isRequired,
|
||||
onSave: PropTypes.func,
|
||||
};
|
||||
|
||||
export default function QueryAndSaveBtns({ canAdd, onQuery }) {
|
||||
const defaultProps = {
|
||||
onSave: () => {},
|
||||
};
|
||||
|
||||
export default function QueryAndSaveBtns({ canAdd, onQuery, onSave }) {
|
||||
const saveClasses = classnames('btn btn-default btn-sm', {
|
||||
'disabled disabledButton': canAdd !== 'True',
|
||||
});
|
||||
@@ -21,6 +26,7 @@ export default function QueryAndSaveBtns({ canAdd, onQuery }) {
|
||||
className={saveClasses}
|
||||
data-target="#save_modal"
|
||||
data-toggle="modal"
|
||||
onClick={onSave}
|
||||
>
|
||||
<i className="fa fa-plus-circle"></i> Save as
|
||||
</button>
|
||||
@@ -29,3 +35,4 @@ export default function QueryAndSaveBtns({ canAdd, onQuery }) {
|
||||
}
|
||||
|
||||
QueryAndSaveBtns.propTypes = propTypes;
|
||||
QueryAndSaveBtns.defaultProps = defaultProps;
|
||||
|
||||
Reference in New Issue
Block a user