@processmaker/modeler 1.43.10 → 1.43.12

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/modeler",
3
- "version": "1.43.10",
3
+ "version": "1.43.12",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve --mode development",
6
6
  "test:unit": "vue-cli-service test:unit",
@@ -1771,10 +1771,12 @@ export default {
1771
1771
  */
1772
1772
  unhightligtNodes(clientId) {
1773
1773
  const player = this.players.find(player => player.id === clientId);
1774
-
1774
+
1775
1775
  player?.selectedNodes?.forEach((nodeId) => {
1776
1776
  const element = this.getElementByNodeId(nodeId);
1777
- element.component.setHighlightColor(false, player.color);
1777
+ if (element) {
1778
+ element.component.setHighlightColor(false, player.color);
1779
+ }
1778
1780
  });
1779
1781
  },
1780
1782
  /**
@@ -1788,7 +1790,9 @@ export default {
1788
1790
  this.players = this.players.map((item) => (item.id === data.id ? { ...item, ...data } : item));
1789
1791
  data?.selectedNodes?.forEach((nodeId) => {
1790
1792
  const element = this.getElementByNodeId(nodeId);
1791
- element.component.setHighlightColor(true, data.color);
1793
+ if (element) {
1794
+ element.component.setHighlightColor(true, data.color);
1795
+ }
1792
1796
  });
1793
1797
  }
1794
1798
  },
@@ -1928,6 +1932,7 @@ export default {
1928
1932
  if (response.data) {
1929
1933
  if (response.data?.error) {
1930
1934
  this.assetFail = true;
1935
+ this.loadingAI = false;
1931
1936
  }
1932
1937
  }
1933
1938
  })
@@ -1935,6 +1940,7 @@ export default {
1935
1940
  const errorMsg = error.response?.data?.message || error.message;
1936
1941
  window.ProcessMaker.alert(errorMsg, 'danger');
1937
1942
  this.assetFail = true;
1943
+ this.loadingAI = false;
1938
1944
  });
1939
1945
  },
1940
1946
  highlightTaskArrays(data) {
@@ -1990,6 +1996,7 @@ export default {
1990
1996
  window.ProcessMaker.alert(response.data.message, 'danger');
1991
1997
  // Stop and show error
1992
1998
  this.assetFail = true;
1999
+ this.loadingAI = false;
1993
2000
  } else {
1994
2001
  this.setPromptSessions(response.data.promptSessionId);
1995
2002
  // Successful generation
@@ -2026,6 +2033,7 @@ export default {
2026
2033
  () => {
2027
2034
  // Output error
2028
2035
  this.assetFail = true;
2036
+ this.loadingAI = false;
2029
2037
  },
2030
2038
  );
2031
2039
  },
@@ -7,6 +7,7 @@ import store from '@/store';
7
7
  import { getBoundaryEventData } from '@/components/nodes/boundaryEvent/boundaryEventUtils';
8
8
  import { InspectorUtils } from './inspector.utils';
9
9
  import ColorUtil from '../colorUtil';
10
+ import { debounce } from 'lodash';
10
11
  export default class Multiplayer {
11
12
  clientIO = null;
12
13
  yDoc = null;
@@ -211,7 +212,7 @@ export default class Multiplayer {
211
212
  });
212
213
  window.ProcessMaker.EventBus.$on('multiplayer-updateSelectedNodes', ( data ) => {
213
214
  if (this.modeler.isMultiplayer) {
214
- this.updateSelectedNodes(data);
215
+ this.debouncedUpdateSelectedNodes(data);
215
216
  }
216
217
  });
217
218
  window.ProcessMaker.EventBus.$on('multiplayer-updateMousePosition', ( data ) => {
@@ -258,6 +259,17 @@ export default class Multiplayer {
258
259
  this.modeler.updateClientCursor(client);
259
260
  });
260
261
  }
262
+
263
+ /**
264
+ * Debounces the updatedSelectedNodes function to avoid triggering multiple times
265
+ * the update
266
+ *
267
+ * @param {Object} payload
268
+ */
269
+ debouncedUpdateSelectedNodes = debounce((data) => {
270
+ this.updateSelectedNodes(data);
271
+ }, 400);
272
+
261
273
  /**
262
274
  * Updates the selected nodes by the user
263
275
  * @param {Object} data