@@ -291,8 +347,8 @@ export class CmmnEditor extends CachedComponent {
onContextMenu={ this.handleContextMenu }
>
-
-
Properties Panel
+
@@ -300,11 +356,18 @@ export class CmmnEditor extends CachedComponent {
);
}
- static createCachedState() {
+ static createCachedState(props) {
+
+ const {
+ layout
+ } = props;
// TODO(nikku): wire element template loading
const modeler = new CamundaCmmnModeler({
- position: 'absolute'
+ position: 'absolute',
+ minimap: {
+ open: layout.minimap.open
+ }
});
return {
diff --git a/client/src/app/tabs/cmmn/CmmnEditor.less b/client/src/app/tabs/cmmn/CmmnEditor.less
index cf62e9214e..6b12432a43 100644
--- a/client/src/app/tabs/cmmn/CmmnEditor.less
+++ b/client/src/app/tabs/cmmn/CmmnEditor.less
@@ -19,6 +19,10 @@
border-left: solid 1px #CCC;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
+ &:not(.open) .properties-container {
+ width: 0px;
+ }
+
.toggle {
position: absolute;
left: -30px;
diff --git a/client/src/app/tabs/dmn/DmnEditor.js b/client/src/app/tabs/dmn/DmnEditor.js
index b0d1fcb7a3..8ab279fab9 100644
--- a/client/src/app/tabs/dmn/DmnEditor.js
+++ b/client/src/app/tabs/dmn/DmnEditor.js
@@ -27,18 +27,26 @@ import css from './DmnEditor.less';
import generateImage from '../../util/generateImage';
+import { merge } from 'min-dash';
+
+import classNames from 'classnames';
+
class DmnEditor extends CachedComponent {
constructor(props) {
super(props);
- this.state = {};
+ const {
+ layout
+ } = this.props;
+
+ this.state = {
+ layout
+ };
this.ref = React.createRef();
this.propertiesPanelRef = React.createRef();
-
- // TODO(nikku): detach editor properties panel
}
componentDidMount() {
@@ -112,6 +120,8 @@ class DmnEditor extends CachedComponent {
modeler[fn]('view.contentChanged', this.viewContentChanged);
modeler[fn]('error', this.handleError);
+
+ modeler[fn]('minimap.toggle', this.handleMinimapToggle);
}
checkDirty = () => {
@@ -298,6 +308,44 @@ class DmnEditor extends CachedComponent {
this.props.onError(error);
}
+ handleMinimapToggle = (event) => {
+ this.handleLayoutChange({
+ minimap: {
+ open: event.open
+ }
+ });
+ }
+
+ handlePropertiesPanelToggle = () => {
+ const {
+ layout
+ } = this.state;
+
+ this.handleLayoutChange({
+ propertiesPanel: {
+ open: !layout.propertiesPanel.open
+ }
+ });
+ }
+
+ handleLayoutChange(newLayout) {
+ const {
+ onLayoutChanged
+ } = this.props;
+
+ const {
+ layout
+ } = this.state;
+
+ newLayout = merge(layout, newLayout);
+
+ this.setState({
+ layout: newLayout
+ });
+
+ onLayoutChanged(newLayout);
+ }
+
checkImport = () => {
const {
modeler
@@ -412,6 +460,12 @@ class DmnEditor extends CachedComponent {
}
render() {
+ const {
+ layout
+ } = this.state;
+
+ const propertiesPanelOpen = layout.propertiesPanel && layout.propertiesPanel.open;
+
return (
@@ -429,8 +483,8 @@ class DmnEditor extends CachedComponent {
-
-
Properties Panel
+
@@ -438,9 +492,16 @@ class DmnEditor extends CachedComponent {
);
}
- static createCachedState() {
+ static createCachedState(props) {
+ const {
+ layout
+ } = props;
- const modeler = new CamundaDmnModeler();
+ const modeler = new CamundaDmnModeler({
+ minimap: {
+ open: layout.minimap.open
+ }
+ });
return {
modeler,
diff --git a/client/src/app/tabs/dmn/DmnEditor.less b/client/src/app/tabs/dmn/DmnEditor.less
index 46730b2051..63f38a994f 100644
--- a/client/src/app/tabs/dmn/DmnEditor.less
+++ b/client/src/app/tabs/dmn/DmnEditor.less
@@ -32,6 +32,10 @@
border-left: solid 1px #CCC;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
+ &:not(.open) .properties-container {
+ width: 0px;
+ }
+
.toggle {
position: absolute;
left: -30px;