mirror of
https://github.com/apache/superset.git
synced 2024-09-06 13:57:40 -04:00
fix(sqllab): autosync fail on migrated queryEditor (#26922)
This commit is contained in:
parent
4b85af2586
commit
62993c2fba
@ -477,6 +477,7 @@ export function migrateQueryEditorFromLocalStorage(
|
|||||||
const newQueryEditor = {
|
const newQueryEditor = {
|
||||||
...queryEditor,
|
...queryEditor,
|
||||||
id: json.id.toString(),
|
id: json.id.toString(),
|
||||||
|
inLocalStorage: false,
|
||||||
};
|
};
|
||||||
dispatch({
|
dispatch({
|
||||||
type: MIGRATE_QUERY_EDITOR,
|
type: MIGRATE_QUERY_EDITOR,
|
||||||
|
@ -937,12 +937,17 @@ describe('async actions', () => {
|
|||||||
{ ...query, id: 'previewTwo' },
|
{ ...query, id: 'previewTwo' },
|
||||||
];
|
];
|
||||||
const store = mockStore({});
|
const store = mockStore({});
|
||||||
|
const oldQueryEditor = { ...queryEditor, inLocalStorage: true };
|
||||||
const expectedActions = [
|
const expectedActions = [
|
||||||
{
|
{
|
||||||
type: actions.MIGRATE_QUERY_EDITOR,
|
type: actions.MIGRATE_QUERY_EDITOR,
|
||||||
oldQueryEditor: queryEditor,
|
oldQueryEditor,
|
||||||
// new qe has a different id
|
// new qe has a different id
|
||||||
newQueryEditor: { ...queryEditor, id: '1' },
|
newQueryEditor: {
|
||||||
|
...oldQueryEditor,
|
||||||
|
id: '1',
|
||||||
|
inLocalStorage: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: actions.MIGRATE_TAB_HISTORY,
|
type: actions.MIGRATE_TAB_HISTORY,
|
||||||
@ -975,7 +980,7 @@ describe('async actions', () => {
|
|||||||
return store
|
return store
|
||||||
.dispatch(
|
.dispatch(
|
||||||
actions.migrateQueryEditorFromLocalStorage(
|
actions.migrateQueryEditorFromLocalStorage(
|
||||||
queryEditor,
|
oldQueryEditor,
|
||||||
tables,
|
tables,
|
||||||
queries,
|
queries,
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user