Skip to content

Commit

Permalink
fix: display variables in customValidationEntry
Browse files Browse the repository at this point in the history
Related to #1162
  • Loading branch information
Skaiir committed Sep 2, 2024
1 parent 3bdb5cb commit 2b3f0b5
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { get, set } from 'min-dash';

import { useService } from '../hooks';
import { useService, useVariables } from '../hooks';

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

const debounce = useService('debounce');
const _variables = useVariables();

const variables = [{ name: 'value', info: '*Current field value*' }, ..._variables];

const setValue = (value, error) => {
if (error) {
Expand Down Expand Up @@ -66,13 +69,17 @@ function Condition(props) {
label: 'Condition',
setValue,
validate: conditionEntryValidate,
variables,
});
}

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

const debounce = useService('debounce');
const _variables = useVariables();

const variables = [{ name: 'value', info: '*Current field value*' }, ..._variables];

const setValue = (value, error) => {
if (error) {
Expand Down Expand Up @@ -105,5 +112,6 @@ function Message(props) {
label: 'Message if condition not met',
setValue,
validate: messageEntryValidate,
variables,
});
}

0 comments on commit 2b3f0b5

Please sign in to comment.