mirror of
https://github.com/apache/superset.git
synced 2026-04-21 17:14:57 +00:00
feat: add prop to setDBEngine in DatabaseModal (#18653)
* saving this now * remove for testing * added test * remove this * remove set * remove log * Update index.test.jsx
This commit is contained in:
@@ -135,6 +135,7 @@ interface DatabaseModalProps {
|
||||
onHide: () => void;
|
||||
show: boolean;
|
||||
databaseId: number | undefined; // If included, will go into edit mode
|
||||
dbEngine: string | undefined; // if included goto step 2 with engine already set
|
||||
}
|
||||
|
||||
enum ActionType {
|
||||
@@ -428,6 +429,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
onHide,
|
||||
show,
|
||||
databaseId,
|
||||
dbEngine,
|
||||
}) => {
|
||||
const [db, setDB] = useReducer<
|
||||
Reducer<Partial<DatabaseObject> | null, DBReducerActionType>
|
||||
@@ -850,6 +852,11 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
if (isLoading) {
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
if (availableDbs && dbEngine) {
|
||||
// set model if passed into props
|
||||
setDatabaseModel(dbEngine);
|
||||
}
|
||||
}, [availableDbs]);
|
||||
|
||||
const tabChange = (key: string) => {
|
||||
|
||||
Reference in New Issue
Block a user