mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-30 11:56:01 +00:00
parent
11c07ee8ab
commit
b8726d15d0
@ -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<WidgetProps> = ({
|
||||
onFocus,
|
||||
onBlur,
|
||||
onChange,
|
||||
...rest
|
||||
}) => {
|
||||
return (
|
||||
<Input.Password
|
||||
autoComplete="off"
|
||||
autoFocus={rest.autofocus}
|
||||
disabled={rest.disabled}
|
||||
id={rest.id}
|
||||
name={rest.name}
|
||||
placeholder={rest.placeholder}
|
||||
readOnly={rest.readonly}
|
||||
required={rest.required}
|
||||
value={rest.value}
|
||||
onBlur={() => onBlur(rest.id, rest.value)}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
onFocus={() => onFocus(rest.id, rest.value)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default PasswordWidget;
|
@ -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<Props> = ({
|
||||
}}
|
||||
transformErrors={transformErrors}
|
||||
uiSchema={uiSchema}
|
||||
widgets={{ PasswordWidget: PasswordWidget }}
|
||||
onChange={handleFormChange}
|
||||
onFocus={onFocus}
|
||||
onSubmit={onSubmit}
|
||||
|
Loading…
x
Reference in New Issue
Block a user