@processmaker/screen-builder 2.85.3 → 2.85.5

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.85.3",
3
+ "version": "2.85.5",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -11,7 +11,8 @@
11
11
  "run-cypress": "TZ=UTC nyc cypress run",
12
12
  "storybook": "storybook dev -p 6006",
13
13
  "build-storybook": "storybook build",
14
- "test-storybook": "test-storybook"
14
+ "test-storybook": "test-storybook",
15
+ "serve": "npm run dev"
15
16
  },
16
17
  "main": "./dist/vue-form-builder.umd.js",
17
18
  "module": "./dist/vue-form-builder.es.js",
@@ -96,7 +96,9 @@ export default {
96
96
  beforeLoadTask: { type: Function, default: defaultBeforeLoadTask },
97
97
  initialLoopContext: { type: String, default: "" },
98
98
  taskPreview: { type: Boolean, default: false },
99
- loading: { type: Number, default: null }
99
+ loading: { type: Number, default: null },
100
+ alwaysAllowEditing: { type: Boolean, default: false },
101
+ disableInterstitial: { type: Boolean, default: false },
100
102
  },
101
103
  data() {
102
104
  return {
@@ -194,7 +196,9 @@ export default {
194
196
  }
195
197
  if (this.taskPreview && this.task.status === "CLOSED") {
196
198
  this.task.interstitial_screen['_interstitial'] = false;
197
- this.task.screen.config = this.disableForm(this.task.screen.config);
199
+ if (!this.alwaysAllowEditing) {
200
+ this.task.screen.config = this.disableForm(this.task.screen.config);
201
+ }
198
202
  this.screen = this.task.screen;
199
203
  }
200
204
  }
@@ -460,7 +464,7 @@ export default {
460
464
  }
461
465
  this.$emit('submit', this.task, loading, buttonInfo);
462
466
 
463
- if (this.task && this.task.allow_interstitial && !this.loadingButton) {
467
+ if (this.task?.allow_interstitial && !this.loadingButton && !this.disableInterstitial) {
464
468
  this.task.interstitial_screen['_interstitial'] = true;
465
469
  this.screen = this.task.interstitial_screen;
466
470
  }
@@ -489,10 +493,7 @@ export default {
489
493
  return allowed ? this.parentRequest : this.requestId
490
494
  },
491
495
  processUpdated: _.debounce(function(data) {
492
- if (
493
- data.event === 'ACTIVITY_COMPLETED' ||
494
- data.event === 'ACTIVITY_ACTIVATED'
495
- ) {
496
+ if (data.event === 'ACTIVITY_ACTIVATED') {
496
497
  this.reload();
497
498
  }
498
499
  if (data.event === 'ACTIVITY_EXCEPTION') {
@@ -524,6 +525,13 @@ export default {
524
525
  this.reload();
525
526
  }
526
527
  },
528
+ existsEventMessage(id, data) {
529
+ if (sessionStorage.getItem(id)) {
530
+ return true;
531
+ }
532
+ sessionStorage.setItem(id, data);
533
+ return false;
534
+ },
527
535
  listenForParentChanges() {
528
536
  if (!this.parentRequest) {
529
537
  return;
@@ -533,10 +541,16 @@ export default {
533
541
  `ProcessMaker.Models.ProcessRequest.${this.parentRequest}`,
534
542
  '.ProcessUpdated',
535
543
  (data) => {
536
- if (['ACTIVITY_ACTIVATED'].includes(data.event)) {
544
+ if (
545
+ ['ACTIVITY_ACTIVATED'].includes(data.event) &&
546
+ !this.existsEventMessage(`${data.event}-${this.userId}-${this.taskId}`)
547
+ ) {
537
548
  this.closeTask(this.parentRequest);
538
549
  }
539
- if (['ACTIVITY_COMPLETED'].includes(data.event)) {
550
+ if (
551
+ ["ACTIVITY_COMPLETED"].includes(data.event) &&
552
+ !this.existsEventMessage(`${data.event}-${this.userId}-${this.taskId}`)
553
+ ) {
540
554
  if (this.task.process_request.status === 'COMPLETED') {
541
555
  this.processCompleted();
542
556
  }
@@ -1391,6 +1391,9 @@ export default {
1391
1391
  margin-right: -400px;
1392
1392
  padding: 16px;
1393
1393
  }
1394
+ .popover-body {
1395
+ max-width: 350px;
1396
+ }
1394
1397
  </style>
1395
1398
 
1396
1399
  <style>
@@ -54,6 +54,9 @@ export default {
54
54
  return str.replace(/\.\d/g, match => `[${match.substr(1)}]`);
55
55
  },
56
56
  submit(eventData, loading = false, buttonInfo = null) {
57
+ if (buttonInfo && this.loopContext) {
58
+ buttonInfo.loopContext = this.loopContext;
59
+ }
57
60
  this.$emit('submit', this.value, loading, buttonInfo);
58
61
  },
59
62
  buildComponent(definition) {