mirror of https://github.com/apache/superset.git
feat: Allow users to connect via legacy SQLA form (#16201)
* hugh/dbui-other * remove extra condition * add not callable * Update .pylintrc Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
This commit is contained in:
parent
67c4c0116e
commit
171514360e
|
@ -91,7 +91,6 @@ disable=
|
|||
too-few-public-methods,
|
||||
too-many-locals,
|
||||
|
||||
|
||||
[REPORTS]
|
||||
|
||||
# Set the output format. Available formats are text, parseable, colorized, msvs
|
||||
|
|
|
@ -656,6 +656,17 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
|||
};
|
||||
|
||||
const setDatabaseModel = (database_name: string) => {
|
||||
if (database_name === 'Other') {
|
||||
// Allow users to connect to DB via legacy SQLA form
|
||||
setDB({
|
||||
type: ActionType.dbSelected,
|
||||
payload: {
|
||||
database_name,
|
||||
configuration_method: CONFIGURATION_METHOD.SQLALCHEMY_URI,
|
||||
engine: undefined,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
const selectedDbModel = availableDbs?.databases.filter(
|
||||
(db: DatabaseObject) => db.name === database_name,
|
||||
)[0];
|
||||
|
@ -671,6 +682,8 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
|||
engine,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
setDB({ type: ActionType.addTableCatalogSheet });
|
||||
};
|
||||
|
||||
|
@ -694,6 +707,10 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
|||
{database.name}
|
||||
</Select.Option>
|
||||
))}
|
||||
{/* Allow users to connect to DB via legacy SQLA form */}
|
||||
<Select.Option value="Other" key="Other">
|
||||
Other
|
||||
</Select.Option>
|
||||
</Select>
|
||||
<Alert
|
||||
showIcon
|
||||
|
|
Loading…
Reference in New Issue