Skip to content

Commit b825a0b

Browse files
committed
fix: display variables in customValidationEntry
Related to #1162
1 parent 04c7332 commit b825a0b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/form-js-editor/src/features/properties-panel/entries/CustomValidationEntry.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { get, set } from 'min-dash';
22

3-
import { useService } from '../hooks';
3+
import { useService, useVariables } from '../hooks';
44

55
import { FeelEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel';
66
import { useCallback } from 'preact/hooks';
@@ -34,6 +34,9 @@ function Condition(props) {
3434
const { editField, field, id, index } = props;
3535

3636
const debounce = useService('debounce');
37+
const _variables = useVariables();
38+
39+
const variables = [{ name: 'value', info: '*Current field value*' }, ..._variables];
3740

3841
const setValue = (value, error) => {
3942
if (error) {
@@ -66,13 +69,17 @@ function Condition(props) {
6669
label: 'Condition',
6770
setValue,
6871
validate: conditionEntryValidate,
72+
variables,
6973
});
7074
}
7175

7276
function Message(props) {
7377
const { editField, field, id, index } = props;
7478

7579
const debounce = useService('debounce');
80+
const _variables = useVariables();
81+
82+
const variables = [{ name: 'value', info: '*Current field value*' }, ..._variables];
7683

7784
const setValue = (value, error) => {
7885
if (error) {
@@ -105,5 +112,6 @@ function Message(props) {
105112
label: 'Message if condition not met',
106113
setValue,
107114
validate: messageEntryValidate,
115+
variables,
108116
});
109117
}

0 commit comments

Comments
 (0)