@processmaker/modeler 1.24.3 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -143,6 +143,7 @@ export default {
143
143
  resetToInitialPosition() {
144
144
  this.shape.position(this.validPosition.x, this.validPosition.y);
145
145
  store.commit('allowSavingElementPosition');
146
+ this.$emit('shape-resize');
146
147
  },
147
148
  moveBoundaryEventIfOverTask() {
148
149
  const task = this.getTaskUnderShape();
@@ -154,11 +155,13 @@ export default {
154
155
 
155
156
  this.attachBoundaryEventToTask(task);
156
157
  this.updateShapePosition(task);
158
+ this.$emit('shape-resize');
157
159
  },
158
160
  resetInvalidTarget() {
159
161
  if (this.invalidTargetElement) {
160
162
  resetShapeColor(this.invalidTargetElement);
161
163
  this.invalidTargetElement = null;
164
+ this.$emit('shape-resize');
162
165
  }
163
166
  },
164
167
  attachToValidTarget(cellView) {
@@ -25,6 +25,7 @@ export default class PoolEventHandlers {
25
25
 
26
26
  onPointerDown(cellView) {
27
27
  if (this.isNotPoolChild(cellView.model)) {
28
+ this.component.$emit('select-pool');
28
29
  return;
29
30
  }
30
31
 
@@ -21,6 +21,8 @@ export default class PaperManager {
21
21
  sorting: 'sorting-approximate',
22
22
  gridSize: PaperManager.gridSize,
23
23
  drawGrid: true,
24
+ snapLinks: false, // disable snapping of links
25
+ snapElements: false, // disable snapping of elements
24
26
  clickThreshold: 10,
25
27
  perpendicularLinks: true,
26
28
  interactive: interactiveFunc,
@@ -34,7 +34,7 @@
34
34
  <div class="btn-group btn-group-sm mr-2" role="group" aria-label="Zoom controls">
35
35
  <b-button
36
36
  class="btn btn-sm btn-secondary"
37
- @click="scale += scaleStep"
37
+ @click="paperManager.scale = paperManager.scale.sx + scaleStep"
38
38
  data-test="zoom-in"
39
39
  v-b-tooltip.hover
40
40
  :title="$t('Zoom In')"
@@ -43,7 +43,7 @@
43
43
  </b-button>
44
44
  <b-button
45
45
  class="btn btn-sm btn-secondary"
46
- @click="scale = Math.max(minimumScale, scale -= scaleStep)"
46
+ @click="paperManager.scale = Math.max(minimumScale, paperManager.scale.sx -= scaleStep)"
47
47
  data-test="zoom-out"
48
48
  v-b-tooltip.hover
49
49
  :title="$t('Zoom Out')"
@@ -51,16 +51,17 @@
51
51
  <font-awesome-icon :icon="minusIcon" />
52
52
  </b-button>
53
53
  <b-button
54
+ v-if="paperManager"
54
55
  class="btn btn-sm btn-secondary"
55
- @click="scale = initialScale"
56
- :disabled="scale === initialScale"
56
+ @click="paperManager.scale = initialScale"
57
+ :disabled="paperManager.scale.sx === initialScale"
57
58
  data-test="zoom-reset"
58
59
  v-b-tooltip.hover
59
60
  :title="$t('Reset to initial scale')"
60
61
  >
61
62
  {{ $t('Reset') }}
62
63
  </b-button>
63
- <span class="btn btn-sm btn-secondary scale-value">{{ Math.round(scale*100) }}%</span>
64
+ <span v-if="paperManager" class="btn btn-sm btn-secondary scale-value">{{ Math.round(paperManager.scale.sx*100) }}%</span>
64
65
  </div>
65
66
 
66
67
  <div class="btn-group btn-group-sm mr-2" role="group" aria-label="Additional controls">
@@ -121,12 +122,6 @@ export default {
121
122
  panelsCompressed: Boolean,
122
123
  },
123
124
  watch: {
124
- scale(scale) {
125
- this.paperManager.scale = scale;
126
- if (scale === this.initialScale) {
127
- this.$root.$emit('bv::hide::tooltip');
128
- }
129
- },
130
125
  miniMapOpen(isOpen) {
131
126
  this.$emit('toggle-mini-map-open', isOpen);
132
127
  },
@@ -168,6 +163,7 @@ export default {
168
163
  },
169
164
  methods: {
170
165
  undo() {
166
+ this.$emit('clearSelection');
171
167
  if (this.isRendering) {
172
168
  return;
173
169
  }
@@ -177,6 +173,7 @@ export default {
177
173
  .then(() => window.ProcessMaker.EventBus.$emit('modeler-change'));
178
174
  },
179
175
  redo() {
176
+ this.$emit('clearSelection');
180
177
  if (this.isRendering) {
181
178
  return;
182
179
  }
@@ -1,7 +1,7 @@
1
1
  $toolbar-background-color: #FFF;
2
2
 
3
3
  .toolbar {
4
- z-index: 1;
4
+ z-index: 2;
5
5
  height: $toolbar-height;
6
6
  cursor: auto;
7
7
  width: 100%;
@@ -21,6 +21,7 @@ const defaultHighlighter = {
21
21
  attrs: {
22
22
  stroke: '#5096db',
23
23
  'stroke-width': 3,
24
+ 'data-cy': 'selected',
24
25
  },
25
26
  },
26
27
  },
@@ -96,6 +97,7 @@ export default {
96
97
  this.setShapeHighlight();
97
98
  this.shape.on('change:size', () => {
98
99
  this.paperManager.awaitScheduledUpdates().then(this.setShapeHighlight);
100
+ this.$emit('shape-resize', this.shape);
99
101
  });
100
102
  });
101
103
  });
@@ -302,6 +302,9 @@ export default {
302
302
  }
303
303
 
304
304
  this.updateRouter();
305
+ this.shape.on('change:vertices', function() {
306
+ this.component.$emit('shape-resize');
307
+ });
305
308
  },
306
309
  beforeDestroy() {
307
310
  document.removeEventListener('mouseup', this.emitSave);
package/src/store.js CHANGED
@@ -94,7 +94,18 @@ export default new Vuex.Store({
94
94
  state.highlightedNodes = node ? [node] : [];
95
95
  },
96
96
  addToHighlightedNodes(state, nodes) {
97
- state.highlightedNodes = uniq([...state.highlightedNodes, ...nodes]);
97
+ const highlightedNodes = uniq([...state.highlightedNodes, ...nodes]);
98
+ const selectedPoolsIds = highlightedNodes
99
+ .filter(node => node.type === 'processmaker-modeler-pool')
100
+ .map(node => node.id);
101
+ state.highlightedNodes = highlightedNodes
102
+ // remove from selection the selected child nodes in the pool
103
+ .filter(node => {
104
+ if (node.pool && node.pool.component.node.id) {
105
+ return !selectedPoolsIds.includes(node.pool.component.node.id);
106
+ }
107
+ return true;
108
+ });
98
109
  },
99
110
  addNode(state, node) {
100
111
  /* Add an unchanging ID that Vue can use to track the component