mirror of https://github.com/apache/superset.git
fix: Remove default values for engine and schemas (#15635)
* remove default values * don't set initial value on save * set defaults for engine_params * update with JSON.parse
This commit is contained in:
parent
34542db3b6
commit
2252f3396c
|
@ -414,7 +414,7 @@ const ExtraOptions = ({
|
||||||
<div className="input-container">
|
<div className="input-container">
|
||||||
<StyledJsonEditor
|
<StyledJsonEditor
|
||||||
name="metadata_params"
|
name="metadata_params"
|
||||||
value={db?.extra_json?.metadata_params || '{}'}
|
value={db?.extra_json?.metadata_params || ''}
|
||||||
placeholder={t('Metadata Parameters')}
|
placeholder={t('Metadata Parameters')}
|
||||||
onChange={(json: string) =>
|
onChange={(json: string) =>
|
||||||
onExtraEditorChange({ json, name: 'metadata_params' })
|
onExtraEditorChange({ json, name: 'metadata_params' })
|
||||||
|
@ -436,7 +436,7 @@ const ExtraOptions = ({
|
||||||
<div className="input-container">
|
<div className="input-container">
|
||||||
<StyledJsonEditor
|
<StyledJsonEditor
|
||||||
name="engine_params"
|
name="engine_params"
|
||||||
value={db?.extra_json?.engine_params || '{}'}
|
value={db?.extra_json?.engine_params || ''}
|
||||||
placeholder={t('Engine Parameters')}
|
placeholder={t('Engine Parameters')}
|
||||||
onChange={(json: string) =>
|
onChange={(json: string) =>
|
||||||
onExtraEditorChange({ json, name: 'engine_params' })
|
onExtraEditorChange({ json, name: 'engine_params' })
|
||||||
|
|
|
@ -468,9 +468,10 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||||
engine_params: JSON.parse(
|
engine_params: JSON.parse(
|
||||||
(dbToUpdate?.extra_json?.engine_params as string) || '{}',
|
(dbToUpdate?.extra_json?.engine_params as string) || '{}',
|
||||||
),
|
),
|
||||||
schemas_allowed_for_csv_upload:
|
schemas_allowed_for_csv_upload: JSON.parse(
|
||||||
(dbToUpdate?.extra_json?.schemas_allowed_for_csv_upload as string) ||
|
(dbToUpdate?.extra_json?.schemas_allowed_for_csv_upload as string) ||
|
||||||
'[]',
|
'[]',
|
||||||
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue