From 2a35066f375ae60adf160ab9e855e51a3073a3f4 Mon Sep 17 00:00:00 2001 From: Taylor Date: Wed, 13 Apr 2022 08:46:03 -0400 Subject: [PATCH 1/2] fix(db & connection): make to show/hide the password when only creating db connection --- .../Form/LabeledErrorBoundInput.tsx | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx b/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx index be9e0af16f2c1..708065824a787 100644 --- a/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx +++ b/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx @@ -17,7 +17,8 @@ * under the License. */ import React from 'react'; -import { Input } from 'antd'; +import { Input, Tooltip } from 'antd'; +import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; import { styled, css, SupersetTheme } from '@superset-ui/core'; import InfoTooltip from 'src/components/InfoTooltip'; import errorIcon from 'src/assets/images/icons/error.svg'; @@ -43,6 +44,10 @@ const StyledInput = styled(Input)` margin: ${({ theme }) => `${theme.gridUnit}px 0 ${theme.gridUnit * 2}px`}; `; +const StyledInputPassword = styled(Input.Password)` + margin: ${({ theme }) => `${theme.gridUnit}px 0 ${theme.gridUnit * 2}px`}; +`; + const alertIconStyles = (theme: SupersetTheme, hasError: boolean) => css` .ant-form-item-children-icon { display: none; @@ -114,7 +119,25 @@ const LabeledErrorBoundInput = ({ help={errorMessage || helpText} hasFeedback={!!errorMessage} > - + {props.name === 'password' ? ( + + visible ? ( + + + + ) : ( + + + + ) + } + /> + ) : ( + + )} ); From 4b7de08c7a8141ccf5dc09c4af9d8d250c1c5013 Mon Sep 17 00:00:00 2001 From: Taylor Date: Mon, 25 Apr 2022 17:47:23 -0400 Subject: [PATCH 2/2] fix(db & connection): make to fix unit test of Database Modal --- superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx b/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx index 708065824a787..ebbb1c023622e 100644 --- a/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx +++ b/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx @@ -134,6 +134,7 @@ const LabeledErrorBoundInput = ({ ) } + role="textbox" /> ) : (