mirror of
https://github.com/apache/superset.git
synced 2026-08-04 04:52:32 +00:00
fix(sqllab): preserve query history after tab migration (#41403)
(cherry picked from commit 7926c3a93a)
This commit is contained in:
@@ -488,8 +488,8 @@ export function syncQueryEditor(queryEditor) {
|
||||
const localStorageTables = tables.filter(
|
||||
table => table.inLocalStorage && table.queryEditorId === queryEditor.id,
|
||||
);
|
||||
const localStorageQueries = Object.values(queries).filter(
|
||||
query => query.inLocalStorage && query.sqlEditorId === queryEditor.id,
|
||||
const queriesToMigrate = Object.values(queries).filter(
|
||||
query => query.sqlEditorId === queryEditor.id && !query.isDataPreview,
|
||||
);
|
||||
return SupersetClient.post({
|
||||
endpoint: '/tabstateview/',
|
||||
@@ -511,7 +511,7 @@ export function syncQueryEditor(queryEditor) {
|
||||
...localStorageTables.map(table =>
|
||||
migrateTable(table, newQueryEditor.tabViewId, dispatch),
|
||||
),
|
||||
...localStorageQueries.map(query =>
|
||||
...queriesToMigrate.map(query =>
|
||||
migrateQuery(query.id, newQueryEditor.tabViewId, dispatch),
|
||||
),
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user