Skip to content

Commit

Permalink
feat(client/dmn-editor): attach properties panel
Browse files Browse the repository at this point in the history
Related to #902
Related to #866
  • Loading branch information
philippfromme authored and barmac committed Jan 17, 2019
1 parent 21bcc3b commit 6f890c2
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions client/src/app/tabs/dmn/DmnEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,31 @@ class DmnEditor extends CachedComponent {

this.listen('on');

// update properties panel parent in all configs
[ 'drd', 'decisionTable', 'literalExpression' ].forEach(viewer => {

modeler._options[ viewer ].propertiesPanel = {
parent: this.propertiesPanelRef.current
};

// viewers only exist if cached modeler
if (modeler._viewers[ viewer ]) {
const config = modeler._viewers[ viewer ].get('config');

config.propertiesPanel = {
parent: this.propertiesPanelRef.current
};
}

});

// if cached modeler event must be fired manually
if (modeler.getActiveViewer()) {
modeler.getActiveViewer().get('eventBus').fire('attach');
}

modeler.attachTo(this.ref.current);

// TODO(nikku): dynamically attach editor properties panel
this.checkImport();
}

Expand All @@ -59,7 +81,6 @@ class DmnEditor extends CachedComponent {

this.listen('off');

// TODO(nikku): detach editor properties panel
modeler.detach();
}

Expand Down

0 comments on commit 6f890c2

Please sign in to comment.