From 9678d9c82941d51b1fd44b49dac71f61559284d2 Mon Sep 17 00:00:00 2001 From: Valentin Serra Date: Wed, 24 Apr 2024 21:09:44 +0200 Subject: [PATCH] sq --- .../entries/CustomValidationEntry.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/form-js-editor/src/features/properties-panel/entries/CustomValidationEntry.js b/packages/form-js-editor/src/features/properties-panel/entries/CustomValidationEntry.js index cf42f817b..0251235e4 100644 --- a/packages/form-js-editor/src/features/properties-panel/entries/CustomValidationEntry.js +++ b/packages/form-js-editor/src/features/properties-panel/entries/CustomValidationEntry.js @@ -3,7 +3,7 @@ import { get, set } from 'min-dash'; import { useService, useVariables } from '../hooks'; import { FeelEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel'; -import { useCallback } from 'preact/hooks'; +import { useCallback, useMemo } from 'preact/hooks'; export function CustomValidationEntry(props) { const { editField, field, idPrefix, index } = props; @@ -36,7 +36,10 @@ function Condition(props) { const debounce = useService('debounce'); const _variables = useVariables(); - const variables = [{ name: 'value', info: '*Current field value*' }, ..._variables]; + const variables = useMemo( + () => [{ name: 'value', type: 'keyword', info: 'Returns the current field value.' }, ..._variables], + [_variables], + ); const setValue = (value, error) => { if (error) { @@ -79,7 +82,10 @@ function Message(props) { const debounce = useService('debounce'); const _variables = useVariables(); - const variables = [{ name: 'value', info: '*Current field value*' }, ..._variables]; + const variables = useMemo( + () => [{ name: 'value', type: 'keyword', info: 'Returns the current field value.' }, ..._variables], + [_variables], + ); const setValue = (value, error) => { if (error) {