Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element Templates Feature Is Aware of Versions #400

Merged
merged 3 commits into from
Dec 15, 2020

Conversation

philippfromme
Copy link
Contributor

@philippfromme philippfromme commented Nov 27, 2020

  • element templates are considered unique based on ID plus version (two element templates can have same ID but different version making them unique)
  • validation is aware of versions
  • show version instead of date in element template description
  • element template select is aware of versions
  • versions are applied when applying an element template (camunda:modelerTemplateVersion)
  • simplify element template select (can only be visible if no element template applied)

Note: This PR is not about handling the case of applying a new version of an element template. See #399.

Which issue does this PR address?

Related to camunda/camunda-modeler#1969
Closes #398

Acceptance Criteria

  • Corresponds to the concept
  • Corresponds to the design

Definition of Done

@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Nov 27, 2020
@philippfromme philippfromme force-pushed the 1969-element-template-version branch 2 times, most recently from 0d6dfb5 to 72ee48c Compare November 27, 2020 08:55
@philippfromme philippfromme changed the title 1969 element template version Element Templates Feature Is Aware of Versions Dec 1, 2020
@philippfromme philippfromme force-pushed the 1969-element-template-version branch 2 times, most recently from 22856d4 to b1dfee9 Compare December 2, 2020 08:11
@philippfromme philippfromme marked this pull request as ready for review December 2, 2020 08:28
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Dec 2, 2020
@philippfromme philippfromme requested review from nikku and barmac December 2, 2020 08:28
@philippfromme philippfromme force-pushed the 1969-element-template-version branch from b1dfee9 to 6d7d885 Compare December 2, 2020 10:05
@barmac
Copy link
Member

barmac commented Dec 11, 2020

image

It blows up when the dropdown is opened and I click on the canvas.

@barmac
Copy link
Member

barmac commented Dec 11, 2020

I wasn't able to reproduce it on 4.4.0.

Recording + log:

recording

Error log ``` [/Users/maciej/workspace/bpmn-io/zeebe-modeler/resources/diagram/simple.bpmn] Failed to execute 'querySelector' on 'Element': '[data-entry="">-collapsible"]' is not a valid selector. at query (webpack-internal:///../../bpmn-js-properties-panel/node_modules/min-dom/dist/index.esm.js:513:13) at eval (webpack-internal:///../../bpmn-js-properties-panel/lib/PropertiesPanel.js:933:25) at arrayEach (webpack-internal:///../../bpmn-js-properties-panel/node_modules/lodash/_arrayEach.js:15:9) at forEach (webpack-internal:///../../bpmn-js-properties-panel/node_modules/lodash/forEach.js:38:10) at eval (webpack-internal:///../../bpmn-js-properties-panel/lib/PropertiesPanel.js:932:7) at arrayEach (webpack-internal:///../../bpmn-js-properties-panel/node_modules/lodash/_arrayEach.js:15:9) at forEach (webpack-internal:///../../bpmn-js-properties-panel/node_modules/lodash/forEach.js:38:10) at eval (webpack-internal:///../../bpmn-js-properties-panel/lib/PropertiesPanel.js:929:5) at arrayEach (webpack-internal:///../../bpmn-js-properties-panel/node_modules/lodash/_arrayEach.js:15:9) at forEach (webpack-internal:///../../bpmn-js-properties-panel/node_modules/lodash/forEach.js:38:10) [ error ] This error may be the result of a plug-in compatibility issue. [ info ] Disable plug-ins (restarts the app) [ info ] [/Users/maciej/workspace/bpmn-io/zeebe-modeler/resources/diagram/simple.bpmn] Failed to execute 'querySelector' on 'Element': '[data-entry="">-collapsible"]' is not a valid selector. at query (webpack-internal:///../../bpmn-js-properties-panel/node_modules/min-dom/dist/index.esm.js:513:13) at eval (webpack-internal:///../../bpmn-js-properties-panel/lib/PropertiesPanel.js:933:25) at arrayEach (webpack-internal:///../../bpmn-js-properties-panel/node_modules/lodash/_arrayEach.js:15:9) at forEach (webpack-internal:///../../bpmn-js-properties-panel/node_modules/lodash/forEach.js:38:10) at eval (webpack-internal:///../../bpmn-js-properties-panel/lib/PropertiesPanel.js:932:7) at arrayEach (webpack-internal:///../../bpmn-js-properties-panel/node_modules/lodash/_arrayEach.js:15:9) at forEach (webpack-internal:///../../bpmn-js-properties-panel/node_modules/lodash/forEach.js:38:10) at eval (webpack-internal:///../../bpmn-js-properties-panel/lib/PropertiesPanel.js:929:5) at arrayEach (webpack-internal:///../../bpmn-js-properties-panel/node_modules/lodash/_arrayEach.js:15:9) at forEach (webpack-internal:///../../bpmn-js-properties-panel/node_modules/lodash/forEach.js:38:10) [ error ] This error may be the result of a plug-in compatibility issue. [ info ] Disable plug-ins (restarts the app) [ info ] ```

@philippfromme
Copy link
Contributor Author

philippfromme commented Dec 13, 2020

@barmac This is an issue unrelated to this PR. The XSS template breaks a CSS selector when updating the properties panel. I was able to reproduce this using Camunda Modeler v4.4.0. I guess this has been broken for a long time because we don't escape IDs that are used for CSS selectors.

I've created an issue for this: camunda/camunda-modeler#2031

image

@philippfromme philippfromme force-pushed the 1969-element-template-version branch from 6d7d885 to 7518916 Compare December 13, 2020 21:05
@barmac
Copy link
Member

barmac commented Dec 14, 2020

Thank you Philipp. Now I know why I wasn't able to reproduce that with 4.4.0. I used another template but not XSS task. Sorry for unnecessary alert.

philippfromme and others added 3 commits December 15, 2020 14:25
* element templates are considered unique based on ID plus version (two element templates can have same ID but different version making them unique)
* validation is aware of versions
* show version instead of date in element template description
* element template select is aware of versions
* versions are applied when applying an element template (`camunda:modelerTemplateVersion`)
* simplify element template select (can only be visible if no element template applied)

BREAKING CHANGES

* element template select not visible when element template applied
This ensures that feature does not break when version is set to 0.
@barmac barmac force-pushed the 1969-element-template-version branch from bc83eba to 0a94507 Compare December 15, 2020 16:23
Copy link
Member

@barmac barmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added 0a94507 and rebased on master. Let's merge that.

@fake-join fake-join bot merged commit 2220853 into master Dec 15, 2020
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Dec 15, 2020
@fake-join fake-join bot deleted the 1969-element-template-version branch December 15, 2020 16:41
@philippfromme
Copy link
Contributor Author

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Element Templates Feature Is Aware of Versions
2 participants