@processmaker/screen-builder 3.8.27 → 3.8.29

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.27",
3
+ "version": "3.8.29",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -154,7 +154,18 @@ export default {
154
154
  }
155
155
 
156
156
  const screenPromise = new Promise((resolve, reject) => {
157
- this.get(`${endpoint}/${id}${query}`)
157
+ let fullQuery = query || "";
158
+ const authQuery = this.authQueryString();
159
+ if (authQuery && !fullQuery.includes("request_id=")) {
160
+ const authParams = authQuery.startsWith("?") ? authQuery.slice(1) : authQuery;
161
+ if (fullQuery) {
162
+ fullQuery += `${fullQuery.includes("?") ? "&" : "?"}${authParams}`;
163
+ } else {
164
+ fullQuery = `?${authParams}`;
165
+ }
166
+ }
167
+
168
+ this.get(`${endpoint}/${id}${fullQuery}`)
158
169
  .then((response) => {
159
170
  if (response.data.nested) {
160
171
  this.addNestedScreenCache(response.data.nested);
@@ -137,6 +137,9 @@ export default {
137
137
  value: collection.id
138
138
  }))
139
139
  ];
140
+ if (this.collectionId) {
141
+ this.updateScreenIds();
142
+ }
140
143
  });
141
144
  },
142
145
  getFields() {
@@ -354,8 +354,7 @@ export default {
354
354
  this.loopContext = _.get(this.task, "loop_context", "");
355
355
 
356
356
  if (this.task.draft) {
357
- this.requestData = _.merge(
358
- {},
357
+ this.requestData = this.restoreDraftData(
359
358
  this.requestData,
360
359
  this.task.draft.data
361
360
  );
@@ -373,6 +372,13 @@ export default {
373
372
  this.hasErrors = false;
374
373
  }
375
374
  },
375
+ restoreDraftData(requestData, draftData) {
376
+ const shouldMerge =
377
+ globalThis?.ProcessMaker?.screen?.mergeDraftOnRestore ?? true;
378
+ return shouldMerge
379
+ ? _.merge({}, requestData, draftData)
380
+ : { ...requestData, ...draftData };
381
+ },
376
382
  pageUpdate() {
377
383
  this.$emit("updated-page-core");
378
384
  },