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/06/14 03:23:19 UTC
[superset] 02/03: acquired most of json
This is an automated email from the ASF dual-hosted git repository.
hugh pushed a commit to branch hugh/db-connection-ui-extra
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 3429cb150195e8790a401cb1deddf43c20652f29
Author: hughhhh <hu...@gmail.com>
AuthorDate: Sun Jun 13 19:59:42 2021 -0400
acquired most of json
---
.../CRUD/data/database/DatabaseModal/ExtraOptions.tsx | 2 +-
.../views/CRUD/data/database/DatabaseModal/index.tsx | 19 +++++++++++++++----
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ExtraOptions.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ExtraOptions.tsx
index 6b6bf71..3a27aca 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ExtraOptions.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ExtraOptions.tsx
@@ -361,7 +361,7 @@ const ExtraOptions = ({
name="schemas_allowed_for_csv_upload"
value={db?.extra_json?.schemas_allowed_for_csv_upload || ''}
placeholder={t('Select one or multiple schemas')}
- onChange={onInputChange}
+ onChange={onExtraInputChange}
/>
</div>
<div className="helper">
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 30f99be..6df6f4f 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
@@ -145,6 +145,20 @@ function dbReducer(
},
};
case ActionType.extraInputChange:
+ console.log(action)
+ if (action.payload.name === 'schema_cache_timeout' || action.payload.name === 'table_cache_timeout') {
+ return {
+ ...trimmedState,
+ extra_json: {
+ ...trimmedState.extra_json,
+ metadata_cache_timeout: {
+ ...trimmedState.extra_json?.metadata_cache_timeout,
+ [action.payload.name]: action.payload.value,
+ }
+ },
+ };
+ }
+ console.log('after', action)
return {
...trimmedState,
extra_json: {
@@ -192,7 +206,7 @@ function dbReducer(
[action.payload.name]: action.payload.value,
};
case ActionType.fetched:
- console.log(action.payload);
+ console.log('payload', action.payload);
let extra_json = {
...JSON.parse(action.payload.extra || ''),
};
@@ -202,9 +216,6 @@ function dbReducer(
...extra_json,
metadata_params: JSON.stringify(extra_json.metadata_params),
engine_params: JSON.stringify(extra_json.engine_params),
- metadata_cache_timeout: JSON.stringify(
- extra_json.metadata_cache_timeout,
- ),
schemas_allowed_for_csv_upload: JSON.stringify(
extra_json.schemas_allowed_for_csv_upload,
),