-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support conditions in dropdown choices
Related to camunda/camunda-modeler#3682
- Loading branch information
Showing
4 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...s/zeebe-element-templates-json-schema/test/fixtures/condition-dropdown-choices-invalid.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
export const template = { | ||
'name': 'Condition', | ||
'id': 'example.com.condition', | ||
'appliesTo': [ | ||
'bpmn:ServiceTask' | ||
], | ||
'properties': [ | ||
{ | ||
'id': 'myId', | ||
'label': 'input 1', | ||
'type': 'String', | ||
'binding': { | ||
'type': 'property', | ||
'name': 'input1' | ||
} | ||
}, | ||
{ | ||
'label': 'Dropdown', | ||
'type': 'Dropdown', | ||
'choices': [ | ||
{ | ||
'value': 'opt1', | ||
'name':'opt1' | ||
}, | ||
{ | ||
'value': 'opt2', | ||
'name': 'opt2' | ||
}, | ||
{ | ||
'value': 'opt3', | ||
'name': 'opt3', | ||
'condition': 'myId == 2' | ||
} | ||
], | ||
'binding': { | ||
'type': 'zeebe:property', | ||
'name': 'method' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export const errors = [ | ||
{ | ||
keyword: 'type', | ||
dataPath: '/properties/1/choices/2/condition', | ||
schemaPath: '#/type', | ||
params: { type: 'object' }, | ||
message: 'should be object' | ||
}, | ||
{ | ||
keyword: 'type', | ||
dataPath: '', | ||
schemaPath: '#/oneOf/1/type', | ||
params: { type: 'array' }, | ||
message: 'should be array' | ||
}, | ||
{ | ||
keyword: 'oneOf', | ||
dataPath: '', | ||
schemaPath: '#/oneOf', | ||
params: { passingSchemas: null }, | ||
message: 'should match exactly one schema in oneOf' | ||
} | ||
]; |
46 changes: 46 additions & 0 deletions
46
packages/zeebe-element-templates-json-schema/test/fixtures/condition-dropdown-choices.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
export const template = { | ||
'name': 'Condition', | ||
'id': 'example.com.condition', | ||
'appliesTo': [ | ||
'bpmn:ServiceTask' | ||
], | ||
'properties': [ | ||
{ | ||
'id': 'myId', | ||
'label': 'input 1', | ||
'type': 'String', | ||
'binding': { | ||
'type': 'property', | ||
'name': 'input1' | ||
} | ||
}, | ||
{ | ||
'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' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export const errors = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters