diff --git a/openmetadata-ui/src/main/resources/ui/src/components/JsonSchemaWidgets/PasswordWidget.tsx b/openmetadata-ui/src/main/resources/ui/src/components/JsonSchemaWidgets/PasswordWidget.tsx new file mode 100644 index 00000000000..594bab9da47 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/JsonSchemaWidgets/PasswordWidget.tsx @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { WidgetProps } from '@rjsf/utils'; +import { Input } from 'antd'; +import React, { FC } from 'react'; + +const PasswordWidget: FC = ({ + onFocus, + onBlur, + onChange, + ...rest +}) => { + return ( + onBlur(rest.id, rest.value)} + onChange={(e) => onChange(e.target.value)} + onFocus={() => onFocus(rest.id, rest.value)} + /> + ); +}; + +export default PasswordWidget; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/FormBuilder/FormBuilder.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/FormBuilder/FormBuilder.tsx index dfced4f3cfb..ac466b0d1fb 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/FormBuilder/FormBuilder.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/FormBuilder/FormBuilder.tsx @@ -18,6 +18,7 @@ import classNames from 'classnames'; import { ArrayFieldTemplate } from 'components/JSONSchemaTemplate/ArrayFieldTemplate'; import DescriptionFieldTemplate from 'components/JSONSchemaTemplate/DescriptionFieldTemplate'; import { ObjectFieldTemplate } from 'components/JSONSchemaTemplate/ObjectFieldTemplate'; +import PasswordWidget from 'components/JsonSchemaWidgets/PasswordWidget'; import { ServiceCategory } from 'enums/service.enum'; import { useAirflowStatus } from 'hooks/useAirflowStatus'; import { t } from 'i18next'; @@ -125,6 +126,7 @@ const FormBuilder: FunctionComponent = ({ }} transformErrors={transformErrors} uiSchema={uiSchema} + widgets={{ PasswordWidget: PasswordWidget }} onChange={handleFormChange} onFocus={onFocus} onSubmit={onSubmit}