You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ly...@apache.org on 2022/12/07 21:13:58 UTC

[superset] 01/01: Change input to use showPassword prop instead of looking for password in props.name

This is an automated email from the ASF dual-hosted git repository.

lyndsi pushed a commit to branch lyndsi/optimize-password-input
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 9c69d385d675db041f423f7d9a6cb1648e212adc
Author: lyndsiWilliams <kc...@gmail.com>
AuthorDate: Wed Dec 7 14:56:14 2022 -0600

    Change input to use showPassword prop instead of looking for password in props.name
---
 superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx      | 4 +++-
 .../DatabaseModal/DatabaseConnectionForm/CommonParameters.tsx         | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx b/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx
index ebbb1c0236..032415d905 100644
--- a/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx
+++ b/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx
@@ -37,6 +37,7 @@ export interface LabeledErrorBoundInputProps {
   tooltipText?: string | null;
   id?: string;
   classname?: string;
+  showPasswordField?: boolean;
   [x: string]: any;
 }
 
@@ -101,6 +102,7 @@ const LabeledErrorBoundInput = ({
   tooltipText,
   id,
   className,
+  showPasswordField,
   ...props
 }: LabeledErrorBoundInputProps) => (
   <StyledFormGroup className={className}>
@@ -119,7 +121,7 @@ const LabeledErrorBoundInput = ({
       help={errorMessage || helpText}
       hasFeedback={!!errorMessage}
     >
-      {props.name === 'password' ? (
+      {showPasswordField || props.name === 'password' ? (
         <StyledInputPassword
           {...props}
           {...validationMethods}
diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm/CommonParameters.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm/CommonParameters.tsx
index d426cf4cdf..7ac1ef8d89 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm/CommonParameters.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm/CommonParameters.tsx
@@ -153,6 +153,7 @@ export const passwordField = ({
     placeholder={t('e.g. ********')}
     label={t('Password')}
     onChange={changeMethods.onParametersChange}
+    showPasswordField
   />
 );
 export const accessTokenField = ({