@processmaker/screen-builder 2.85.1 → 2.85.2

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.1",
3
+ "version": "2.85.2",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -57,6 +57,13 @@ export default {
57
57
  boundary: 'window',
58
58
  };
59
59
  },
60
+ buttonInfo() {
61
+ return {
62
+ name: this.name,
63
+ label: this.label,
64
+ value: this.fieldValue
65
+ };
66
+ }
60
67
  },
61
68
  methods: {
62
69
  setValue(parent, name, value) {
@@ -83,7 +90,7 @@ export default {
83
90
  }
84
91
  this.$emit('input', this.fieldValue);
85
92
  this.$nextTick(() => {
86
- this.$emit('submit', this.eventData, this.loading);
93
+ this.$emit('submit', this.eventData, this.loading, this.buttonInfo);
87
94
  });
88
95
  return;
89
96
  }
@@ -115,7 +115,7 @@ export default {
115
115
  hasErrors: false,
116
116
  refreshScreen: 0,
117
117
  redirecting: null,
118
- loadingButton: false
118
+ loadingButton: false,
119
119
  };
120
120
  },
121
121
  watch: {
@@ -223,7 +223,7 @@ export default {
223
223
  }
224
224
  this.renderComponent = component;
225
225
  }
226
- },
226
+ }
227
227
  },
228
228
  },
229
229
  computed: {
@@ -289,7 +289,7 @@ export default {
289
289
  }
290
290
  },
291
291
  loadTask() {
292
- const url = `/${this.taskId}?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission`;
292
+ const url = `/${this.taskId}?include=data,user,draft,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission`;
293
293
  // For Vocabularies
294
294
  if (window.ProcessMaker && window.ProcessMaker.packages && window.ProcessMaker.packages.includes('package-vocabularies')) {
295
295
  window.ProcessMaker.VocabulariesSchemaUrl = `vocabularies/task_schema/${this.taskId}`;
@@ -324,6 +324,15 @@ export default {
324
324
  this.resetScreenState();
325
325
  this.requestData = _.get(this.task, 'request_data', {});
326
326
  this.loopContext = _.get(this.task, "loop_context", "");
327
+
328
+ if (this.task.draft) {
329
+ this.requestData = _.merge(
330
+ {},
331
+ this.requestData,
332
+ this.task.draft.data
333
+ );
334
+ }
335
+
327
336
  this.refreshScreen++;
328
337
  }
329
338
 
@@ -433,7 +442,7 @@ export default {
433
442
  }
434
443
  return 'card-header text-capitalize text-white ' + header;
435
444
  },
436
- submit(formData = null, loading = false) {
445
+ submit(formData = null, loading = false, buttonInfo = null) {
437
446
  //single click
438
447
  if (this.disabled) {
439
448
  return;
@@ -449,7 +458,7 @@ export default {
449
458
  } else {
450
459
  this.loadingButton = false;
451
460
  }
452
- this.$emit('submit', this.task, loading);
461
+ this.$emit('submit', this.task, loading, buttonInfo);
453
462
 
454
463
  if (this.task && this.task.allow_interstitial && !this.loadingButton) {
455
464
  this.task.interstitial_screen['_interstitial'] = true;
@@ -246,8 +246,8 @@ export default {
246
246
  node.$children.forEach((child) => this.registerCustomFunctions(child));
247
247
  }
248
248
  },
249
- submit(eventData, loading = false) {
250
- this.$emit("submit", this.data, loading);
249
+ submit(eventData, loading = false, buttonInfo = null) {
250
+ this.$emit("submit", this.data, loading, buttonInfo);
251
251
  },
252
252
  parseCss() {
253
253
  const containerSelector = `.${this.containerClass}`;
@@ -53,8 +53,8 @@ export default {
53
53
  dot2bracket(str) {
54
54
  return str.replace(/\.\d/g, match => `[${match.substr(1)}]`);
55
55
  },
56
- submit(eventData, loading = false) {
57
- this.$emit('submit', this.value, loading);
56
+ submit(eventData, loading = false, buttonInfo = null) {
57
+ this.$emit('submit', this.value, loading, buttonInfo);
58
58
  },
59
59
  buildComponent(definition) {
60
60
  if (window.ProcessMaker && window.ProcessMaker.EventBus) {
@@ -145,7 +145,7 @@ export default {
145
145
  return 'MUSTACHE: ' + e.message;
146
146
  }
147
147
  },
148
- async submitForm(eventData, loading = false) {
148
+ async submitForm(eventData, loading = false, buttonInfo = null) {
149
149
  await this.validateNow(findRootScreen(this));
150
150
  this.hasSubmitted(true);
151
151
  if (!this.valid__ || this.disableSubmit__) {
@@ -155,7 +155,7 @@ export default {
155
155
  // if the form is not valid the data is not emitted
156
156
  return;
157
157
  }
158
- this.$emit('submit', this.vdata, loading);
158
+ this.$emit('submit', this.vdata, loading, buttonInfo);
159
159
  },
160
160
  resetValue(safeDotName, variableName) {
161
161
  this.setValue(safeDotName, null);