diff --git a/packages/element-templates-json-schema-shared/src/defs/condition.json b/packages/element-templates-json-schema-shared/src/defs/condition.json index 855aeea..1974187 100644 --- a/packages/element-templates-json-schema-shared/src/defs/condition.json +++ b/packages/element-templates-json-schema-shared/src/defs/condition.json @@ -80,14 +80,19 @@ "required": [ "allMatch" ], - "allMatch": { - "contains": { - "properties": { - "property": { - "const": { - "$data": "2/id" + "properties": { + "allMatch": { + "contains": { + "properties": { + "property": { + "const": { + "$data": "4/id" + } } - } + }, + "required": [ + "property" + ] } } } diff --git a/packages/zeebe-element-templates-json-schema/test/fixtures/condition-allMatch-one-condition.js b/packages/zeebe-element-templates-json-schema/test/fixtures/condition-allMatch-one-condition.js index 7baf7e8..5f03b31 100644 --- a/packages/zeebe-element-templates-json-schema/test/fixtures/condition-allMatch-one-condition.js +++ b/packages/zeebe-element-templates-json-schema/test/fixtures/condition-allMatch-one-condition.js @@ -24,6 +24,7 @@ export const template = { } }, { + 'id': 'foobar', 'label': 'equals (string)', 'type': 'String', 'condition': { @@ -39,7 +40,7 @@ export const template = { 'type': 'property', 'name': 'input2' } - }, + } ] }; diff --git a/packages/zeebe-element-templates-json-schema/test/fixtures/condition-on-itself-dropdown-choices.js b/packages/zeebe-element-templates-json-schema/test/fixtures/condition-on-itself-dropdown-choices.js index dc326bd..d398fe3 100644 --- a/packages/zeebe-element-templates-json-schema/test/fixtures/condition-on-itself-dropdown-choices.js +++ b/packages/zeebe-element-templates-json-schema/test/fixtures/condition-on-itself-dropdown-choices.js @@ -31,6 +31,65 @@ export const template = { 'type': 'zeebe:property', 'name': 'method' } + }, + { + 'id': 'valid', + 'label': 'Dropdown', + 'type': 'Dropdown', + 'choices': [ + { + 'value': 'opt1', + 'name':'opt1' + }, + { + 'value': 'opt2', + 'name': 'opt2' + }, + { + 'value': 'opt3', + 'name': 'opt3', + 'condition': { + 'property': 'myId', + 'equals': 'text' + } + } + ], + 'binding': { + 'type': 'zeebe:property', + 'name': 'method' + } + }, + { + 'id': 'validAllMatch', + 'label': 'Dropdown', + 'type': 'Dropdown', + 'choices': [ + { + 'value': 'opt1', + 'name':'opt1' + }, + { + 'value': 'opt2', + 'name': 'opt2' + }, + { + 'value': 'opt3', + 'name': 'opt3', + 'condition': { + 'allMatch': [ + { + 'property': 'myId', + 'equals': 'text' + } + ] + + } + } + ], + 'binding': { + 'type': 'zeebe:property', + 'name': 'method' + } } ] };