Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(crud): set default extra value when adding database #11262

Merged
merged 1 commit into from
Oct 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,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 @@ -588,11 +591,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