You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2021/05/27 20:57:48 UTC

[superset] 02/02: working select

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 ff8072db105151f2a09106fa67f35c796c701dfc
Author: hughhhh <hu...@gmail.com>
AuthorDate: Thu May 27 16:55:14 2021 -0400

    working select
---
 .../views/CRUD/data/database/DatabaseModal/index.tsx    | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 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 82e3754..4cf329c 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
@@ -538,10 +538,21 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
               <Select
                 defaultValue={'bigquery'}
                 style={{ width: '100%' }}
-                onChange={option => console.log('hi')}
+                onChange={option => {
+                  console.log(option);
+                  setDB({
+                    type: ActionType.dbSelected,
+                    payload: {
+                      configuration_method: CONFIGURATION_METHOD.DYNAMIC_FORM,
+                      engine: option,
+                    },
+                  });
+                }}
               >
-                {availableDbs?.databases?.map((engine) => (
-                  <Select.Option key={engine.engine} >{engine.name}</Select.Option>
+                {availableDbs?.databases?.map(database => (
+                  <Select.Option value={database.engine} key={database.engine}>
+                    {database.name}
+                  </Select.Option>
                 ))}
               </Select>
             </>