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

Add plugins menu and client plugins #1143

Merged
merged 19 commits into from
Feb 1, 2019
Merged

Add plugins menu and client plugins #1143

merged 19 commits into from
Feb 1, 2019

Conversation

philippfromme
Copy link
Contributor

@philippfromme philippfromme commented Jan 25, 2019

Closes #1083

@ghost ghost assigned philippfromme Jan 25, 2019
@ghost ghost added the needs review Review pending label Jan 25, 2019
@philippfromme philippfromme changed the title Add plugins menu and client plugins WIP Add plugins menu and client plugins Jan 25, 2019
Copy link
Member

@nikku nikku left a comment

Choose a reason for hiding this comment

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

A few pointers before we close this one out:

  • ES6 migration -> due to the fact that you migrated a lot of stuff in the app as part of this PR it is super hard to understand what it is about
  • Ensure backwards compatibility: How is this reated to the feature you're implementing? What is it about? I have no idea looking at both your comment + linked commit and the code

Is it possible to split up the actual feature from the ES 6 refactoring and other (possibly unrelated) changes?

@philippfromme philippfromme changed the title WIP Add plugins menu and client plugins Add plugins menu and client plugins Jan 25, 2019
@ghost ghost assigned barmac Jan 25, 2019
@philippfromme
Copy link
Contributor Author

I could seperate the ES6 refactoring, yes.

As for the backwards compatibility, we've renamed/removed a couple of properties from the state that is passed to the backend. Any menu plugins that were built using a property that isn't there anymore would break (e.g. dmnRuleEditing). Actually, I just noticed that while merging my changes with yours some of my changes regarding that got lost. I'll add them.

@nikku
Copy link
Member

nikku commented Jan 28, 2019

Some plug-ins we should test for support:

Utilities we need to support (plug-ins build upon these):

Regarding ensuring compatibility:

  • Make sure we restore it + add test coverage for it in an isolated, single commit
  • Create test plug-in that uses all extension points (and fails hard, if they are not present)

Error Handling:

  • How do we handle the load failure of a plug-in (bundle error, ...)? Premise: Keep app running regardless and give user a notice.

@barmac
Copy link
Collaborator

barmac commented Jan 28, 2019

Reduced Palette does not work, but it seems to fail calling bpmn-js internal stuff.

Camunda Modeler Plugin - UserTask Generated Form Preview and Embedded Form Generator has some css issue, but anyway it works.

Token Simulation for the Camunda Modeler stopped to work. We get the following exception:

EventBus.js?cd8f:376 unhandled error in event listener
EventBus._invokeListener @ EventBus.js?cd8f:376
EventBus._invokeListeners @ EventBus.js?cd8f:348
EventBus.fire @ EventBus.js?cd8f:310
./node_modules/bpmn-js-token-simulation/lib/features/toggle-mode/modeler/ToggleMode.js.ToggleMode.toggleMode @ ToggleMode.js:63
EventBus.js?cd8f:377 Error: A DOM element reference is required
    at new ClassList (index.esm.js:75)
    at classes (index.esm.js:63)
    at HideModelerElements.js:27
    at invokeFunction (EventBus.js?cd8f:509)
    at EventBus._invokeListener (EventBus.js?cd8f:362)
    at EventBus._invokeListeners (EventBus.js?cd8f:348)
    at EventBus.fire (EventBus.js?cd8f:310)
    at ToggleMode../node_modules/bpmn-js-token-simulation/lib/features/toggle-mode/modeler/ToggleMode.js.ToggleMode.toggleMode (ToggleMode.js:63)
EventBus._invokeListener @ EventBus.js?cd8f:377
EventBus._invokeListeners @ EventBus.js?cd8f:348
EventBus.fire @ EventBus.js?cd8f:310
./node_modules/bpmn-js-token-simulation/lib/features/toggle-mode/modeler/ToggleMode.js.ToggleMode.toggleMode @ ToggleMode.js:63
EventBus.js?cd8f:379 Uncaught Error: A DOM element reference is required
    at new ClassList (index.esm.js:75)
    at classes (index.esm.js:63)
    at HideModelerElements.js:27
    at invokeFunction (EventBus.js?cd8f:509)
    at EventBus._invokeListener (EventBus.js?cd8f:362)
    at EventBus._invokeListeners (EventBus.js?cd8f:348)
    at EventBus.fire (EventBus.js?cd8f:310)
    at ToggleMode../node_modules/bpmn-js-token-simulation/lib/features/toggle-mode/modeler/ToggleMode.js.ToggleMode.toggleMode (ToggleMode.js:63)

