mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
chore(sqllab): Remove functionNames from sqlLab state (#24026)
This commit is contained in:
@@ -56,7 +56,6 @@ export default function getInitialState({
|
||||
autorun: false,
|
||||
templateParams: null,
|
||||
dbId: defaultDbId,
|
||||
functionNames: [],
|
||||
queryLimit: common.conf.DEFAULT_SQLLAB_LIMIT,
|
||||
validationResult: {
|
||||
id: null,
|
||||
@@ -87,7 +86,6 @@ export default function getInitialState({
|
||||
autorun: activeTab.autorun,
|
||||
templateParams: activeTab.template_params || undefined,
|
||||
dbId: activeTab.database_id,
|
||||
functionNames: [],
|
||||
schema: activeTab.schema,
|
||||
queryLimit: activeTab.query_limit,
|
||||
validationResult: {
|
||||
|
||||
@@ -563,18 +563,6 @@ export default function sqlLabReducer(state = {}, action) {
|
||||
),
|
||||
};
|
||||
},
|
||||
[actions.QUERY_EDITOR_SET_FUNCTION_NAMES]() {
|
||||
return {
|
||||
...state,
|
||||
...alterUnsavedQueryEditorState(
|
||||
state,
|
||||
{
|
||||
functionNames: action.functionNames,
|
||||
},
|
||||
action.queryEditor.id,
|
||||
),
|
||||
};
|
||||
},
|
||||
[actions.QUERY_EDITOR_SET_SCHEMA]() {
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -209,14 +209,15 @@ describe('sqlLabReducer', () => {
|
||||
newState = sqlLabReducer(newState, action);
|
||||
expect(newState.unsavedQueryEditor.sql).toBe(expectedSql);
|
||||
const interceptedAction = {
|
||||
type: actions.QUERY_EDITOR_SET_FUNCTION_NAMES,
|
||||
type: actions.QUERY_EDITOR_PERSIST_HEIGHT,
|
||||
queryEditor: newState.queryEditors[0],
|
||||
functionNames: ['func1', 'func2'],
|
||||
northPercent: 46,
|
||||
southPercent: 54,
|
||||
};
|
||||
newState = sqlLabReducer(newState, interceptedAction);
|
||||
expect(newState.unsavedQueryEditor.sql).toBe(expectedSql);
|
||||
expect(newState.queryEditors[0].functionNames).toBe(
|
||||
interceptedAction.functionNames,
|
||||
expect(newState.queryEditors[0].northPercent).toBe(
|
||||
interceptedAction.northPercent,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user