mirror of https://github.com/apache/superset.git
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 = {
|
||||
...queryEditor,
|
||||
id: json.id.toString(),
|
||||
inLocalStorage: false,
|
||||
};
|
||||
dispatch({
|
||||
type: MIGRATE_QUERY_EDITOR,
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue