mirror of
https://github.com/apache/superset.git
synced 2026-04-23 18:14:56 +00:00
[SQL Lab] Adding DB options for SQL LAb (#1054)
* [SQL Lab] Adding DB options for SQL LAb each db can be exposed or not in SQL Lab CTAS is an option target_schema placeholder (not hooked yet, but would force the CTAS to target a specific schema) * Addressing comments
This commit is contained in:
committed by
GitHub
parent
1667d15f31
commit
4b77710016
@@ -15,6 +15,7 @@ const defaultQueryEditor = {
|
||||
export const initialState = {
|
||||
alerts: [],
|
||||
queries: {},
|
||||
databases: {},
|
||||
queryEditors: [defaultQueryEditor],
|
||||
tabHistory: [defaultQueryEditor.id],
|
||||
tables: [],
|
||||
@@ -166,6 +167,13 @@ export const sqlLabReducer = function (state, action) {
|
||||
[actions.ADD_ALERT]() {
|
||||
return addToArr(state, 'alerts', action.alert);
|
||||
},
|
||||
[actions.SET_DATABASES]() {
|
||||
const databases = {};
|
||||
action.databases.forEach((db) => {
|
||||
databases[db.id] = db;
|
||||
});
|
||||
return Object.assign({}, state, { databases });
|
||||
},
|
||||
[actions.REMOVE_ALERT]() {
|
||||
return removeFromArr(state, 'alerts', action.alert);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user