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:
Hugh A. Miles II
2022-02-10 19:12:52 -05:00
committed by GitHub
parent 33d1c96764
commit 78e20e21ab
2 changed files with 27 additions and 0 deletions

View File

@@ -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) => {