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 9b0cb00..45bdc4a 100644 --- a/packages/element-templates-json-schema-shared/src/defs/condition.json +++ b/packages/element-templates-json-schema-shared/src/defs/condition.json @@ -56,7 +56,18 @@ "required": [ "oneOf" ] - } + }, + { + "properties": { + "isVisible": { + "type": "boolean" + + } + }, + "required": [ + "isVisible" + ] + }, ] } }, diff --git a/packages/element-templates-json-schema/test/fixtures/condition-default-type.js b/packages/element-templates-json-schema/test/fixtures/condition-default-type.js index ffb2e4d..e4db210 100644 --- a/packages/element-templates-json-schema/test/fixtures/condition-default-type.js +++ b/packages/element-templates-json-schema/test/fixtures/condition-default-type.js @@ -43,6 +43,15 @@ export const errors = [ params: { missingProperty: 'oneOf' }, message: "should have required property 'oneOf'" }, + { + dataPath: '/properties/1/condition', + keyword: 'required', + message: "should have required property 'isVisible'", + params: { + missingProperty: 'isVisible' + }, + schemaPath: '#/definitions/properties/allOf/0/items/properties/condition/definitions/condition/oneOf/2/required' + }, { keyword: 'oneOf', dataPath: '/properties/1/condition', diff --git a/packages/element-templates-json-schema/test/fixtures/condition-missing-condition-keyword.js b/packages/element-templates-json-schema/test/fixtures/condition-missing-condition-keyword.js index 3f56450..42cc4b0 100644 --- a/packages/element-templates-json-schema/test/fixtures/condition-missing-condition-keyword.js +++ b/packages/element-templates-json-schema/test/fixtures/condition-missing-condition-keyword.js @@ -44,6 +44,15 @@ export const errors = [ params: { missingProperty: 'oneOf' }, message: "should have required property 'oneOf'" }, + { + dataPath: '/properties/1/condition', + keyword: 'required', + message: "should have required property 'isVisible'", + params: { + missingProperty: 'isVisible' + }, + schemaPath: '#/definitions/properties/allOf/0/items/properties/condition/definitions/condition/oneOf/2/required' + }, { keyword: 'oneOf', dataPath: '/properties/1/condition', diff --git a/packages/element-templates-json-schema/test/fixtures/condition-wrong-types.js b/packages/element-templates-json-schema/test/fixtures/condition-wrong-types.js index b50e337..6210781 100644 --- a/packages/element-templates-json-schema/test/fixtures/condition-wrong-types.js +++ b/packages/element-templates-json-schema/test/fixtures/condition-wrong-types.js @@ -58,6 +58,15 @@ export const errors = [ params: { missingProperty: 'oneOf' }, message: "should have required property 'oneOf'" }, + { + dataPath: '/properties/1/condition', + keyword: 'required', + message: "should have required property 'isVisible'", + params: { + missingProperty: 'isVisible' + }, + schemaPath: '#/definitions/properties/allOf/0/items/properties/condition/definitions/condition/oneOf/2/required' + }, { keyword: 'oneOf', dataPath: '/properties/1/condition', @@ -100,6 +109,15 @@ export const errors = [ params: { type: [ 'string', 'number' ] }, message: 'should be string,number' }, + { + dataPath: '/properties/2/condition', + keyword: 'required', + message: "should have required property 'isVisible'", + params: { + missingProperty: 'isVisible' + }, + schemaPath: '#/definitions/properties/allOf/0/items/properties/condition/definitions/condition/oneOf/2/required' + }, { keyword: 'oneOf', dataPath: '/properties/2/condition', diff --git a/packages/element-templates-json-schema/test/fixtures/condition.js b/packages/element-templates-json-schema/test/fixtures/condition.js index 00f135c..d99b9d4 100644 --- a/packages/element-templates-json-schema/test/fixtures/condition.js +++ b/packages/element-templates-json-schema/test/fixtures/condition.js @@ -90,6 +90,18 @@ export const template = { 'type': 'property', 'name': 'input4' } + }, + { + 'label': 'isVisible', + 'type': 'String', + 'condition': { + property: 'myId', + isVisible: true + }, + 'binding': { + 'type': 'property', + 'name': 'input4' + } } ] }; diff --git a/packages/zeebe-element-templates-json-schema/test/fixtures/condition-default-type.js b/packages/zeebe-element-templates-json-schema/test/fixtures/condition-default-type.js index 381bd9e..4681a11 100644 --- a/packages/zeebe-element-templates-json-schema/test/fixtures/condition-default-type.js +++ b/packages/zeebe-element-templates-json-schema/test/fixtures/condition-default-type.js @@ -43,6 +43,15 @@ export const errors = [ params: { missingProperty: 'oneOf' }, message: "should have required property 'oneOf'" }, + { + dataPath: '/properties/1/condition', + keyword: 'required', + message: "should have required property 'isVisible'", + params: { + missingProperty: 'isVisible' + }, + schemaPath: '#/definitions/properties/allOf/0/items/properties/condition/definitions/condition/oneOf/2/required' + }, { keyword: 'oneOf', dataPath: '/properties/1/condition', diff --git a/packages/zeebe-element-templates-json-schema/test/fixtures/condition-empty-allMatch.js b/packages/zeebe-element-templates-json-schema/test/fixtures/condition-empty-allMatch.js index 40e2e5e..d1df60e 100644 --- a/packages/zeebe-element-templates-json-schema/test/fixtures/condition-empty-allMatch.js +++ b/packages/zeebe-element-templates-json-schema/test/fixtures/condition-empty-allMatch.js @@ -57,6 +57,15 @@ export const errors = [ }, 'schemaPath': '#/definitions/properties/allOf/0/items/properties/condition/definitions/condition/oneOf/1/required' }, + { + 'dataPath': '/properties/2/condition', + 'keyword': 'required', + 'message': "should have required property 'isVisible'", + 'params': { + 'missingProperty': 'isVisible' + }, + 'schemaPath': '#/definitions/properties/allOf/0/items/properties/condition/definitions/condition/oneOf/2/required' + }, { 'dataPath': '/properties/2/condition', 'keyword': 'oneOf', diff --git a/packages/zeebe-element-templates-json-schema/test/fixtures/condition-missing-condition-keyword.js b/packages/zeebe-element-templates-json-schema/test/fixtures/condition-missing-condition-keyword.js index 991df7b..f061cb8 100644 --- a/packages/zeebe-element-templates-json-schema/test/fixtures/condition-missing-condition-keyword.js +++ b/packages/zeebe-element-templates-json-schema/test/fixtures/condition-missing-condition-keyword.js @@ -44,6 +44,15 @@ export const errors = [ params: { missingProperty: 'oneOf' }, message: "should have required property 'oneOf'" }, + { + dataPath: '/properties/1/condition', + keyword: 'required', + message: "should have required property 'isVisible'", + params: { + missingProperty: 'isVisible' + }, + schemaPath: '#/definitions/properties/allOf/0/items/properties/condition/definitions/condition/oneOf/2/required' + }, { keyword: 'oneOf', dataPath: '/properties/1/condition', diff --git a/packages/zeebe-element-templates-json-schema/test/fixtures/condition-wrong-types.js b/packages/zeebe-element-templates-json-schema/test/fixtures/condition-wrong-types.js index fa336c6..43453f7 100644 --- a/packages/zeebe-element-templates-json-schema/test/fixtures/condition-wrong-types.js +++ b/packages/zeebe-element-templates-json-schema/test/fixtures/condition-wrong-types.js @@ -58,6 +58,15 @@ export const errors = [ params: { missingProperty: 'oneOf' }, message: "should have required property 'oneOf'" }, + { + dataPath: '/properties/1/condition', + keyword: 'required', + message: "should have required property 'isVisible'", + params: { + missingProperty: 'isVisible' + }, + schemaPath: '#/definitions/properties/allOf/0/items/properties/condition/definitions/condition/oneOf/2/required' + }, { keyword: 'oneOf', dataPath: '/properties/1/condition', @@ -100,6 +109,15 @@ export const errors = [ params: { type: [ 'string', 'number' ] }, message: 'should be string,number' }, + { + dataPath: '/properties/2/condition', + keyword: 'required', + message: "should have required property 'isVisible'", + params: { + missingProperty: 'isVisible' + }, + schemaPath: '#/definitions/properties/allOf/0/items/properties/condition/definitions/condition/oneOf/2/required' + }, { keyword: 'oneOf', dataPath: '/properties/2/condition', diff --git a/packages/zeebe-element-templates-json-schema/test/fixtures/condition.js b/packages/zeebe-element-templates-json-schema/test/fixtures/condition.js index 00f135c..d99b9d4 100644 --- a/packages/zeebe-element-templates-json-schema/test/fixtures/condition.js +++ b/packages/zeebe-element-templates-json-schema/test/fixtures/condition.js @@ -90,6 +90,18 @@ export const template = { 'type': 'property', 'name': 'input4' } + }, + { + 'label': 'isVisible', + 'type': 'String', + 'condition': { + property: 'myId', + isVisible: true + }, + 'binding': { + 'type': 'property', + 'name': 'input4' + } } ] };