From de20c36c532cc7dfaf4af575076058afcb7075ca Mon Sep 17 00:00:00 2001 From: yashin4112 Date: Thu, 20 Nov 2025 11:46:05 +0530 Subject: [PATCH] warning message added for regex textbox in the advance for single and multiline Text if user adds a regex --- ui/src/components/AdvancePropertise/index.scss | 5 +++++ ui/src/components/AdvancePropertise/index.tsx | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/ui/src/components/AdvancePropertise/index.scss b/ui/src/components/AdvancePropertise/index.scss index 3f792576..81ddb06c 100644 --- a/ui/src/components/AdvancePropertise/index.scss +++ b/ui/src/components/AdvancePropertise/index.scss @@ -184,3 +184,8 @@ } } } + +.errorMessage { + color: $color-brand-warning-medium; + font-size: 12px; +} diff --git a/ui/src/components/AdvancePropertise/index.tsx b/ui/src/components/AdvancePropertise/index.tsx index 1dac1d4b..04b77428 100644 --- a/ui/src/components/AdvancePropertise/index.tsx +++ b/ui/src/components/AdvancePropertise/index.tsx @@ -87,6 +87,9 @@ const AdvancePropertise = (props: SchemaProps) => { const [options, setOptions] = useState(props?.value?.options || []); const [draggedIndex, setDraggedIndex] = useState(null); + const [isError, setIsError] = useState(false); + const [errorMessage, setErrorMessage] = useState(''); + useEffect(() => { if (props?.data?.refrenceTo && Array.isArray(props?.data?.refrenceTo)) { const updatedReferencedItems = props?.data?.refrenceTo.map((item: string) => ({ @@ -142,6 +145,16 @@ const AdvancePropertise = (props: SchemaProps) => { [field]: (event.target as HTMLInputElement)?.value })); + if(field === 'validationRegex') { + if(event.target.value?.trim()?.length > 0) { + setIsError(true); + setErrorMessage('Adding a regex could impact entry creation.'); + } + else { + setIsError(false); + setErrorMessage(''); + } + } const currentToggleStates = { ...toggleStates, [field]: (event.target as HTMLInputElement)?.value @@ -490,6 +503,7 @@ const AdvancePropertise = (props: SchemaProps) => { handleOnChange('validationRegex', e, true)) } /> + {isError &&

{errorMessage}

} )}