@processmaker/screen-builder 2.91.0 → 2.92.0

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.91.0",
3
+ "version": "2.92.0",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -56,7 +56,7 @@
56
56
  "@fortawesome/fontawesome-free": "^5.6.1",
57
57
  "@originjs/vite-plugin-commonjs": "^1.0.3",
58
58
  "@panter/vue-i18next": "^0.15.2",
59
- "@processmaker/vue-form-elements": "0.57.0",
59
+ "@processmaker/vue-form-elements": "0.58.0",
60
60
  "@processmaker/vue-multiselect": "2.3.0",
61
61
  "@storybook/addon-essentials": "^7.6.13",
62
62
  "@storybook/addon-interactions": "^7.6.13",
@@ -115,7 +115,7 @@
115
115
  },
116
116
  "peerDependencies": {
117
117
  "@panter/vue-i18next": "^0.15.0",
118
- "@processmaker/vue-form-elements": "0.57.0",
118
+ "@processmaker/vue-form-elements": "0.58.0",
119
119
  "i18next": "^15.0.8",
120
120
  "vue": "^2.6.12",
121
121
  "vuex": "^3.1.1"
@@ -193,7 +193,7 @@ export default {
193
193
  * @param {object} params
194
194
  * @returns {object}
195
195
  */
196
- getDataSource(dataSourceId, params) {
196
+ getDataSource(dataSourceId, params, nonce = null) {
197
197
  // keep backwards compatibility
198
198
  if (
199
199
  !window.ProcessMaker.screen.cacheEnabled &&
@@ -210,7 +210,7 @@ export default {
210
210
  pmds_data: JSON.stringify(params.data)
211
211
  }
212
212
  }).then((response) => {
213
- return response;
213
+ return [response, nonce];
214
214
  });
215
215
  },
216
216
 
@@ -266,7 +266,7 @@ export default {
266
266
  },
267
267
 
268
268
  getCollectionRecords(collectionId, options, nonce = null) {
269
- options.useCache = window.ProcessMaker.screen.cacheEnabled;
269
+ options.useCache = window.ProcessMaker?.screen?.cacheEnabled;
270
270
 
271
271
  return this.get(
272
272
  `/collections/${collectionId}/records${this.authQueryString()}`,
@@ -408,7 +408,7 @@ export default {
408
408
  deleteProperty(item) {
409
409
  globalObject.ProcessMaker.confirmModal(
410
410
  this.$t('Are you sure you want to delete the calc ?'),
411
- this.$t('If you do, you wont be able to recover the calc configuration.'),
411
+ this.$t('If you do, you won’t be able to recover the Calc configuration.'),
412
412
  '',
413
413
  () => {
414
414
  this.remove(item);
@@ -227,7 +227,7 @@
227
227
 
228
228
  <div v-if="dataSource === dataSourceValues.dataConnector">
229
229
  <pmql-input
230
- :search-type="'collections'"
230
+ :search-type="'collections_w_mustaches'"
231
231
  class="mb-1"
232
232
  :input-label="'PMQL'"
233
233
  v-model="pmqlQuery"
@@ -315,8 +315,12 @@ export default {
315
315
 
316
316
  .list-table {
317
317
  height: 300px;
318
- overflow: auto;
318
+ overflow: hidden;
319
319
  background-color: #f9f9f9;
320
+ padding: 0 13.5px 0 0;
321
+ }
322
+ .list-table:hover {
323
+ overflow: auto;
320
324
  padding: 0;
321
325
  }
322
326
 
@@ -1,15 +1,13 @@
1
1
  <template>
2
2
  <div v-if="showTable">
3
3
  <filter-table
4
+ table-name="form-cases"
4
5
  :headers="tableHeaders"
5
6
  :data="tableData"
6
7
  :unread="unreadColumnName"
7
8
  :loading="shouldShowLoader"
8
9
  >
9
- <template
10
- v-for="(row, rowIndex) in data.data"
11
- v-slot:[`row-${rowIndex}`]
12
- >
10
+ <template v-for="(row, rowIndex) in data.data" #[`row-${rowIndex}`]>
13
11
  <td
14
12
  v-for="(header, colIndex) in tableHeaders"
15
13
  :key="`${rowIndex}-${colIndex}`"
@@ -172,6 +170,7 @@ export default {
172
170
  };
173
171
  const tasksDropdown = [];
174
172
  this.$emit("requestsCount", { dataControls, tasksDropdown });
173
+ this.$refs["form-case"].resetToOriginalWidths();
175
174
  })
176
175
  .catch(() => {
177
176
  this.tableData = [];
@@ -249,24 +248,17 @@ export default {
249
248
  this.fetch();
250
249
  },
251
250
  setupColumns() {
252
- const columns = this.getColumns();
253
- this.tableHeaders = this.getColumns();
251
+ const columnsCases = this.getColumnsCases();
252
+ this.tableHeaders = this.getColumnsCases();
254
253
 
255
- columns.forEach((column) => {
254
+ columnsCases.forEach((column) => {
256
255
  const field = {
257
- title: () => this.$t(column.label),
256
+ title: () => this.$t(column.label)
258
257
  };
259
258
 
260
259
  switch (column.field) {
261
- case "id":
262
- field.name = "__slot:ids";
263
- field.title = "#";
264
- break;
265
- case "participants":
266
- field.name = "__slot:participants";
267
- break;
268
- case "name":
269
- field.name = "__slot:name";
260
+ case "case_number":
261
+ field.name = "__slot:case_number";
270
262
  break;
271
263
  case "case_title":
272
264
  field.name = "__slot:case_title";
@@ -293,13 +285,8 @@ export default {
293
285
 
294
286
  this.fields.push(field);
295
287
  });
296
-
297
- this.fields.push({
298
- name: "__slot:actions",
299
- title: ""
300
- });
301
288
  },
302
- getColumns() {
289
+ getColumnsCases() {
303
290
  return [
304
291
  {
305
292
  label: "Case #",
@@ -325,7 +312,7 @@ export default {
325
312
  sortable: true,
326
313
  default: true,
327
314
  width: 113,
328
- fixed_width: 314,
315
+ fixed_width: 113,
329
316
  resizable: false,
330
317
  filter_subject: { type: "Status" }
331
318
  },
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <div v-if="showTable">
3
3
  <filter-table
4
+ table-name="form-tasks"
4
5
  :headers="tableHeaders"
5
6
  :data="tableData"
6
7
  :unread="unreadColumnName"
@@ -270,6 +271,7 @@ export default {
270
271
  dropdownShow: "tasks"
271
272
  };
272
273
  this.$emit("tasksCount", { dataControls, tasksDropdown });
274
+ this.$refs["form-task"].resetToOriginalWidths();
273
275
  })
274
276
  .catch(() => {
275
277
  this.tableData = [];
@@ -308,7 +310,7 @@ export default {
308
310
  let draftBadge = "";
309
311
  if (record.draft && record.status !== "CLOSED") {
310
312
  draftBadge = `
311
- <span class ="badge badge-warning status-warnig">
313
+ <span class ="badge badge-warning status-warning">
312
314
  ${this.$t("Draft")}
313
315
  </span>
314
316
  `;
@@ -386,9 +388,9 @@ export default {
386
388
  },
387
389
  setupColumns() {
388
390
  this.tableHeaders = this.getColumns();
389
- const columns = this.getColumns();
391
+ const columnsTasks = this.getColumns();
390
392
 
391
- columns.forEach((column) => {
393
+ columnsTasks.forEach((column) => {
392
394
  const field = {
393
395
  title: () => this.$t(column.label)
394
396
  };
@@ -420,7 +420,7 @@ export default {
420
420
  */
421
421
  // eslint-disable-next-line consistent-return
422
422
  async getDestinationUrl() {
423
- const { elementDestination } = this.task || {};
423
+ const { elementDestination, allow_interstitial: allowInterstitial } = this.task || {};
424
424
 
425
425
  if (!elementDestination) {
426
426
  return null;
@@ -437,7 +437,7 @@ export default {
437
437
  const response = await this.retryApiCall(() => this.getTasks(params));
438
438
 
439
439
  const firstTask = response.data.data[0];
440
- if (firstTask?.user_id === this.userId) {
440
+ if (allowInterstitial && firstTask?.user_id === this.userId) {
441
441
  return `/tasks/${firstTask.id}/edit`;
442
442
  }
443
443
 
@@ -487,6 +487,8 @@ export default {
487
487
  this.nodeId = task.element_id;
488
488
  } else if (this.parentRequest && ['COMPLETED', 'CLOSED'].includes(this.task.process_request.status)) {
489
489
  this.$emit('completed', this.getAllowedRequestId());
490
+ } else if (!this.taskPreview) {
491
+ this.emitClosedEvent();
490
492
  }
491
493
  });
492
494
  },
@@ -602,20 +604,14 @@ export default {
602
604
  const queryParams = {
603
605
  user_id: this.userId,
604
606
  process_request_id: params.processRequestId,
605
- page: params.page,
606
- per_page: params.perPage,
607
- status: params.status
607
+ page: params.page || 1,
608
+ per_page: params.perPage || 1,
609
+ status: params.status,
608
610
  };
609
611
 
610
- const queryString = Object.entries(queryParams)
611
- .filter(([, value]) => value !== undefined && value !== null)
612
- .map(
613
- ([key, value]) =>
614
- `${encodeURIComponent(key)}=${encodeURIComponent(value)}`
615
- )
616
- .join("&");
612
+ const queryString = new URLSearchParams(queryParams).toString();
617
613
 
618
- return window.ProcessMaker.apiClient.get(`tasks?${queryString}`);
614
+ return this.$dataProvider.getTasks(`?${queryString}`);
619
615
  },
620
616
  /**
621
617
  * Parses a JSON string and returns the result.
@@ -690,9 +686,13 @@ export default {
690
686
  data.event === "ACTIVITY_ACTIVATED"
691
687
  && data.elementType === 'task'
692
688
  ) {
693
- this.taskId = data.tokenId;
689
+ if (!this.task.elementDestination?.type) {
690
+ this.taskId = data.taskId;
691
+ }
692
+
694
693
  this.reload();
695
694
  }
695
+
696
696
  if (data.event === 'ACTIVITY_EXCEPTION') {
697
697
  this.$emit('error', this.requestId);
698
698
  }
@@ -236,9 +236,11 @@ export default {
236
236
  return name && typeof name === 'string' && name.match(/^[a-zA-Z_][0-9a-zA-Z_.]*$/);
237
237
  },
238
238
  isComputedVariable(name, definition) {
239
- return definition.computed && definition.computed.some(computed => {
240
- // Check if the first part of an element's name (up to the first `.`)
241
- // matches the name of a computed property.
239
+ return definition?.computed?.some(computed => {
240
+ // add byPass computed property validation
241
+ if (computed?.byPass) return false;
242
+ // Check if the first part of an element'ßs name (up to the first `.`)
243
+ // matches the name of a computed propertåy.
242
244
  const regex = new RegExp(`^${computed.property}(\\.|$)`, 'i');
243
245
  return regex.test(name);
244
246
  });