@processmaker/screen-builder 2.99.0 → 2.99.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.
@@ -22043,18 +22043,18 @@ const Xo = {
22043
22043
  window,
22044
22044
  "PM4ConfigOverrides.getTasksEndpoint",
22045
22045
  "/api/1.1/tasks"
22046
- ), r = [], i = t.match(/include=.*,screen,/), a = t.match(/include=.*,nested,/);
22046
+ ), r = [], i = t.match(/include=.*,screen,/), a = t.match(/include=.*,nested,/), n = t.match(/screen_version=([^&]+)/), s = n ? n[1] : null;
22047
22047
  if (r.push(
22048
22048
  this.get(e + t.replace(/,screen,|,nested,/g, ","))
22049
22049
  ), i) {
22050
- const u = `${(e + t).replace(
22050
+ let c = `${(e + t).replace(
22051
22051
  /\?.+$/,
22052
22052
  ""
22053
22053
  )}/screen?include=screen${a ? ",nested" : ""}`;
22054
- r.push(this.get(u));
22054
+ s && (c += `&screen_version=${s}`), r.push(this.get(c));
22055
22055
  }
22056
- const [n, s] = await Promise.all(r), o = n;
22057
- return s && (o.data.screen = s.data), o.data.screen && o.data.screen.nested && this.addNestedScreenCache(o.data.screen.nested), o;
22056
+ const [o, u] = await Promise.all(r), l = o;
22057
+ return u && (l.data.screen = u.data), l.data.screen && l.data.screen.nested && this.addNestedScreenCache(l.data.screen.nested), l;
22058
22058
  },
22059
22059
  addNestedScreenCache(t) {
22060
22060
  t.forEach((e) => {
@@ -51163,6 +51163,7 @@ const nte = () => new Promise((t) => {
51163
51163
  initialRequestId: { type: Number, default: null },
51164
51164
  initialProcessId: { type: Number, default: null },
51165
51165
  initialNodeId: { type: String, default: null },
51166
+ screenVersion: { type: Number, default: null },
51166
51167
  userId: { type: Number, default: null },
51167
51168
  csrfToken: { type: String, default: null },
51168
51169
  value: { type: Object, default: () => {
@@ -51280,15 +51281,15 @@ const nte = () => new Promise((t) => {
51280
51281
  reload() {
51281
51282
  this.taskId ? this.loadTask() : this.loadNextAssignedTask();
51282
51283
  },
51283
- loadTask() {
51284
+ loadTask(t = !1) {
51284
51285
  if (!this.taskId)
51285
51286
  return;
51286
- const t = `/${this.taskId}?include=data,user,draft,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission,elementDestination`;
51287
- return window.ProcessMaker && window.ProcessMaker.packages && window.ProcessMaker.packages.includes("package-vocabularies") && (window.ProcessMaker.VocabulariesSchemaUrl = `vocabularies/task_schema/${this.taskId}`), this.beforeLoadTask(this.taskId, this.nodeId).then(() => {
51288
- this.$dataProvider.getTasks(t).then((e) => {
51289
- if (this.task = e.data, this.linkTask(), this.checkTaskStatus(), window.PM4ConfigOverrides && window.PM4ConfigOverrides.getScreenEndpoint && window.PM4ConfigOverrides.getScreenEndpoint.includes("tasks/")) {
51290
- const r = window.PM4ConfigOverrides.getScreenEndpoint.split("/");
51291
- r[1] = this.task.id, window.PM4ConfigOverrides.getScreenEndpoint = r.join("/");
51287
+ let e = `/${this.taskId}?include=data,user,draft,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission,elementDestination`;
51288
+ return this.screenVersion && (e += `&screen_version=${this.screenVersion}`), window.ProcessMaker && window.ProcessMaker.packages && window.ProcessMaker.packages.includes("package-vocabularies") && (window.ProcessMaker.VocabulariesSchemaUrl = `vocabularies/task_schema/${this.taskId}`), this.beforeLoadTask(this.taskId, this.nodeId).then(() => {
51289
+ this.$dataProvider.getTasks(e).then((r) => {
51290
+ if (this.task = r.data, this.linkTask(t), this.checkTaskStatus(), window.PM4ConfigOverrides && window.PM4ConfigOverrides.getScreenEndpoint && window.PM4ConfigOverrides.getScreenEndpoint.includes("tasks/")) {
51291
+ const i = window.PM4ConfigOverrides.getScreenEndpoint.split("/");
51292
+ i[1] = this.task.id, window.PM4ConfigOverrides.getScreenEndpoint = i.join("/");
51292
51293
  }
51293
51294
  }).catch(() => {
51294
51295
  this.hasErrors = !0;
@@ -51297,8 +51298,15 @@ const nte = () => new Promise((t) => {
51297
51298
  });
51298
51299
  });
51299
51300
  },
51300
- linkTask() {
51301
- this.nodeId = this.task.element_id, this.listenForParentChanges(), this.task.process_request.status === "COMPLETED" && (this.taskPreview || this.$emit("completed", this.task.process_request.id)), this.taskPreview && this.task.status === "CLOSED" && (this.task.interstitial_screen._interstitial = !1, this.alwaysAllowEditing || (this.task.screen.config = this.disableForm(this.task.screen.config)), this.screen = this.task.screen);
51301
+ linkTask(t) {
51302
+ this.nodeId = this.task.element_id, this.listenForParentChanges(), this.task.process_request.status === "COMPLETED" && (this.taskPreview || (this.$emit("completed", this.task.process_request.id), t && window.ProcessMaker.apiClient.get(`/requests/${this.requestId}/end-event-destination`).then((e) => {
51303
+ var r, i;
51304
+ if (!((i = (r = e.data) == null ? void 0 : r.data) != null && i.endEventDestination)) {
51305
+ window.location.href = `/requests/${this.requestId}`;
51306
+ return;
51307
+ }
51308
+ this.processCompletedRedirect(e.data.data, this.userId, this.requestId);
51309
+ }))), this.taskPreview && this.task.status === "CLOSED" && (this.task.interstitial_screen._interstitial = !1, this.alwaysAllowEditing || (this.task.screen.config = this.disableForm(this.task.screen.config)), this.screen = this.task.screen);
51302
51310
  },
51303
51311
  prepareTask() {
51304
51312
  (!this.loadingButton || this.task.status === "ACTIVE") && (this.resetScreenState(), this.requestData = ie.get(this.task, "request_data", {}), this.loopContext = ie.get(this.task, "loop_context", ""), this.task.draft && (this.requestData = ie.merge(
@@ -51405,6 +51413,7 @@ const nte = () => new Promise((t) => {
51405
51413
  this.taskId = a.id, this.nodeId = a.element_id, this.loadTask();
51406
51414
  } else
51407
51415
  this.parentRequest && ["COMPLETED", "CLOSED"].includes(this.task.process_request.status) && this.$emit("completed", this.getAllowedRequestId());
51416
+ this.disabled = !1;
51408
51417
  });
51409
51418
  },
51410
51419
  emitIfTaskCompleted(t) {
@@ -51709,7 +51718,7 @@ const nte = () => new Promise((t) => {
51709
51718
  }
51710
51719
  },
51711
51720
  mounted() {
51712
- this.screenId = this.initialScreenId, this.taskId = this.initialTaskId, this.requestId = this.initialRequestId, this.processId = this.initialProcessId, this.nodeId = this.initialNodeId, this.requestData = this.value, this.loopContext = this.initialLoopContext, this.loadTask();
51721
+ this.screenId = this.initialScreenId, this.taskId = this.initialTaskId, this.requestId = this.initialRequestId, this.processId = this.initialProcessId, this.nodeId = this.initialNodeId, this.requestData = this.value, this.loopContext = this.initialLoopContext, this.loadTask(!0);
51713
51722
  },
51714
51723
  destroyed() {
51715
51724
  this.unsubscribeSocketListeners();
@@ -51730,7 +51739,7 @@ var ote = function() {
51730
51739
  lte,
51731
51740
  !1,
51732
51741
  null,
51733
- "8a63a82f",
51742
+ "5348c487",
51734
51743
  null,
51735
51744
  null
51736
51745
  );