This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch pexdax/db-connection-ui-show-available
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 95ba36c69f33cb3b4746fd3c00a33295a1c6d715
Author: hughhhh <[email protected]>
AuthorDate: Thu May 27 17:38:01 2021 -0400

    setup is loading for available dbs and step1 view
---
 .../src/views/CRUD/data/database/DatabaseModal/index.tsx       | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 
a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx 
b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
index 4cf329c..687bcd4 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
@@ -134,8 +134,6 @@ function dbReducer(
     ...(state || {}),
   };
 
-  console.log(action);
-
   switch (action.type) {
     case ActionType.inputChange:
       if (action.payload.type === 'checkbox') {
@@ -173,6 +171,9 @@ function dbReducer(
         ...action.payload,
       };
     case ActionType.dbSelected:
+      return {
+        ...action.payload,
+      };
     case ActionType.configMethodChange:
       return {
         ...action.payload,
@@ -205,7 +206,6 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> 
= ({
   const [isLoading, setLoading] = useState<boolean>(false);
   const conf = useCommonConf();
 
-  const isSelectMode = true;
   const isEditMode = !!databaseId;
   const useSqlAlchemyForm =
     db?.configuration_method === CONFIGURATION_METHOD.SQLALCHEMY_URI;
@@ -530,16 +530,14 @@ const DatabaseModal: 
FunctionComponent<DatabaseModalProps> = ({
             getValidation={() => getValidation(db)}
             validationErrors={validationErrors}
           />
-          {isSelectMode && !isLoading && (
+          {!isLoading && !db && (
             <>
               <label className="label-select">
                 What database would you like to connect?
               </label>
               <Select
-                defaultValue={'bigquery'}
                 style={{ width: '100%' }}
                 onChange={option => {
-                  console.log(option);
                   setDB({
                     type: ActionType.dbSelected,
                     payload: {

Reply via email to