@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.
@@ -22102,17 +22102,17 @@ const Xo = {
22102
22102
  * @param {object} params
22103
22103
  * @returns {object}
22104
22104
  */
22105
- getDataSource(t, e) {
22105
+ getDataSource(t, e, r = null) {
22106
22106
  if (!window.ProcessMaker.screen.cacheEnabled && !window.ProcessMaker.screen.cacheTimeout)
22107
22107
  return this.postDataSource(t, null, e);
22108
- let r = `/requests/data_sources/${t}/resources/${e.config.endpoint}/data`;
22109
- return r += this.authQueryString(), this.get(r, {
22108
+ let i = `/requests/data_sources/${t}/resources/${e.config.endpoint}/data`;
22109
+ return i += this.authQueryString(), this.get(i, {
22110
22110
  useCache: window.ProcessMaker.screen.cacheEnabled,
22111
22111
  params: {
22112
22112
  pmds_config: JSON.stringify(e.config),
22113
22113
  pmds_data: JSON.stringify(e.data)
22114
22114
  }
22115
- }).then((i) => i);
22115
+ }).then((a) => [a, r]);
22116
22116
  },
22117
22117
  authQueryString() {
22118
22118
  const t = Se(window, "PM4ConfigOverrides.authParams", null);
@@ -22142,18 +22142,19 @@ const Xo = {
22142
22142
  );
22143
22143
  },
22144
22144
  getCollectionRecords(t, e, r = null) {
22145
- return e.useCache = window.ProcessMaker.screen.cacheEnabled, this.get(
22145
+ var i, a;
22146
+ return e.useCache = (a = (i = window.ProcessMaker) == null ? void 0 : i.screen) == null ? void 0 : a.cacheEnabled, this.get(
22146
22147
  `/collections/${t}/records${this.authQueryString()}`,
22147
22148
  e
22148
- ).then((i) => {
22149
- const a = i ? i.data : null;
22150
- if (!a)
22149
+ ).then((n) => {
22150
+ const s = n ? n.data : null;
22151
+ if (!s)
22151
22152
  throw new Error(Ae.t("No data returned"));
22152
- return [a, r];
22153
- }).catch((i) => {
22154
- if (i.response && i.response.status === 404)
22153
+ return [s, r];
22154
+ }).catch((n) => {
22155
+ if (n.response && n.response.status === 404)
22155
22156
  return [{ data: [] }, r];
22156
- throw i;
22157
+ throw n;
22157
22158
  });
22158
22159
  }
22159
22160
  };
@@ -22595,7 +22596,8 @@ const eR = {
22595
22596
  return t && typeof t == "string" && t.match(/^[a-zA-Z_][0-9a-zA-Z_.]*$/);
22596
22597
  },
22597
22598
  isComputedVariable(t, e) {
22598
- return e.computed && e.computed.some((r) => new RegExp(`^${r.property}(\\.|$)`, "i").test(t));
22599
+ var r;
22600
+ return (r = e == null ? void 0 : e.computed) == null ? void 0 : r.some((i) => i != null && i.byPass ? !1 : new RegExp(`^${i.property}(\\.|$)`, "i").test(t));
22599
22601
  },
22600
22602
  registerVariable(t, e = {}) {
22601
22603
  if (t && t.startsWith("_parent.") || t && t.includes("._parent.") || !this.validVariableName(t))
@@ -45390,7 +45392,7 @@ const bK = ds(), yK = {
45390
45392
  url: "/tasks",
45391
45393
  dropdownShow: "tasks"
45392
45394
  };
45393
- this.$emit("tasksCount", { dataControls: s, tasksDropdown: a });
45395
+ this.$emit("tasksCount", { dataControls: s, tasksDropdown: a }), this.$refs["form-task"].resetToOriginalWidths();
45394
45396
  }).catch(() => {
45395
45397
  this.tableData = [];
45396
45398
  });
@@ -45420,7 +45422,7 @@ const bK = ds(), yK = {
45420
45422
  verifyDraft(t) {
45421
45423
  let e = "";
45422
45424
  return t.draft && t.status !== "CLOSED" && (e = `
45423
- <span class ="badge badge-warning status-warnig">
45425
+ <span class ="badge badge-warning status-warning">
45424
45426
  ${this.$t("Draft")}
45425
45427
  </span>
45426
45428
  `), e;
@@ -45609,7 +45611,7 @@ const bK = ds(), yK = {
45609
45611
  };
45610
45612
  var xK = function() {
45611
45613
  var e = this, r = e._self._c;
45612
- return e.showTable ? r("div", [r("filter-table", { attrs: { headers: e.tableHeaders, data: e.tableData, unread: e.unreadColumnName, loading: e.shouldShowLoader }, on: { "table-row-mouseover": e.handleRowMouseover, "table-row-mouseleave": e.handleRowMouseleave }, scopedSlots: e._u([e._l(e.tableHeaders, function(i, a) {
45614
+ return e.showTable ? r("div", [r("filter-table", { attrs: { "table-name": "form-tasks", headers: e.tableHeaders, data: e.tableData, unread: e.unreadColumnName, loading: e.shouldShowLoader }, on: { "table-row-mouseover": e.handleRowMouseover, "table-row-mouseleave": e.handleRowMouseleave }, scopedSlots: e._u([e._l(e.tableHeaders, function(i, a) {
45613
45615
  return { key: i.field, fn: function() {
45614
45616
  return [r("div", { key: a, staticStyle: { display: "inline-block" } }, [i.field === "is_priority" ? r("img", { attrs: { src: gK, alt: "priority-header", width: "20", height: "20" } }) : r("span", [e._v(e._s(e.$t(i.label)))])])];
45615
45617
  }, proxy: !0 };
@@ -45638,7 +45640,7 @@ var xK = function() {
45638
45640
  wK,
45639
45641
  !1,
45640
45642
  null,
45641
- "f22a626d",
45643
+ "d7744395",
45642
45644
  null,
45643
45645
  null
45644
45646
  );
@@ -45701,7 +45703,7 @@ const SK = ds(), kK = {
45701
45703
  url: "/cases",
45702
45704
  dropdownShow: "requests"
45703
45705
  }, a = [];
45704
- this.$emit("requestsCount", { dataControls: i, tasksDropdown: a });
45706
+ this.$emit("requestsCount", { dataControls: i, tasksDropdown: a }), this.$refs["form-case"].resetToOriginalWidths();
45705
45707
  }).catch(() => {
45706
45708
  this.tableData = [];
45707
45709
  });
@@ -45749,20 +45751,14 @@ const SK = ds(), kK = {
45749
45751
  this.pmqlSearch = "", this.pmqlSearch = t, this.fetch();
45750
45752
  },
45751
45753
  setupColumns() {
45752
- const t = this.getColumns();
45753
- this.tableHeaders = this.getColumns(), t.forEach((e) => {
45754
+ const t = this.getColumnsCases();
45755
+ this.tableHeaders = this.getColumnsCases(), t.forEach((e) => {
45754
45756
  const r = {
45755
45757
  title: () => this.$t(e.label)
45756
45758
  };
45757
45759
  switch (e.field) {
45758
- case "id":
45759
- r.name = "__slot:ids", r.title = "#";
45760
- break;
45761
- case "participants":
45762
- r.name = "__slot:participants";
45763
- break;
45764
- case "name":
45765
- r.name = "__slot:name";
45760
+ case "case_number":
45761
+ r.name = "__slot:case_number";
45766
45762
  break;
45767
45763
  case "case_title":
45768
45764
  r.name = "__slot:case_title";
@@ -45771,12 +45767,9 @@ const SK = ds(), kK = {
45771
45767
  r.name = e.name || e.field;
45772
45768
  }
45773
45769
  r.field || (r.field = e.field), e.format === "datetime" && (r.callback = "formatDateUser|datetime"), e.format === "date" && (r.callback = "formatDateUser|date"), e.sortable === !0 && !r.sortField && (r.sortField = e.field), this.fields.push(r);
45774
- }), this.fields.push({
45775
- name: "__slot:actions",
45776
- title: ""
45777
45770
  });
45778
45771
  },
45779
- getColumns() {
45772
+ getColumnsCases() {
45780
45773
  return [
45781
45774
  {
45782
45775
  label: "Case #",
@@ -45802,7 +45795,7 @@ const SK = ds(), kK = {
45802
45795
  sortable: !0,
45803
45796
  default: !0,
45804
45797
  width: 113,
45805
- fixed_width: 314,
45798
+ fixed_width: 113,
45806
45799
  resizable: !1,
45807
45800
  filter_subject: { type: "Status" }
45808
45801
  },
@@ -45818,7 +45811,7 @@ const SK = ds(), kK = {
45818
45811
  };
45819
45812
  var TK = function() {
45820
45813
  var e = this, r = e._self._c;
45821
- return e.showTable ? r("div", [r("filter-table", { attrs: { headers: e.tableHeaders, data: e.tableData, unread: e.unreadColumnName, loading: e.shouldShowLoader }, scopedSlots: e._u([e._l(e.data.data, function(i, a) {
45814
+ return e.showTable ? r("div", [r("filter-table", { attrs: { "table-name": "form-cases", headers: e.tableHeaders, data: e.tableData, unread: e.unreadColumnName, loading: e.shouldShowLoader }, scopedSlots: e._u([e._l(e.data.data, function(i, a) {
45822
45815
  return { key: `row-${a}`, fn: function() {
45823
45816
  return e._l(e.tableHeaders, function(n, s) {
45824
45817
  return r("td", { key: `${a}-${s}` }, [e.containsHTML(e.getNestedPropertyValue(i, n)) ? [r("div", { class: { "pm-table-truncate": n.truncate }, style: { maxWidth: n.width + "px" }, attrs: { id: `element-${a}-${s}` } }, [r("span", { domProps: { innerHTML: e._s(e.sanitize(e.getNestedPropertyValue(i, n))) } })]), n.truncate ? r("b-tooltip", { attrs: { target: `element-${a}-${s}`, "custom-class": "pm-table-tooltip" }, on: { show: e.checkIfTooltipIsNeeded } }, [e._v(" " + e._s(e.sanitizeTooltip(e.getNestedPropertyValue(i, n))) + " ")]) : e._e()] : [e.isComponent(i[n.field]) ? [r(i[n.field].component, e._b({ tag: "component" }, "component", i[n.field].props, !1))] : [r("div", { class: { "pm-table-truncate": n.truncate }, style: { maxWidth: n.width + "px" }, attrs: { id: `element-${a}-${s}` } }, [e._v(" " + e._s(e.getNestedPropertyValue(i, n)) + " "), n.truncate ? r("b-tooltip", { attrs: { target: `element-${a}-${s}`, "custom-class": "pm-table-tooltip" }, on: { show: e.checkIfTooltipIsNeeded } }, [e._v(" " + e._s(e.getNestedPropertyValue(i, n)) + " ")]) : e._e()], 1)]]], 2);
@@ -45831,7 +45824,7 @@ var TK = function() {
45831
45824
  CK,
45832
45825
  !1,
45833
45826
  null,
45834
- "138e5bd2",
45827
+ "ebd7b03d",
45835
45828
  null,
45836
45829
  null
45837
45830
  );
@@ -46111,7 +46104,7 @@ var VK = function() {
46111
46104
  qK,
46112
46105
  !1,
46113
46106
  null,
46114
- "241c5ccd",
46107
+ "830c77e3",
46115
46108
  null,
46116
46109
  null
46117
46110
  );
@@ -47705,7 +47698,7 @@ var u$ = function() {
47705
47698
  e.selectedDataSource = i;
47706
47699
  }, expression: "selectedDataSource" } }), e.selectedDataSource ? e._e() : r("div", { staticClass: "invalid-feedback" }, [e._v(e._s(e.$t("An Data Connector must be selected")))]), r("small", { staticClass: "form-text text-muted mb-3" }, [e._v(e._s(e.$t("Data Connector to use")))])], 1) : e._e(), e.dataSource === e.dataSourceValues.dataConnector ? r("div", [r("label", { attrs: { for: "endpoint-list" } }, [e._v(e._s(e.$t("End Point")))]), r("b-form-select", { class: e.selectedDataSource && !e.selectedEndPoint ? "is-invalid" : "", attrs: { id: "endpoint-list", options: e.endPointList, "data-cy": "inspector-endpoint" }, model: { value: e.selectedEndPoint, callback: function(i) {
47707
47700
  e.selectedEndPoint = i;
47708
- }, expression: "selectedEndPoint" } }), e.selectedDataSource && !e.selectedEndPoint ? r("div", { staticClass: "invalid-feedback" }, [e._v(e._s(e.$t("An Endpoint must be selected")))]) : e._e(), r("small", { staticClass: "form-text text-muted mb-3" }, [e._v(e._s(e.$t("Endpoint to populate select")))])], 1) : e._e(), e.dataSource === e.dataSourceValues.dataConnector ? r("div", [r("pmql-input", { staticClass: "mb-1", attrs: { "search-type": "collections", "input-label": "PMQL", condensed: !0, "ai-enabled": !0, placeholder: e.$t("PMQL") }, model: { value: e.pmqlQuery, callback: function(i) {
47701
+ }, expression: "selectedEndPoint" } }), e.selectedDataSource && !e.selectedEndPoint ? r("div", { staticClass: "invalid-feedback" }, [e._v(e._s(e.$t("An Endpoint must be selected")))]) : e._e(), r("small", { staticClass: "form-text text-muted mb-3" }, [e._v(e._s(e.$t("Endpoint to populate select")))])], 1) : e._e(), e.dataSource === e.dataSourceValues.dataConnector ? r("div", [r("pmql-input", { staticClass: "mb-1", attrs: { "search-type": "collections_w_mustaches", "input-label": "PMQL", condensed: !0, "ai-enabled": !0, placeholder: e.$t("PMQL") }, model: { value: e.pmqlQuery, callback: function(i) {
47709
47702
  e.pmqlQuery = i;
47710
47703
  }, expression: "pmqlQuery" } }), r("small", { staticClass: "form-text text-muted" }, [e._v(e._s(e.$t("Advanced data search")))])], 1) : e._e()], 1);
47711
47704
  }, c$ = [], d$ = /* @__PURE__ */ ne(
@@ -47714,7 +47707,7 @@ var u$ = function() {
47714
47707
  c$,
47715
47708
  !1,
47716
47709
  null,
47717
- "e0acf8b1",
47710
+ "282ac989",
47718
47711
  null,
47719
47712
  null
47720
47713
  );
@@ -51350,22 +51343,22 @@ const nte = () => new Promise((t) => {
51350
51343
  */
51351
51344
  // eslint-disable-next-line consistent-return
51352
51345
  async getDestinationUrl() {
51353
- const { elementDestination: t } = this.task || {};
51346
+ const { elementDestination: t, allow_interstitial: e } = this.task || {};
51354
51347
  if (!t)
51355
51348
  return null;
51356
51349
  if (t.type === "taskSource")
51357
51350
  try {
51358
- const i = {
51351
+ const a = {
51359
51352
  processRequestId: this.requestId,
51360
51353
  status: "ACTIVE",
51361
51354
  userId: this.userId
51362
- }, n = (await this.retryApiCall(() => this.getTasks(i))).data.data[0];
51363
- return (n == null ? void 0 : n.user_id) === this.userId ? `/tasks/${n.id}/edit` : document.referrer || null;
51364
- } catch (i) {
51365
- return console.error("Error in getDestinationUrl:", i), null;
51355
+ }, s = (await this.retryApiCall(() => this.getTasks(a))).data.data[0];
51356
+ return e && (s == null ? void 0 : s.user_id) === this.userId ? `/tasks/${s.id}/edit` : document.referrer || null;
51357
+ } catch (a) {
51358
+ return console.error("Error in getDestinationUrl:", a), null;
51366
51359
  }
51367
- const e = t.value;
51368
- return e || sessionStorage.getItem("elementDestinationURL") || null;
51360
+ const r = t.value;
51361
+ return r || sessionStorage.getItem("elementDestinationURL") || null;
51369
51362
  },
51370
51363
  loadNextAssignedTask(t = null) {
51371
51364
  if (t || (t = this.requestId), !this.userId)
@@ -51383,7 +51376,7 @@ const nte = () => new Promise((t) => {
51383
51376
  this.emitIfTaskCompleted(t);
51384
51377
  this.taskId = a.id, this.loadTask(), this.nodeId = a.element_id;
51385
51378
  } else
51386
- this.parentRequest && ["COMPLETED", "CLOSED"].includes(this.task.process_request.status) && this.$emit("completed", this.getAllowedRequestId());
51379
+ this.parentRequest && ["COMPLETED", "CLOSED"].includes(this.task.process_request.status) ? this.$emit("completed", this.getAllowedRequestId()) : this.taskPreview || this.emitClosedEvent();
51387
51380
  });
51388
51381
  },
51389
51382
  emitIfTaskCompleted(t) {
@@ -51458,13 +51451,11 @@ const nte = () => new Promise((t) => {
51458
51451
  const e = {
51459
51452
  user_id: this.userId,
51460
51453
  process_request_id: t.processRequestId,
51461
- page: t.page,
51462
- per_page: t.perPage,
51454
+ page: t.page || 1,
51455
+ per_page: t.perPage || 1,
51463
51456
  status: t.status
51464
- }, r = Object.entries(e).filter(([, i]) => i != null).map(
51465
- ([i, a]) => `${encodeURIComponent(i)}=${encodeURIComponent(a)}`
51466
- ).join("&");
51467
- return window.ProcessMaker.apiClient.get(`tasks?${r}`);
51457
+ }, r = new URLSearchParams(e).toString();
51458
+ return this.$dataProvider.getTasks(`?${r}`);
51468
51459
  },
51469
51460
  /**
51470
51461
  * Parses a JSON string and returns the result.
@@ -51517,7 +51508,8 @@ const nte = () => new Promise((t) => {
51517
51508
  return e && e.allowed ? this.parentRequest : this.requestId;
51518
51509
  },
51519
51510
  processUpdated: ie.debounce(function(t) {
51520
- t.event === "ACTIVITY_ACTIVATED" && t.elementType === "task" && (this.taskId = t.tokenId, this.reload()), t.event === "ACTIVITY_EXCEPTION" && this.$emit("error", this.requestId);
51511
+ var e;
51512
+ t.event === "ACTIVITY_ACTIVATED" && t.elementType === "task" && ((e = this.task.elementDestination) != null && e.type || (this.taskId = t.taskId), this.reload()), t.event === "ACTIVITY_EXCEPTION" && this.$emit("error", this.requestId);
51521
51513
  }, 100),
51522
51514
  initSocketListeners() {
51523
51515
  this.loadingListeners = !1, this.addSocketListener(
@@ -51597,7 +51589,7 @@ var ote = function() {
51597
51589
  lte,
51598
51590
  !1,
51599
51591
  null,
51600
- "5b17b823",
51592
+ "b5beddfe",
51601
51593
  null,
51602
51594
  null
51603
51595
  );
@@ -52247,7 +52239,7 @@ const Fte = typeof window > "u" ? global : window, Bte = {
52247
52239
  deleteProperty(t) {
52248
52240
  Fte.ProcessMaker.confirmModal(
52249
52241
  this.$t("Are you sure you want to delete the calc ?"),
52250
- this.$t("If you do, you wont be able to recover the calc configuration."),
52242
+ this.$t("If you do, you won’t be able to recover the Calc configuration."),
52251
52243
  "",
52252
52244
  () => {
52253
52245
  this.remove(t);
@@ -52299,7 +52291,7 @@ var Hte = function() {
52299
52291
  Rte,
52300
52292
  !1,
52301
52293
  null,
52302
- "61e60a87",
52294
+ "6d70559c",
52303
52295
  null,
52304
52296
  null
52305
52297
  );