Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions superset-frontend/src/SqlLab/actions/sqlLab.js
Original file line number Diff line number Diff line change
Expand Up @@ -950,12 +950,13 @@ export function mergeTable(table, query, prepend) {
return { type: MERGE_TABLE, table, query, prepend };
}

export function addTable(queryEditor, tableName, catalogName, schemaName) {
export function addTable(queryEditor, tableName, catalogName, schemaName, expanded = true) {
return function (dispatch, getState) {
const { dbId } = getUpToDateQuery(getState(), queryEditor, queryEditor.id);
const queryEditorId = queryEditor.tabViewId ?? queryEditor.id;
Comment thread
richardfogaca marked this conversation as resolved.
Outdated
const table = {
dbId,
queryEditorId: queryEditor.tabViewId ?? queryEditor.id,
queryEditorId,
catalog: catalogName,
schema: schemaName,
name: tableName,
Expand All @@ -964,7 +965,7 @@ export function addTable(queryEditor, tableName, catalogName, schemaName) {
mergeTable({
...table,
id: nanoid(11),
expanded: true,
expanded,
}),
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export function useKeywords(
data.value,
catalog,
schema,
false, // Don't auto-expand/switch tabs when adding via autocomplete
),
);
}
Expand Down
4 changes: 3 additions & 1 deletion superset-frontend/src/SqlLab/reducers/sqlLab.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ export default function sqlLabReducer(state = {}, action) {
// for new table, associate Id of query for data preview
at.dataPreviewQueryId = null;
let newState = addToArr(state, 'tables', at, Boolean(action.prepend));
newState.activeSouthPaneTab = at.id;
if (at.expanded) {
newState.activeSouthPaneTab = at.id;
}
Comment thread
richardfogaca marked this conversation as resolved.
Outdated
if (action.query) {
newState = alterInArr(newState, 'tables', at, {
dataPreviewQueryId: action.query.id,
Expand Down
Loading