You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/08/24 17:40:16 UTC

[GitHub] [superset] codyml commented on a diff in pull request #21172: fix(database-modal): Show a different placeholder text in Snowflake connection form

codyml commented on code in PR #21172:
URL: https://github.com/apache/superset/pull/21172#discussion_r954094039


##########
superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm/CommonParameters.tsx:
##########
@@ -85,10 +86,10 @@ export const databaseField = ({
     value={db?.parameters?.database}
     validationMethods={{ onBlur: getValidation }}
     errorMessage={validationErrors?.database}
-    placeholder={t('e.g. world_population')}
+    placeholder={t(placeholder ?? 'e.g. world_population')}

Review Comment:
   I don't have a great sense of how translation strings work, but I wonder if this might break the build step of extracting translatable strings to have the argument of `t()` be dynamically set at render time.  If you or someone else knows for sure definitely correct me, but would it be safer to have this just be `placeholder ?? t('e.g. world_population')` and instead call `t()` for `placeholder` where the string literal is defined in `superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx`?



##########
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx:
##########
@@ -1607,6 +1615,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
                   }
                   getValidation={() => getValidation(db)}
                   validationErrors={validationErrors}
+                  getPlaceholder={field => getPlaceholder(field)}

Review Comment:
   Could this be done without defining a new inline function each render?
   
   ```suggestion
                     getPlaceholder={getPlaceholder}
   ```



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org