camunda / camunda-modeler

An integrated modeling solution for BPMN, DMN and Forms based on bpmn.io.
https://camunda.com/products/modeler
MIT License
1.49k stars 479 forks source link

Templates with incompatible Schema version still show up in the Catalog Modal #2162

Closed pinussilvestrus closed 3 years ago

pinussilvestrus commented 3 years ago

Describe the Bug

Given the following example templates

[
  {
    "$schema": "https://unpkg.com/browse/@camunda/element-templates-json-schema@0.3.0/resources/schema.json",
    "name": "Simple Template",
    "id": "custom.example.template",
    "appliesTo": [
      "bpmn:ServiceTask"
    ],
    "properties": []
  },
  {
    "$schema": "https://unpkg.com/browse/@camunda/element-templates-json-schema@0.2.0/resources/schema.json",
    "name": "Simple Template2",
    "id": "custom.example.template2",
    "appliesTo": [
      "bpmn:ServiceTask"
    ],
    "properties": []
  }
]

both templates are still shown up in the Catalog Modal, although the first one is marked as incompatible.

image

[diagram_1.bpmn] template(id: <custom.example.template>, name: <Simple Template>): unsupported element template schema version <0.3.0>. Your installation only supports up to version <0.2.0>. Please update your installation
    at e.exports._logError (webpack:///node_modules/bpmn-js-properties-panel/lib/provider/camunda/element-templates/Validator.js:357:12)
    at _logError (webpack:///node_modules/bpmn-js-properties-panel/lib/provider/camunda/element-templates/Validator.js:127:18)
    at _validateTemplate (webpack:///node_modules/bpmn-js-properties-panel/lib/provider/camunda/element-templates/Validator.js:79:19)
    at Array.forEach (<anonymous>)
    at forEach (webpack:///node_modules/bpmn-js-properties-panel/lib/provider/camunda/element-templates/Validator.js:64:16)
    at addAll (webpack:///node_modules/bpmn-js-properties-panel/lib/provider/camunda/element-templates/ElementTemplatesLoader.js:74:34)
    at setTemplates (webpack:///src/app/tabs/bpmn/BpmnEditor.js:205:20)
    at async file:///Applications/Camunda%20Modeler.app/Contents/Resources/app.asar/public/bundle.js:65:113728 [ error ]
This error may be the result of a plug-in compatibility issue. [ info ]
Disable plug-ins (restarts the app) [ info ]

Furthermore, when applying this template, there is a "Missing Template" error showing up.

image

Steps to Reproduce

  1. Create a service task
  2. Open the Catalog Modal
  3. Choose the Template with the incompatible Schema version
  4. See the Missing Template error

Expected Behavior

Element templates with incompatible schema version do not show up in the Catalog Modal

Environment

pinussilvestrus commented 3 years ago

This could be related to https://github.com/camunda/camunda-modeler/issues/2110, which we already fixed on master, but didn't merge to develop yet.

pinussilvestrus commented 3 years ago

I merged master into develop which fixes the problem.