hainenber commented on code in PR #31979:
URL: https://github.com/apache/superset/pull/31979#discussion_r1932429456


##########
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:
   @korbit-ai Going with your proposed change yields this issue
   
   ```
   Property 'className' does not exist on type '{ label: string; helpText: 
string; placeholder: string; } | { label: string; placeholder: string; 
className: string; } | { label: string; placeholder: string; className: string; 
}'.
     Property 'className' does not exist on type '{ label: string; helpText: 
string; placeholder: string; }'.ts(2339)
     ```



-- 
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]

Reply via email to