mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
Deprecate database attribute allow_run_sync (#4961)
* Deprecate database attribute allow_run_sync There's really 2 modes of operations in SQL Lab, sync or async though currently there are 2 boolean flags: allow_run_sync and allow_run_async, leading to 4 potential combinations, only 2 of which actually makes sense. The original vision is that we'd expose the choice to users and they would decide which `Run` or `Run Async` button to hit. Later on we decided to have a single button and for each database to be either sync or async. This PR cleans up allow_run_sync by removing references to it. * Fix build * Add db migration * using batch_op
This commit is contained in:
committed by
GitHub
parent
529cb5cab1
commit
2931baa294
@@ -29,7 +29,28 @@ export default function RunQueryActionButton(props) {
|
||||
disabled: !(props.dbId),
|
||||
};
|
||||
|
||||
const syncBtn = (
|
||||
if (shouldShowStopBtn) {
|
||||
return (
|
||||
<Button
|
||||
{...commonBtnProps}
|
||||
onClick={props.stopQuery}
|
||||
>
|
||||
<i className="fa fa-stop" /> {t('Stop')}
|
||||
</Button>
|
||||
);
|
||||
} else if (props.allowAsync) {
|
||||
return (
|
||||
<Button
|
||||
{...commonBtnProps}
|
||||
onClick={() => props.runQuery(true)}
|
||||
key="run-async-btn"
|
||||
tooltip={t('Run query asynchronously')}
|
||||
disabled={!props.sql.trim()}
|
||||
>
|
||||
<i className="fa fa-table" /> {runBtnText}
|
||||
</Button>);
|
||||
}
|
||||
return (
|
||||
<Button
|
||||
{...commonBtnProps}
|
||||
onClick={() => props.runQuery(false)}
|
||||
@@ -40,37 +61,6 @@ export default function RunQueryActionButton(props) {
|
||||
<i className="fa fa-refresh" /> {runBtnText}
|
||||
</Button>
|
||||
);
|
||||
|
||||
const asyncBtn = (
|
||||
<Button
|
||||
{...commonBtnProps}
|
||||
onClick={() => props.runQuery(true)}
|
||||
key="run-async-btn"
|
||||
tooltip={t('Run query asynchronously')}
|
||||
disabled={!props.sql.trim()}
|
||||
>
|
||||
<i className="fa fa-table" /> {runBtnText}
|
||||
</Button>
|
||||
);
|
||||
|
||||
const stopBtn = (
|
||||
<Button
|
||||
{...commonBtnProps}
|
||||
onClick={props.stopQuery}
|
||||
>
|
||||
<i className="fa fa-stop" /> {t('Stop')}
|
||||
</Button>
|
||||
);
|
||||
|
||||
let button;
|
||||
if (shouldShowStopBtn) {
|
||||
button = stopBtn;
|
||||
} else if (props.allowAsync) {
|
||||
button = asyncBtn;
|
||||
} else {
|
||||
button = syncBtn;
|
||||
}
|
||||
return button;
|
||||
}
|
||||
|
||||
RunQueryActionButton.propTypes = propTypes;
|
||||
|
||||
Reference in New Issue
Block a user