korbit-ai[bot] commented on code in PR #31979:
URL: https://github.com/apache/superset/pull/31979#discussion_r1932241854
##########
superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/ValidatedInputField.tsx:
##########
@@ -52,13 +54,13 @@ export const validatedInputField = ({
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}
+ label={FIELD_TEXT_MAP[field as FieldTextMapKey].label || field}
onChange={changeMethods.onParametersChange}
- className={FIELD_TEXT_MAP[field].className || field}
+ className={FIELD_TEXT_MAP[field as 'warehouse' | 'role'].className ||
field}
Review Comment:
@hainenber, thank you for your response. On this instance, `setHover` was
not the focus of my comment but I understand your perspective. If `className`
is only expected to cover the 'warehouse' and 'role' fields, that is fine.
However, my suggestion was meant to future-proof in case other field types
might require specific styling. I'm open to other alternatives if you have any
suggestions.
--
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]