Skip to content

Commit

Permalink
feat: support element templates runtime versions
Browse files Browse the repository at this point in the history
  Config for current runtime platform and version can now be passed to elementTemplates. If template has information about supported engines, compatibility will be verified.

  Related to camunda/camunda-modeler#4530

feat: emit <changed> as part of <set>

  This allows us to safely use <set> to reflect internal changes.
  • Loading branch information
nikku authored and jarekdanielak committed Dec 12, 2024
1 parent 446afa9 commit 126ec99
Show file tree
Hide file tree
Showing 20 changed files with 1,521 additions and 99 deletions.
153 changes: 108 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"min-dash": "^4.0.0",
"min-dom": "^4.0.3",
"preact-markup": "^2.1.1",
"semver": "^7.6.3",
"semver-compare": "^1.0.0",
"uuid": "^11.0.0"
},
Expand Down
8 changes: 5 additions & 3 deletions src/cloud-element-templates/ElementTemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { default as DefaultElementTemplates } from '../element-templates/Element
* Registry for element templates.
*/
export default class ElementTemplates extends DefaultElementTemplates {
constructor(templateElementFactory, commandStack, eventBus, modeling, injector) {
super(commandStack, eventBus, modeling, injector);
constructor(templateElementFactory, commandStack, eventBus, modeling, injector, config) {
super(commandStack, eventBus, modeling, injector, config);

this._templateElementFactory = templateElementFactory;
}
Expand Down Expand Up @@ -75,12 +75,14 @@ export default class ElementTemplates extends DefaultElementTemplates {

return context.element;
}

}

ElementTemplates.$inject = [
'templateElementFactory',
'commandStack',
'eventBus',
'modeling',
'injector'
'injector',
'config.elementTemplates',
];
4 changes: 1 addition & 3 deletions src/cloud-element-templates/ElementTemplatesLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ export default class ElementTemplatesLoader extends TemplatesLoader {
elementTemplates.set(validTemplates);

if (errors.length) {
this.templateErrors(errors);
this._templateErrors(errors);
}

this.templatesChanged();
}
}

Expand Down
Loading

0 comments on commit 126ec99

Please sign in to comment.