korbit-ai[bot] commented on code in PR #31979:
URL: https://github.com/apache/superset/pull/31979#discussion_r1932427922
##########
superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/ValidatedInputField.tsx:
##########
@@ -52,13 +54,13 @@
id={field}
name={field}
required={required}
- value={db?.parameters?.[field]}
+ value={db?.parameters?.[field as keyof DatabaseParameters]}
validationMethods={{ onBlur: getValidation }}
errorMessage={validationErrors?.[field]}
- placeholder={FIELD_TEXT_MAP[field].placeholder}
- helpText={FIELD_TEXT_MAP[field].helpText}
- label={FIELD_TEXT_MAP[field].label || field}
+ placeholder={FIELD_TEXT_MAP[field as FieldTextMapKey].placeholder}
+ helpText={FIELD_TEXT_MAP[field as 'account']?.helpText}
Review Comment:
Thanks for your feedback. It seems like 'helpText' does not exist for all
the field types in the FIELD_TEXT_MAP. If 'helpText' is not intended for the
fields 'warehouse' and 'role', then the current implementation is ok because it
will not cause 'helpText' to become undefined. However, if it should exist for
each field type, then we may need to adjust the FIELD_TEXT_MAP to include
'helpText' for every field.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]