@processmaker/modeler 1.31.0 → 1.33.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.
Files changed (100) hide show
  1. package/README.md +7 -0
  2. package/babel.config.js +1 -2
  3. package/dist/img/inclusive-gateway.0f0afffd.svg +4 -0
  4. package/dist/img/inspector.42e5d40d.svg +5 -0
  5. package/dist/img/issue-close.5d1630e6.svg +3 -0
  6. package/dist/img/issue-item.3187f291.svg +3 -0
  7. package/dist/img/issue-open.707390b4.svg +4 -0
  8. package/dist/img/validate-close.09ace97a.svg +4 -0
  9. package/dist/img/validate-open.b0ecf74e.svg +4 -0
  10. package/dist/modeler.common.js +3354 -2489
  11. package/dist/modeler.common.js.map +1 -1
  12. package/dist/modeler.umd.js +3354 -2489
  13. package/dist/modeler.umd.js.map +1 -1
  14. package/dist/modeler.umd.min.js +4 -4
  15. package/dist/modeler.umd.min.js.map +1 -1
  16. package/package.json +2 -2
  17. package/src/.DS_Store +0 -0
  18. package/src/ModelerApp.vue +0 -9
  19. package/src/NodeIdGenerator.js +16 -1
  20. package/src/assets/inspector.svg +5 -0
  21. package/src/assets/toolpanel/inclusive-gateway.svg +2 -2
  22. package/src/assets/topRail/issue-close.svg +3 -0
  23. package/src/assets/topRail/issue-item.svg +3 -0
  24. package/src/assets/topRail/issue-open.svg +4 -0
  25. package/src/assets/topRail/validate-close.svg +4 -0
  26. package/src/assets/topRail/validate-open.svg +4 -0
  27. package/src/components/controls/controls.vue +2 -11
  28. package/src/components/crown/crownButtons/addLaneAboveButton.vue +3 -1
  29. package/src/components/crown/crownButtons/addLaneBelowButton.vue +3 -1
  30. package/src/components/crown/crownButtons/crownBoundaryEventDropdown.vue +2 -1
  31. package/src/components/crown/crownButtons/genericFlowButton.vue +2 -1
  32. package/src/components/crown/crownButtons/icons/faAlignLeft.js +1 -1
  33. package/src/components/crown/crownMultiselect/crownAlign.vue +3 -0
  34. package/src/components/crown/crownMultiselect/crownMultiselect.vue +4 -2
  35. package/src/components/hotkeys/escKey.js +20 -0
  36. package/src/components/hotkeys/main.js +4 -2
  37. package/src/components/inspectors/InspectorPanel.vue +26 -3
  38. package/src/components/inspectors/inspector.scss +11 -0
  39. package/src/components/inspectors/inspectorButton/InspectorButton.vue +38 -0
  40. package/src/components/inspectors/inspectorButton/inspectorButton.scss +19 -0
  41. package/src/components/inspectors/process.js +1 -1
  42. package/src/components/modeler/Modeler.vue +62 -5
  43. package/src/components/modeler/ModelerReadonly.vue +52 -6
  44. package/src/components/modeler/Selection.vue +9 -1
  45. package/src/components/nodes/association/index.js +1 -1
  46. package/src/components/nodes/baseStartEvent/index.js +1 -1
  47. package/src/components/nodes/boundaryEvent/index.js +1 -1
  48. package/src/components/nodes/dataInputAssociation/index.js +1 -1
  49. package/src/components/nodes/dataObject/index.js +1 -1
  50. package/src/components/nodes/dataOutputAssociation/index.js +1 -1
  51. package/src/components/nodes/dataStore/index.js +1 -1
  52. package/src/components/nodes/endEvent/index.js +1 -1
  53. package/src/components/nodes/eventBasedGateway/index.js +1 -1
  54. package/src/components/nodes/exclusiveGateway/index.js +1 -1
  55. package/src/components/nodes/gateway/index.js +1 -1
  56. package/src/components/nodes/inclusiveGateway/index.js +1 -1
  57. package/src/components/nodes/intermediateEvent/index.js +1 -1
  58. package/src/components/nodes/intermediateMessageEvent/index.js +1 -1
  59. package/src/components/nodes/intermediateTimerEvent/index.js +1 -1
  60. package/src/components/nodes/manualTask/index.js +1 -1
  61. package/src/components/nodes/messageFlow/index.js +1 -1
  62. package/src/components/nodes/parallelGateway/index.js +1 -1
  63. package/src/components/nodes/pool/index.js +1 -1
  64. package/src/components/nodes/pool/pool.vue +10 -4
  65. package/src/components/nodes/poolLane/index.js +1 -1
  66. package/src/components/nodes/scriptTask/index.js +1 -1
  67. package/src/components/nodes/sequenceFlow/index.js +1 -1
  68. package/src/components/nodes/serviceTask/index.js +1 -1
  69. package/src/components/nodes/subProcess/index.js +1 -1
  70. package/src/components/nodes/task/index.js +1 -1
  71. package/src/components/nodes/textAnnotation/index.js +1 -1
  72. package/src/components/railBottom/controls/Controls.vue +15 -75
  73. package/src/components/railBottom/controls/SubmenuPopper/SubmenuPopper.vue +5 -5
  74. package/src/components/rails/explorer-rail/explorer-rail.scss +11 -0
  75. package/src/components/rails/explorer-rail/explorer.vue +12 -3
  76. package/src/components/rails/explorer-rail/filterNodeTypes/filterNodeTypes.vue +15 -3
  77. package/src/components/rails/explorer-rail/nodeTypesLoop/nodeTypesLoop.vue +8 -73
  78. package/src/components/rails/explorer-rail/pmBlocksLoop/pmBlocksLoop.vue +76 -0
  79. package/src/components/shapeStackUtils.js +1 -1
  80. package/src/components/toolbar/ToolBar.vue +62 -55
  81. package/src/components/toolbar/toolbar.scss +55 -15
  82. package/src/components/topRail/TopRail.vue +92 -0
  83. package/src/components/topRail/topRail.scss +6 -0
  84. package/src/components/topRail/validateControl/index.js +3 -0
  85. package/src/components/topRail/validateControl/validateButton/ValidateButton.vue +39 -0
  86. package/src/components/topRail/validateControl/validateButton/validateButton.scss +25 -0
  87. package/src/components/topRail/validateControl/validateIssue/ValidateIssue.vue +60 -0
  88. package/src/components/topRail/validateControl/validateIssue/validateIssue.scss +54 -0
  89. package/src/components/topRail/validateControl/validatePanel/ValidatePanel.vue +54 -0
  90. package/src/components/topRail/validateControl/validatePanel/validatePanel.scss +67 -0
  91. package/src/mixins/clickAndDrop.js +107 -0
  92. package/src/mixins/highlightConfig.js +78 -10
  93. package/src/mixins/linkConfig.js +32 -8
  94. package/src/nodeTypesStore.js +48 -0
  95. package/src/setup/registerPmBlock.js +0 -0
  96. package/vue.config.js +1 -0
  97. package/dist/img/distribute-horizontally-icon.5c513cf4.svg +0 -3
  98. package/dist/img/distribute-vertically-icon.a35fb699.svg +0 -3
  99. package/dist/img/inclusive-gateway.754cb36f.svg +0 -4
  100. package/src/components/controls/rankConstants.js +0 -1
