This is an automated email from the ASF dual-hosted git repository.
justinpark pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 62993c2fba fix(sqllab): autosync fail on migrated queryEditor (#26922)
62993c2fba is described below
commit 62993c2fbaeaca6759c98efdc9a8853d91093802
Author: JUST.in DO IT <[email protected]>
AuthorDate: Wed Jan 31 11:19:55 2024 -0800
fix(sqllab): autosync fail on migrated queryEditor (#26922)
---
superset-frontend/src/SqlLab/actions/sqlLab.js | 1 +
superset-frontend/src/SqlLab/actions/sqlLab.test.js | 11 ++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.js
b/superset-frontend/src/SqlLab/actions/sqlLab.js
index 223ca16591..e93538959d 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.js
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.js
@@ -477,6 +477,7 @@ export function migrateQueryEditorFromLocalStorage(
const newQueryEditor = {
...queryEditor,
id: json.id.toString(),
+ inLocalStorage: false,
};
dispatch({
type: MIGRATE_QUERY_EDITOR,
diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.test.js
b/superset-frontend/src/SqlLab/actions/sqlLab.test.js
index 175ea06ec3..dd48ed8c7b 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.test.js
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.test.js
@@ -937,12 +937,17 @@ describe('async actions', () => {
{ ...query, id: 'previewTwo' },
];
const store = mockStore({});
+ const oldQueryEditor = { ...queryEditor, inLocalStorage: true };
const expectedActions = [
{
type: actions.MIGRATE_QUERY_EDITOR,
- oldQueryEditor: queryEditor,
+ oldQueryEditor,
// new qe has a different id
- newQueryEditor: { ...queryEditor, id: '1' },
+ newQueryEditor: {
+ ...oldQueryEditor,
+ id: '1',
+ inLocalStorage: false,
+ },
},
{
type: actions.MIGRATE_TAB_HISTORY,
@@ -975,7 +980,7 @@ describe('async actions', () => {
return store
.dispatch(
actions.migrateQueryEditorFromLocalStorage(
- queryEditor,
+ oldQueryEditor,
tables,
queries,
),