@barmac
Copy link
Collaborator

barmac commented Jan 28, 2019

Token Simulation for the Camunda Modeler is fixed in v0.9.0.

@barmac
Copy link
Collaborator

barmac commented Jan 29, 2019

I just pushed a rewritten test suite for client side plugins implementation. Previously, we would mock the internal methods what made them uncovered during the tests.

@barmac
Copy link
Collaborator

barmac commented Jan 29, 2019

These two helpers cause problems at the moment:
https://github.com/camunda/camunda-modeler-plugin-helpers/blob/master/index.js#L76
https://github.com/camunda/camunda-modeler-plugin-helpers/blob/master/index.js#L85

They are not included in any of the tested plugins. However, we documented them in the helpers repository. Thus, they are part of the public API and we can expect incompatibility problems if we remove them. I'm going to add window helpers which will use our plugin protocol instead of the real path.

@barmac barmac force-pushed the 1083-plugins branch 2 times, most recently from 8078d85 to e5c086f Compare January 29, 2019 14:31
@nikku
Copy link
Member

nikku commented Jan 30, 2019

Regarding your previous comment we should consider whether the current public API makes sense.

Because of that we could consider it safe to remove it.

@ghost ghost assigned nikku Jan 30, 2019
@barmac
Copy link
Collaborator

barmac commented Jan 30, 2019

Cool. I agree with you. We should remember, though, to remove it also from the example plugin: https://github.com/camunda/camunda-modeler-plugin-example/blob/master/client/module.js#L11

@barmac
Copy link
Collaborator

barmac commented Jan 30, 2019

It appeared that unnamed moddle extensions cause a failure of BpmnEditor during construction. I pushed a fix for this.

@nikku
Copy link
Member

nikku commented Jan 30, 2019

Let's sync tomorrow and wrap up this topic.

@barmac
Copy link
Collaborator

barmac commented Jan 30, 2019

We also might want to handle somehow errors thrown in menu actions. Now it's just the Electron displaying uncaught exception in the main process. I pushed a WIP commit with partial fix to that.

@barmac barmac changed the title Add plugins menu and client plugins WIP Add plugins menu and client plugins Jan 30, 2019
@barmac
Copy link
Collaborator

barmac commented Jan 30, 2019

I created a plugin to test the extension points: https://github.com/barmac/camunda-modeler-test-plugin. Tomorrow we can also add it to dev mode of Camunda Modeler.

@barmac barmac force-pushed the 1083-plugins branch 2 times, most recently from beea666 to 9fdc702 Compare January 31, 2019 14:22
@barmac barmac changed the title WIP Add plugins menu and client plugins Add plugins menu and client plugins Jan 31, 2019
@barmac
Copy link
Collaborator

barmac commented Jan 31, 2019

Just found a bug that we sometimes add error label twice. I'm gonna fix it today.

@barmac
Copy link
Collaborator

barmac commented Jan 31, 2019

image

@nikku I think it's ready to merge.

Window#getModelerDirectory

* removed without replacement

Window#getPluginsDirectory

* deprecated; users should use app-plugins:// prefixed urls
  instead
@barmac
Copy link
Collaborator

barmac commented Feb 1, 2019

I'll fix the Windows path problem.

@barmac barmac force-pushed the 1083-plugins branch 3 times, most recently from e8895e8 to b426e64 Compare February 1, 2019 10:03
Sanitize asset paths to prevent directory traversal.
@barmac barmac merged commit ff57aa7 into master Feb 1, 2019
@delete-merged-branch delete-merged-branch bot deleted the 1083-plugins branch February 1, 2019 11:02
@ghost ghost removed the needs review Review pending label Feb 1, 2019
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.

3 participants