@@ -31,7 +31,6 @@
31
31
  :paper="paper"
32
32
  :node="node"
33
33
  :id="node.id"
34
- :highlighted="highlightedNodes.includes(node)"
35
34
  :border-outline="borderOutline(node.id)"
36
35
  :collaboration="collaboration"
37
36
  :process-node="processNode"
@@ -40,11 +39,15 @@
40
39
  :moddle="moddle"
41
40
  :nodeRegistry="nodeRegistry"
42
41
  :root-elements="definitions.get('rootElements')"
43
- :isRendering="isRendering"
44
42
  :paperManager="paperManager"
45
43
  :auto-validate="autoValidate"
46
- :is-active="node === activeNode"
47
44
  :node-id-generator="nodeIdGenerator"
45
+ :highlighted="highlightedNodes.includes(node)"
46
+ :is-active="node === activeNode"
47
+ :is-rendering="isRendering"
48
+ :is-completed="requestCompletedNodes.includes(node.definition.id)"
49
+ :is-in-progress="requestInProgressNodes.includes(node.definition.id)"
50
+ :is-idle="requestIdleNodes.includes(node.definition.id)"
48
51
  @add-node="addNode"
49
52
  @set-cursor="cursor = $event"
50
53
  @set-pool-target="poolTarget = $event"
