@processmaker/screen-builder 3.8.14 → 3.8.15-patch.c

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": "3.8.14",
3
+ "version": "3.8.15-patch.c",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -690,7 +690,7 @@ export default {
690
690
  return null;
691
691
  }
692
692
  },
693
-
693
+
694
694
  /**
695
695
  * Handles redirection upon process completion, considering destination type and user task validation.
696
696
  * @async
@@ -829,7 +829,20 @@ export default {
829
829
  * @param {Object} data - The event data received from the socket listener.
830
830
  */
831
831
  handleProcessUpdate(data) {
832
- if (data.event === 'ACTIVITY_EXCEPTION') {
832
+ const { event, elementDestination, tokenId } = data;
833
+
834
+ // If the activity is completed and there is an element destination, set the element destination to the task
835
+ if (
836
+ event === "ACTIVITY_COMPLETED" &&
837
+ this.task.id === tokenId &&
838
+ elementDestination
839
+ ) {
840
+ this.task.elementDestination = elementDestination;
841
+ // update allow_interstitial based on the element destination change after the submit
842
+ this.task.allow_interstitial = elementDestination.type === "displayNextAssignedTask";
843
+ }
844
+
845
+ if (event === 'ACTIVITY_EXCEPTION') {
833
846
  this.$emit('error', this.requestId);
834
847
  window.location.href = `/requests/${this.requestId}`;
835
848
  }
@@ -885,7 +898,11 @@ export default {
885
898
  * @param {Object} data - The event data containing the tokenId of the task.
886
899
  */
887
900
  async handleRedirectToTask(data) {
888
- if (data?.params[0]?.tokenId) {
901
+ if (
902
+ (data?.params[0]?.tokenId &&
903
+ this.task.user?.id === data.params[0]?.userId) ||
904
+ this.task.elementDestination?.type === 'taskSource'
905
+ ) {
889
906
  this.loadingTask = true;
890
907
  // Check if interstitial tasks are allowed for this task.
891
908
  if (this.task && !(this.task.allow_interstitial || this.isSameUser(this.task, data))) {