@processmaker/screen-builder 2.91.0 → 2.93.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.93.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}`"
@@ -249,24 +247,17 @@ export default {
249
247
  this.fetch();
250
248
  },
251
249
  setupColumns() {
252
- const columns = this.getColumns();
253
- this.tableHeaders = this.getColumns();
250
+ const columnsCases = this.getColumnsCases();
251
+ this.tableHeaders = this.getColumnsCases();
254
252
 
255
- columns.forEach((column) => {
253
+ columnsCases.forEach((column) => {
256
254
  const field = {
257
- title: () => this.$t(column.label),
255
+ title: () => this.$t(column.label)
258
256
  };
259
257
 
260
258
  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";
259
+ case "case_number":
260
+ field.name = "__slot:case_number";
270
261
  break;
271
262
  case "case_title":
272
263
  field.name = "__slot:case_title";
@@ -293,13 +284,8 @@ export default {
293
284
 
294
285
  this.fields.push(field);
295
286
  });
296
-
297
- this.fields.push({
298
- name: "__slot:actions",
299
- title: ""
300
- });
301
287
  },
302
- getColumns() {
288
+ getColumnsCases() {
303
289
  return [
304
290
  {
305
291
  label: "Case #",
@@ -316,8 +302,7 @@ export default {
316
302
  default: true,
317
303
  truncate: true,
318
304
  width: 314,
319
- fixed_width: 314,
320
- resizable: false
305
+ fixed_width: 314
321
306
  },
322
307
  {
323
308
  label: "Status",
@@ -325,8 +310,7 @@ export default {
325
310
  sortable: true,
326
311
  default: true,
327
312
  width: 113,
328
- fixed_width: 314,
329
- resizable: false,
313
+ fixed_width: 113,
330
314
  filter_subject: { type: "Status" }
331
315
  },
332
316
  {
@@ -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"
@@ -308,7 +309,7 @@ export default {
308
309
  let draftBadge = "";
309
310
  if (record.draft && record.status !== "CLOSED") {
310
311
  draftBadge = `
311
- <span class ="badge badge-warning status-warnig">
312
+ <span class ="badge badge-warning status-warning">
312
313
  ${this.$t("Draft")}
313
314
  </span>
314
315
  `;
@@ -330,8 +331,7 @@ export default {
330
331
  default: true,
331
332
  width: 153,
332
333
  fixed_width: 153,
333
- truncate: true,
334
- resizable: false
334
+ truncate: true
335
335
  },
336
336
  {
337
337
  label: "Priority",
@@ -339,8 +339,7 @@ export default {
339
339
  sortable: false,
340
340
  default: true,
341
341
  width: 48,
342
- fixed_width: 48,
343
- resizable: false
342
+ fixed_width: 48
344
343
  },
345
344
  {
346
345
  label: "Case title",
@@ -350,8 +349,7 @@ export default {
350
349
  default: true,
351
350
  width: 314,
352
351
  truncate: true,
353
- fixed_width: 314,
354
- resizable: false
352
+ fixed_width: 314
355
353
  }
356
354
  ];
357
355
 
@@ -362,8 +360,7 @@ export default {
362
360
  sortable: true,
363
361
  default: true,
364
362
  width: 220,
365
- fixed_width: 220,
366
- resizable: false
363
+ fixed_width: 220
367
364
  });
368
365
  } else {
369
366
  columns.push({
@@ -372,8 +369,7 @@ export default {
372
369
  sortable: true,
373
370
  default: true,
374
371
  width: 220,
375
- fixed_width: 220,
376
- resizable: false
372
+ fixed_width: 220
377
373
  });
378
374
  }
379
375
  columns.push({
@@ -386,9 +382,9 @@ export default {
386
382
  },
387
383
  setupColumns() {
388
384
  this.tableHeaders = this.getColumns();
389
- const columns = this.getColumns();
385
+ const columnsTasks = this.getColumns();
390
386
 
391
- columns.forEach((column) => {
387
+ columnsTasks.forEach((column) => {
392
388
  const field = {
393
389
  title: () => this.$t(column.label)
394
390
  };
@@ -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
  });