chore(ui): add internal form item props support in form utils (#11763)

This commit is contained in:
Sachin Chaurasiya 2023-05-25 19:19:33 +05:30 committed by GitHub
parent 5e8a98d7a4
commit d2b832edc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 12 deletions

View File

@ -56,10 +56,6 @@ const ConfigureService = ({
'data-testid': 'description',
initialValue: '',
},
formItemProps: {
trigger: 'onTextChange',
valuePropName: 'initialValue',
},
},
];

View File

@ -198,10 +198,6 @@ const AddCustomProperty = () => {
'data-testid': 'description',
initialValue: '',
},
formItemProps: {
trigger: 'onTextChange',
valuePropName: 'initialValue',
},
},
];

View File

@ -78,10 +78,6 @@ const TagsForm = ({
'data-testid': 'description',
initialValue: '',
},
formItemProps: {
trigger: 'onTextChange',
valuePropName: 'initialValue',
},
},
...(showMutuallyExclusive
? ([

View File

@ -75,6 +75,7 @@ export const getField = (field: FieldProp) => {
formItemLayout = 'vertical',
} = field;
let internalFormItemProps: FormItemProps = {};
let fieldElement: ReactNode = null;
let fieldRules = [...rules];
if (required) {
@ -137,6 +138,11 @@ export const getField = (field: FieldProp) => {
fieldElement = (
<RichTextEditor {...(props as unknown as RichTextEditorProp)} />
);
internalFormItemProps = {
...internalFormItemProps,
trigger: 'onTextChange',
valuePropName: 'initialValue',
};
break;
default:
@ -155,6 +161,7 @@ export const getField = (field: FieldProp) => {
label={label}
name={name}
rules={fieldRules}
{...internalFormItemProps}
{...formItemProps}>
{fieldElement}
</Form.Item>