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}

} )}