@processmaker/screen-builder 3.8.20 → 3.8.22

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