@processmaker/screen-builder 2.98.4 → 2.99.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/screen-builder",
3
- "version": "2.98.4",
3
+ "version": "2.99.0",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -13,6 +13,7 @@
13
13
  @upload-start="start"
14
14
  @file-removed="removed"
15
15
  @file-success="fileUploaded"
16
+ @file-error="fileError"
16
17
  @file-added="addFile"
17
18
  :class="{'was-validated': required}"
18
19
  >
@@ -503,6 +504,24 @@ export default {
503
504
  e.target.click();
504
505
  }
505
506
  },
507
+ fileError(rootFile, file, messages, chunk)
508
+ {
509
+ let displayMessage = '';
510
+ try {
511
+ const messagesArray = JSON.parse(messages);
512
+ displayMessage = messagesArray.join(', ');
513
+ }
514
+ catch (e) {
515
+ displayMessage = messages;
516
+ }
517
+
518
+ if (displayMessage.length > 0) {
519
+ window.ProcessMaker.alert(`${this.$t('File Upload Error:')} ${displayMessage}`, 'danger');
520
+ }
521
+
522
+ window.onbeforeunload = function() {};
523
+ this.$emit('file-error', messages);
524
+ },
506
525
  fileUploaded(rootFile, file, message) {
507
526
  this.uploading = false;
508
527
  let name = file.name;
@@ -826,9 +826,9 @@ export default {
826
826
  */
827
827
  isSameUser(currentTask, redirectData) {
828
828
  const userIdMatch = currentTask.user?.id === redirectData.params[0].userId;
829
- const typeMatch = currentTask.elementDestination?.type === null
829
+ const typeMatch = currentTask.elementDestination?.type === null
830
830
  || currentTask.elementDestination?.type === 'taskSource';
831
-
831
+
832
832
  return userIdMatch && typeMatch;
833
833
  },
834
834
 
@@ -839,6 +839,17 @@ export default {
839
839
  * @param {Object} data - The event data containing the process update information.
840
840
  */
841
841
  handleProcessUpdated(data) {
842
+ const elementDestinationValue = this.task.elementDestination?.value;
843
+
844
+ if (
845
+ elementDestinationValue &&
846
+ data?.params[0]?.tokenId === this.taskId &&
847
+ data?.params[0]?.requestStatus === 'ACTIVE'
848
+ ) {
849
+ window.location.href = elementDestinationValue;
850
+ return;
851
+ }
852
+
842
853
  if (
843
854
  ['ACTIVITY_ACTIVATED', 'ACTIVITY_COMPLETED'].includes(data.event)
844
855
  && data.elementType === 'task'