@@ -85,6 +88,7 @@ import controls from '../controls/controls';
85
88
  import pull from 'lodash/pull';
86
89
  import remove from 'lodash/remove';
87
90
  import store from '@/store';
91
+ import nodeTypesStore from '@/nodeTypesStore';
88
92
  import undoRedoStore from '@/undoRedoStore';
89
93
  import { Linter } from 'bpmnlint';
90
94
  import linterConfig from '../../../.bpmnlintrc';
@@ -132,6 +136,18 @@ export default {
132
136
  type: Boolean,
133
137
  default: true,
134
138
  },
139
+ requestIdleNodes: {
140
+ type: Array,
141
+ default: () => [],
142
+ },
143
+ requestCompletedNodes: {
144
+ type: Array,
145
+ default: () => [],
146
+ },
147
+ requestInProgressNodes: {
148
+ type: Array,
149
+ default: () => [],
150
+ },
135
151
  },
136
152
  data() {
137
153
  return {
@@ -173,6 +189,7 @@ export default {
173
189
  isRendering: false,
174
190
  allWarnings: [],
175
191
  nodeTypes: [],
192
+ pmBlockNodes: [],
176
193
  activeNode: null,
177
194
  xmlManager: null,
178
195
  previouslyStackedShape: null,
@@ -215,7 +232,6 @@ export default {
215
232
  canvasScale(canvasScale) {
216
233
  this.paperManager.scale = canvasScale;
217
234
  },
218
-
219
235
  },
220
236
  computed: {
221
237
  showControls() {
@@ -398,6 +414,29 @@ export default {
398
414
  this.parsers[bpmnType].default.push(defaultParser);
399
415
  });
400
416
  },
417
+ registerPmBlock(pmBlockNode, customParser) {
418
+ const defaultParser = () => pmBlockNode.id;
419
+
420
+ this.translateConfig(pmBlockNode.inspectorConfig[0]);
421
+ addLoopCharacteristics(pmBlockNode);
422
+ this.nodeRegistry[pmBlockNode.id] = pmBlockNode;
423
+
424
+ Vue.component(pmBlockNode.id, pmBlockNode.component);
425
+ this.pmBlockNodes.push(pmBlockNode);
426
+
427
+ const types = Array.isArray(pmBlockNode.bpmnType)
428
+ ? pmBlockNode.bpmnType
429
+ : [pmBlockNode.bpmnType];
430
+
431
+ types.forEach(bpmnType => {
432
+ if (customParser) {
433
+ this.parsers[bpmnType].custom.push(customParser);
434
+ return;
435
+ }
436
+ this.parsers[bpmnType].default.push(defaultParser);
437
+ });
438
+ nodeTypesStore.commit('setPmBlockNodeTypes', this.pmBlockNodes);
439
+ },
401
440
  addMessageFlows() {
402
441
  if (this.collaboration) {
403
442
  this.collaboration
@@ -836,6 +875,7 @@ export default {
836
875
  registerBpmnExtension: this.registerBpmnExtension,
837
876
  registerNode: this.registerNode,
838
877
  registerStatusBar: this.registerStatusBar,
878
+ registerPmBlock: this.registerPmBlock,
839
879
  });
840
880
 
841
881
  this.moddle = new BpmnModdle(this.extensions);
@@ -926,10 +966,16 @@ export default {
926
966
  return;
927
967
  }
928
968
 
929
- // ignore click event if the user is Grabbing the paper
930
- if (this.isGrabbing) return;
969
+ // ignore click event if the user is grabbing the paper.
970
+ if (this.isGrabbing) {
971
+ return;
972
+ }
931
973
 
932
974
  shape.component.$emit('click', event);
975
+ this.$emit('click', {
976
+ event,
977
+ node: this.highlightedNode.definition,
978
+ });
933
979
  });
934
980
 
935
981
  this.paperManager.addEventHandler('cell:pointerdown', ({ model: shape }, event) => {
@@ -16,6 +16,7 @@
16
16
  :plane-elements="$parent.planeElements"
17
17
  :is-rendering="$parent.isRendering"
18
18
  :dropdown-data="[]"
19
+ @save-state="$emit('save-state')"
19
20
  :has-pools="hasPoolsOrLanesSelected"
20
21
  v-on="$listeners"
21
22
  />
@@ -771,7 +772,7 @@ export default {
771
772
  /**
772
773
  * Stop dragging elements that are in a pool
773
774
  */
774
- overPoolStopDrag(){
775
+ async overPoolStopDrag(){
775
776
  if (this.isNotPoolChilds(this.selected)) {
776
777
  this.updateFlowsWaypoint();
777
778
  this.$emit('save-state');
@@ -788,6 +789,7 @@ export default {
788
789
  if (this.newPool){
789
790
  /* Remove the shape from its current pool */
790
791
  this.moveElements(this.selected, this.oldPool, this.newPool);
792
+ this.moveConectedLinks(this.conectedLinks, this.oldPool, this.newPool);
791
793
  this.newPool = null;
792
794
  this.oldPool = null;
793
795
  this.updateLaneChildren(this.selected);
@@ -920,12 +922,18 @@ export default {
920
922
  const shapesToMove= [
921
923
  'PoolLane',
922
924
  'standard.Link',
925
+ 'processmaker.components.nodes.boundaryEvent.Shape',
923
926
  ];
924
927
  selected.filter(shape => !shapesToMove.includes(shape.model.get('type')))
925
928
  .forEach(shape => {
926
929
  oldPool.model.component.moveElement(shape.model, newPool.model);
927
930
  });
928
931
  },
932
+ moveConectedLinks(links, oldPool, newPool){
933
+ links.forEach(link => {
934
+ oldPool.model.component.moveFlow(link.model, newPool.model);
935
+ });
936
+ },
929
937
  },
930
938
  };
931
939
  </script>
@@ -26,7 +26,7 @@ export default {
26
26
  container: true,
27
27
  config: {
28
28
  initiallyOpen: true,
29
- label: 'Configuration',
29
+ label: 'Properties',
30
30
  icon: 'cog',
31
31
  name: 'inspector-accordion-association',
32
32
  },
@@ -33,7 +33,7 @@ export default {
33
33
  container: true,
34
34
  config: {
35
35
  initiallyOpen: true,
36
- label: 'Configuration',
36
+ label: 'Properties',
37
37
  icon: 'cog',
38
38
  name: 'inspector-accordion-start-event',
39
39
  },
@@ -34,7 +34,7 @@ export default {
34
34
  container: true,
35
35
  config: {
36
36
  initiallyOpen: true,
37
- label: 'Configuration',
37
+ label: 'Properties',
38
38
  icon: 'cog',
39
39
  name: 'inspector-accordion-boundary-event',
40
40
  },
@@ -15,7 +15,7 @@ export default {
15
15
  container: true,
16
16
  config: {
17
17
  initiallyOpen: true,
18
- label: 'Configuration',
18
+ label: 'Properties',
19
19
  icon: 'cog',
20
20
  name: 'inspector-accordion-data-input-association',
21
21
  },
@@ -40,7 +40,7 @@ export default {
40
40
  container: true,
41
41
  config: {
42
42
  initiallyOpen: true,
43
- label: 'Configuration',
43
+ label: 'Properties',
44
44
  icon: 'cog',
45
45
  name: 'inspector-accordion-data-object',
46
46
  },
@@ -15,7 +15,7 @@ export default {
15
15
  container: true,
16
16
  config: {
17
17
  initiallyOpen: true,
18
- label: 'Configuration',
18
+ label: 'Properties',
19
19
  icon: 'cog',
20
20
  name: 'inspector-accordion-data-output-association',
21
21
  },
@@ -40,7 +40,7 @@ export default {
40
40
  container: true,
41
41
  config: {
42
42
  initiallyOpen: true,
43
- label: 'Configuration',
43
+ label: 'Properties',
44
44
  icon: 'cog',
45
45
  name: 'inspector-accordion-data-store',
46
46
  },
@@ -76,7 +76,7 @@ export default {
76
76
  container: true,
77
77
  config: {
78
78
  initiallyOpen: true,
79
- label: 'Configuration',
79
+ label: 'Properties',
80
80
  icon: 'cog',
81
81
  name: 'inspector-accordion-end-event',
82
82
  },
@@ -34,7 +34,7 @@ export default {
34
34
  container: true,
35
35
  config: {
36
36
  initiallyOpen: true,
37
- label: 'Configuration',
37
+ label: 'Properties',
38
38
  icon: 'cog',
39
39
  name: 'inspector-accordion-event-based-gateway',
40
40
  },
@@ -67,7 +67,7 @@ export default {
67
67
  container: true,
68
68
  config: {
69
69
  initiallyOpen: true,
70
- label: 'Configuration',
70
+ label: 'Properties',
71
71
  icon: 'cog',
72
72
  name: 'inspector-accordion-exlcusive-gateway',
73
73
  },
@@ -32,7 +32,7 @@ export default {
32
32
  container: true,
33
33
  config: {
34
34
  initiallyOpen: true,
35
- label: 'Configuration',
35
+ label: 'Properties',
36
36
  icon: 'cog',
37
37
  name: 'inspector-accordion-gateway',
38
38
  },
@@ -37,7 +37,7 @@ export default {
37
37
  container: true,
38
38
  config: {
39
39
  initiallyOpen: true,
40
- label: 'Configuration',
40
+ label: 'Properties',
41
41
  icon: 'cog',
42
42
  name: 'inspector-accordion-inclusive-gateway-config',
43
43
  },
@@ -34,7 +34,7 @@ export default {
34
34
  container: true,
35
35
  config: {
36
36
  initiallyOpen: true,
37
- label: 'Configuration',
37
+ label: 'Properties',
38
38
  icon: 'cog',
39
39
  name: 'inspector-accordion-intermediate-gateway-config',
40
40
  },
@@ -37,7 +37,7 @@ export default {
37
37
  container: true,
38
38
  config: {
39
39
  initiallyOpen: true,
40
- label: 'Configuration',
40
+ label: 'Properties',
41
41
  icon: 'cog',
42
42
  name: 'inspector-accordion-intermediate-message-event',
43
43
  },
@@ -135,7 +135,7 @@ export default {
135
135
  container: true,
136
136
  config: {
137
137
  initiallyOpen: true,
138
- label: 'Configuration',
138
+ label: 'Properties',
139
139
  icon: 'cog',
140
140
  name: 'inspector-accordion-intermediate-timer-config',
141
141
  },
@@ -41,7 +41,7 @@ export default {
41
41
  container: true,
42
42
  config: {
43
43
  initiallyOpen: true,
44
- label: 'Configuration',
44
+ label: 'Properties',
45
45
  icon: 'cog',
46
46
  name: 'inspector-accordion-manual-task',
47
47
  },
@@ -26,7 +26,7 @@ export default {
26
26
  container: true,
27
27
  config: {
28
28
  initiallyOpen: true,
29
- label: 'Configuration',
29
+ label: 'Properties',
30
30
  icon: 'cog',
31
31
  name: 'inspector-accordion-message-flow',
32
32
  },
@@ -34,7 +34,7 @@ export default {
34
34
  container: true,
35
35
  config: {
36
36
  initiallyOpen: true,
37
- label: 'Configuration',
37
+ label: 'Properties',
38
38
  icon: 'cog',
39
39
  name: 'inspector-accordion-parallel-gateway-config',
40
40
  },
@@ -36,7 +36,7 @@ export default {
36
36
  container: true,
37
37
  config: {
38
38
  initiallyOpen: true,
39
- label: 'Configuration',
39
+ label: 'Properties',
40
40
  icon: 'cog',
41
41
  name: 'inspector-accordion-pool',
42
42
  },
@@ -121,12 +121,18 @@ export default {
121
121
  moveEmbeddedElements(currentElement, toPool) {
122
122
  this.getElementsUnderArea(currentElement, this.graph)
123
123
  .filter(element => element.isEmbeddedIn(currentElement))
124
- .map(element => element.component.node.definition)
125
- .forEach((elementDefinition) => {
126
- pull(this.containingProcess.get('flowElements'), elementDefinition);
127
- toPool.component.containingProcess.get('flowElements').push(elementDefinition);
124
+ .forEach((child) => {
125
+ child.component.node.pool = toPool;
126
+ pull(this.containingProcess.get('flowElements'), child.component.node.definition);
127
+ toPool.component.containingProcess.get('flowElements').push(child.component.node.definition);
128
128
  });
129
129
  },
130
+ moveFlow(element, toPool){
131
+ const elementDefinition = element.component.node.definition;
132
+ /* Remove references to the element from the current process */
133
+ pull(this.containingProcess.get('flowElements'), elementDefinition);
134
+ toPool.component.containingProcess.get('flowElements').push(elementDefinition);
135
+ },
130
136
  moveElement(element, toPool) {
131
137
  const elementDefinition = element.component.node.definition;
132
138
 
@@ -33,7 +33,7 @@ export default {
33
33
  container: true,
34
34
  config: {
35
35
  initiallyOpen: true,
36
- label: 'Configuration',
36
+ label: 'Properties',
37
37
  icon: 'cog',
38
38
  name: 'inspector-accordion-pool-lane',
39
39
  },
@@ -40,7 +40,7 @@ export default {
40
40
  container: true,
41
41
  config: {
42
42
  initiallyOpen: true,
43
- label: 'Configuration',
43
+ label: 'Properties',
44
44
  icon: 'cog',
45
45
  name: 'inspector-accordion-script-task',
46
46
  },
@@ -66,7 +66,7 @@ export default {
66
66
  container: true,
67
67
  config: {
68
68
  initiallyOpen: true,
69
- label: 'Configuration',
69
+ label: 'Properties',
70
70
  icon: 'cog',
71
71
  name: 'inspector-accordion-sequence-flow',
72
72
  },
@@ -23,7 +23,7 @@ export default {
23
23
  container: true,
24
24
  config: {
25
25
  initiallyOpen: true,
26
- label: 'Configuration',
26
+ label: 'Properties',
27
27
  icon: 'cog',
28
28
  name: 'inspector-accordion-service-task',
29
29
  },
@@ -59,7 +59,7 @@ export default {
59
59
  container: true,
60
60
  config: {
61
61
  initiallyOpen: true,
62
- label: 'Configuration',
62
+ label: 'Properties',
63
63
  icon: 'cog',
64
64
  name: 'inspector-accordion-subprocess',
65
65
  },
@@ -87,7 +87,7 @@ export default {
87
87
  container: true,
88
88
  config: {
89
89
  initiallyOpen: true,
90
- label: 'Configuration',
90
+ label: 'Properties',
91
91
  icon: 'cog',
92
92
  name: 'inspector-accordion-task',
93
93
  },
@@ -51,7 +51,7 @@ export default {
51
51
  container: true,
52
52
  config: {
53
53
  initiallyOpen: true,
54
- label: 'Configuration',
54
+ label: 'Properties',
55
55
  icon: 'cog',
56
56
  name: 'inspector-accordion-text-annotation',
57
57
  },
@@ -5,10 +5,11 @@
5
5
  >
6
6
  <li
7
7
  v-for="item in controls"
8
- :class="['control-item', {'active': selectedItem === item.type}]"
8
+ :class="['control-item', {'active': selectedItem && (selectedItem.type === item.type)}]"
9
9
  :id="item.id"
10
10
  :key="item.id"
11
11
  @click.stop="onClickHandler($event, item)"
12
+ :data-test="`${item.type}-main`"
12
13
  >
13
14
  <SubmenuPopper
14
15
  :data="item"
@@ -35,6 +36,7 @@
35
36
  import InlineSvg from 'vue-inline-svg';
36
37
  import nodeTypesStore from '@/nodeTypesStore';
37
38
  import SubmenuPopper from './SubmenuPopper/SubmenuPopper.vue';
39
+ import clickAndDrop from '@/mixins/clickAndDrop';
38
40
 
39
41
  export default ({
40
42
  components: {
@@ -44,29 +46,15 @@ export default ({
44
46
  props: {
45
47
  nodeTypes: Array,
46
48
  },
49
+ mixins: [clickAndDrop],
47
50
  data() {
48
51
  return {
49
52
  plusIcon: require('@/assets/railBottom/plus.svg'),
50
- wasClicked: false,
51
- element: null,
52
- selectedItem: null,
53
- selectedSubmenuItem: null,
54
- xOffset: 0,
55
- yOffset: 0,
56
- movedElement: null,
57
- isDragging: false,
58
- helperStyles: {
59
- backgroundColor:'#ffffff',
60
- position: 'absolute',
61
- height: '40px',
62
- width: '40px',
63
- zIndex: '10',
64
- opacity: '0.5',
65
- pointerEvents: 'none',
66
- },
67
- popperType: null,
68
53
  };
69
54
  },
55
+ created() {
56
+ nodeTypesStore.dispatch('getUserPinnedObjects');
57
+ },
70
58
  computed: {
71
59
  controls() {
72
60
  return nodeTypesStore.getters.getPinnedNodeTypes;
@@ -79,68 +67,20 @@ export default ({
79
67
  clickToSubmenuHandler(data){
80
68
  window.ProcessMaker.EventBus.$off('custom-pointerclick');
81
69
  this.wasClicked = false;
82
- this.parent = this.element;
70
+ this.parent = this.selectedItem;
83
71
  this.selectedSubmenuItem = data.control.type;
84
72
  this.onClickHandler(data.event, data.control);
85
73
  },
86
- onClickHandler(event, control) {
87
- this.createDraggingHelper(event, control);
88
- document.addEventListener('mousemove', this.setDraggingPosition);
89
- this.setDraggingPosition(event);
90
- this.wasClicked = true;
91
- this.element = control;
92
- this.$emit('onSetCursor', 'crosshair');
93
- if (!this.parent) {
94
- this.selectedItem = control.type;
95
- this.popperType = control.type;
96
- }
97
- window.ProcessMaker.EventBus.$on('custom-pointerclick', message => {
98
- window.ProcessMaker.EventBus.$off('custom-pointerclick');
99
- document.removeEventListener('mousemove', this.setDraggingPosition);
100
- if (this.movedElement) {
101
- document.body.removeChild(this.movedElement);
102
- }
103
- this.popperType = null;
104
- this.selectedSubmenuItem = null;
105
- this.selectedItem = null;
106
- this.movedElement = null;
107
- this.onCreateElement(message);
108
- });
109
- },
110
- onCreateElement(event){
111
- if (this.wasClicked && this.element) {
112
- if (this.parent) {
113
- this.parent = null;
114
- }
115
- this.$emit('onCreateElement', { event, control: this.element });
116
- this.$emit('onSetCursor', 'none');
117
- event.preventDefault();
118
- this.wasClicked = false;
119
- }
120
- },
121
- setDraggingPosition({ pageX, pageY }) {
122
- this.movedElement.style.left = `${pageX}px`;
123
- this.movedElement.style.top = `${pageY}px`;
124
- },
125
74
  toggleExplorer() {
75
+ // Remove control click & drop selection when the Add button is clicked
76
+ this.deselect();
77
+ this.popperType = null;
78
+ this.selectedSubmenuItem = null;
79
+
80
+ // Toggle left explorer
126
81
  nodeTypesStore.commit('toggleExplorer');
127
82
  nodeTypesStore.commit('clearFilteredNodes');
128
- },
129
- createDraggingHelper(event, control) {
130
- if (this.movedElement) {
131
- document.removeEventListener('mousemove', this.setDraggingPosition);
132
- document.body.removeChild(this.movedElement);
133
- this.movedElement = null;
134
- }
135
- const sourceElement = event.target;
136
- this.movedElement = document.createElement('img');
137
- Object.keys(this.helperStyles).forEach((property) => {
138
- this.movedElement.style[property] = this.helperStyles[property];
139
- });
140
- this.movedElement.src = control.icon;
141
- document.body.appendChild(this.movedElement);
142
- this.xOffset = event.clientX - sourceElement.getBoundingClientRect().left;
143
- this.yOffset = event.clientY - sourceElement.getBoundingClientRect().top;
83
+ nodeTypesStore.commit('clearFilteredPmBlockNodes');
144
84
  },
145
85
  },
146
86
  });
@@ -15,6 +15,7 @@
15
15
  :class="['control-submenu-list', {'active': selectedItem === item.type}]"
16
16
  :key="key"
17
17
  @click="onClickHandler($event, item)"
18
+ :data-test="item.type"
18
19
  >
19
20
  <inline-svg :src="item.icon" :alt=item.label />
20
21
  <div class="control-submenu-list-label">
@@ -84,10 +85,10 @@ export default ({
84
85
  flex-direction: column;
85
86
  align-items: flex-start;
86
87
  padding: 10px;
87
- width: 255px;
88
+ width: max-content;
88
89
  left: 616px;
89
90
  background: #FFFFFF;
90
- box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.1);
91
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
91
92
  border-radius: 4px;
92
93
  list-style: none;
93
94
  &-item {
@@ -105,12 +106,12 @@ export default ({
105
106
  align-items: center;
106
107
  padding: 12px 5px;
107
108
  gap: 8px;
108
- width: 235px;
109
109
  height: 40px;
110
110
  flex: none;
111
111
  order: 0;
112
112
  align-self: stretch;
113
113
  flex-grow: 0;
114
+ border-radius: 4px;
114
115
 
115
116
  &.active {
116
117
  background-color: #DEEBFF;
@@ -128,7 +129,6 @@ export default ({
128
129
  height: 24px;
129
130
  }
130
131
  &-label{
131
- font-family: 'Open Sans';
132
132
  font-style: normal;
133
133
  font-weight: 400;
134
134
  font-size: 14px;
@@ -166,7 +166,7 @@ export default ({
166
166
  color: $primary-white;
167
167
  position: absolute;
168
168
  z-index: 10;
169
- box-shadow: 5px 5px 8px 0px #0000004a;
169
+ box-shadow: 5px 5px 8px 0 #0000004a;
170
170
  padding: 0.5rem;
171
171
  pointer-events: none;
172
172
  width: 40px;
@@ -53,3 +53,14 @@ $secondary-color-nav: #6c757d;
53
53
  }
54
54
  }
55
55
 
56
+ .pm-blocks {
57
+ &__container {
58
+ padding: 0.5rem 1rem;
59
+ p {
60
+ font-size: 13px;
61
+ line-height: 19px;
62
+ color: #000;
63
+ }
64
+ }
65
+ }
66
+