mirror of https://github.com/apache/superset.git
Do not autorun query on tab duplicate (#8577)
* Pass autorun argument to cloneQueryToNewTab * Accept autorun argument * Fix unit test
This commit is contained in:
parent
26c55bd57a
commit
9044f210ee
|
@ -278,7 +278,7 @@ describe('async actions', () => {
|
|||
id: 'abcd',
|
||||
},
|
||||
}];
|
||||
return store.dispatch(actions.cloneQueryToNewTab(query)).then(() => {
|
||||
return store.dispatch(actions.cloneQueryToNewTab(query, true)).then(() => {
|
||||
expect(store.getActions()).toEqual(expectedActions);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -445,7 +445,7 @@ export function addQueryEditor(queryEditor) {
|
|||
};
|
||||
}
|
||||
|
||||
export function cloneQueryToNewTab(query) {
|
||||
export function cloneQueryToNewTab(query, autorun) {
|
||||
return function (dispatch, getState) {
|
||||
const state = getState();
|
||||
const { queryEditors, tabHistory } = state.sqlLab;
|
||||
|
@ -454,7 +454,7 @@ export function cloneQueryToNewTab(query) {
|
|||
title: t('Copy of %s', sourceQueryEditor.title),
|
||||
dbId: query.dbId ? query.dbId : null,
|
||||
schema: query.schema ? query.schema : null,
|
||||
autorun: true,
|
||||
autorun,
|
||||
sql: query.sql,
|
||||
queryLimit: sourceQueryEditor.queryLimit,
|
||||
maxRow: sourceQueryEditor.maxRow,
|
||||
|
|
|
@ -80,7 +80,7 @@ class QueryTable extends React.PureComponent {
|
|||
}
|
||||
|
||||
openQueryInNewTab(query) {
|
||||
this.props.actions.cloneQueryToNewTab(query);
|
||||
this.props.actions.cloneQueryToNewTab(query, true);
|
||||
}
|
||||
openAsyncResults(query, displayLimit) {
|
||||
this.props.actions.fetchQueryResults(query, displayLimit);
|
||||
|
|
|
@ -218,7 +218,7 @@ class TabbedSqlEditors extends React.PureComponent {
|
|||
.forEach(qe => qe !== cqe && this.removeQueryEditor(qe));
|
||||
}
|
||||
duplicateQueryEditor(qe) {
|
||||
this.props.actions.cloneQueryToNewTab(qe);
|
||||
this.props.actions.cloneQueryToNewTab(qe, false);
|
||||
}
|
||||
toggleLeftBar() {
|
||||
this.setState({ hideLeftBar: !this.state.hideLeftBar });
|
||||
|
|
Loading…
Reference in New Issue