|
1 | 1 | import { get, set } from 'min-dash'; |
2 | 2 |
|
3 | | -import { useService } from '../hooks'; |
| 3 | +import { useService, useVariables } from '../hooks'; |
4 | 4 |
|
5 | 5 | import { FeelEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel'; |
6 | 6 | import { useCallback } from 'preact/hooks'; |
@@ -34,6 +34,9 @@ function Condition(props) { |
34 | 34 | const { editField, field, id, index } = props; |
35 | 35 |
|
36 | 36 | const debounce = useService('debounce'); |
| 37 | + const _variables = useVariables(); |
| 38 | + |
| 39 | + const variables = [{ name: 'value', info: '*Current field value*' }, ..._variables]; |
37 | 40 |
|
38 | 41 | const setValue = (value, error) => { |
39 | 42 | if (error) { |
@@ -66,13 +69,17 @@ function Condition(props) { |
66 | 69 | label: 'Condition', |
67 | 70 | setValue, |
68 | 71 | validate: conditionEntryValidate, |
| 72 | + variables, |
69 | 73 | }); |
70 | 74 | } |
71 | 75 |
|
72 | 76 | function Message(props) { |
73 | 77 | const { editField, field, id, index } = props; |
74 | 78 |
|
75 | 79 | const debounce = useService('debounce'); |
| 80 | + const _variables = useVariables(); |
| 81 | + |
| 82 | + const variables = [{ name: 'value', info: '*Current field value*' }, ..._variables]; |
76 | 83 |
|
77 | 84 | const setValue = (value, error) => { |
78 | 85 | if (error) { |
@@ -105,5 +112,6 @@ function Message(props) { |
105 | 112 | label: 'Message if condition not met', |
106 | 113 | setValue, |
107 | 114 | validate: messageEntryValidate, |
| 115 | + variables, |
108 | 116 | }); |
109 | 117 | } |
0 commit comments