From d2b832edc9f619d963058a9e55b2a3f7bf3183f3 Mon Sep 17 00:00:00 2001 From: Sachin Chaurasiya Date: Thu, 25 May 2023 19:19:33 +0530 Subject: [PATCH] chore(ui): add internal form item props support in form utils (#11763) --- .../src/components/AddService/Steps/ConfigureService.tsx | 4 ---- .../AddCustomProperty/AddCustomProperty.tsx | 4 ---- .../src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx | 4 ---- .../src/main/resources/ui/src/utils/formUtils.tsx | 7 +++++++ 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddService/Steps/ConfigureService.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddService/Steps/ConfigureService.tsx index 5175680bc78..3f0b09a53ff 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddService/Steps/ConfigureService.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddService/Steps/ConfigureService.tsx @@ -56,10 +56,6 @@ const ConfigureService = ({ 'data-testid': 'description', initialValue: '', }, - formItemProps: { - trigger: 'onTextChange', - valuePropName: 'initialValue', - }, }, ]; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/CustomEntityDetail/AddCustomProperty/AddCustomProperty.tsx b/openmetadata-ui/src/main/resources/ui/src/components/CustomEntityDetail/AddCustomProperty/AddCustomProperty.tsx index 7750231ade7..04fa3351ba7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/CustomEntityDetail/AddCustomProperty/AddCustomProperty.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/CustomEntityDetail/AddCustomProperty/AddCustomProperty.tsx @@ -198,10 +198,6 @@ const AddCustomProperty = () => { 'data-testid': 'description', initialValue: '', }, - formItemProps: { - trigger: 'onTextChange', - valuePropName: 'initialValue', - }, }, ]; diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx index 181a5f1980f..88edd67540b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx @@ -78,10 +78,6 @@ const TagsForm = ({ 'data-testid': 'description', initialValue: '', }, - formItemProps: { - trigger: 'onTextChange', - valuePropName: 'initialValue', - }, }, ...(showMutuallyExclusive ? ([ diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/formUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/formUtils.tsx index f6192ab55e0..f7051a631cd 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/formUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/formUtils.tsx @@ -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 = ( ); + 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}