Skip to content

Commit

Permalink
fix(crud): set default extra value (apache#11262)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored and dpgaspar committed Oct 15, 2020
1 parent f0cd671 commit 44b7e8e
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
const [isHidden, setIsHidden] = useState<boolean>(true);

const isEditMode = database !== null;
const defaultExtra =
'{\n "metadata_params": {},\n "engine_params": {},' +
'\n "metadata_cache_timeout": {},\n "schemas_allowed_for_csv_upload": [] \n}';

// Database fetch logic
const {
Expand Down Expand Up @@ -589,11 +592,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
<div className="input-container">
<textarea
name="extra"
value={db ? db.extra || '' : ''}
placeholder={
'{\n "metadata_params": {},\n "engine_params": {},' +
'\n "metadata_cache_timeout": {},\n "schemas_allowed_for_csv_upload": [] \n}'
}
value={(db && db.extra) ?? defaultExtra}
onChange={onTextChange}
/>
</div>
Expand Down

0 comments on commit 44b7e8e

Please sign in to comment.