@processmaker/screen-builder 2.83.11 → 2.83.12-1
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
package/src/DataProvider.js
CHANGED
|
@@ -71,18 +71,38 @@ export default {
|
|
|
71
71
|
|
|
72
72
|
// Methods below are used in the components
|
|
73
73
|
|
|
74
|
-
getTasks(params) {
|
|
74
|
+
async getTasks(params) {
|
|
75
75
|
const endpoint = get(
|
|
76
76
|
window,
|
|
77
77
|
"PM4ConfigOverrides.getTasksEndpoint",
|
|
78
78
|
"/tasks"
|
|
79
79
|
);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
const promises = [];
|
|
81
|
+
const hasIncludeScreen = params.match(/include=.*,screen,/);
|
|
82
|
+
const hasIncludeNested = params.match(/include=.*,nested,/);
|
|
83
|
+
|
|
84
|
+
// remove params ?...
|
|
85
|
+
promises.push(
|
|
86
|
+
this.get(endpoint + params.replace(/,screen,|,nested,/g, ","))
|
|
87
|
+
);
|
|
88
|
+
// Get the screen from a separated cached endpoint
|
|
89
|
+
if (hasIncludeScreen) {
|
|
90
|
+
const screenEndpoint = `${(endpoint + params).replace(
|
|
91
|
+
/\?.+$/,
|
|
92
|
+
""
|
|
93
|
+
)}/screen?include=screen${hasIncludeNested ? ",nested" : ""}`;
|
|
94
|
+
promises.push(this.get(screenEndpoint));
|
|
95
|
+
}
|
|
96
|
+
// Await for both promises to resolve
|
|
97
|
+
const [taskData, taskScreen] = await Promise.all(promises);
|
|
98
|
+
const response = taskData;
|
|
99
|
+
if (taskScreen) {
|
|
100
|
+
response.data.screen = taskScreen.data;
|
|
101
|
+
}
|
|
102
|
+
if (response.data.screen && response.data.screen.nested) {
|
|
103
|
+
this.addNestedScreenCache(response.data.screen.nested);
|
|
104
|
+
}
|
|
105
|
+
return response;
|
|
86
106
|
},
|
|
87
107
|
addNestedScreenCache(nested) {
|
|
88
108
|
nested.forEach((screen) => {
|
package/src/components/task.vue
CHANGED
|
@@ -481,8 +481,9 @@ export default {
|
|
|
481
481
|
},
|
|
482
482
|
processUpdated: _.debounce(function(data) {
|
|
483
483
|
if (
|
|
484
|
-
data.event ===
|
|
485
|
-
|
|
484
|
+
(data.event === "ACTIVITY_COMPLETED" ||
|
|
485
|
+
data.event === "ACTIVITY_ACTIVATED") &&
|
|
486
|
+
data.elementType === 'task'
|
|
486
487
|
) {
|
|
487
488
|
this.reload();
|
|
488
489
|
}
|
|
@@ -515,6 +516,13 @@ export default {
|
|
|
515
516
|
this.reload();
|
|
516
517
|
}
|
|
517
518
|
},
|
|
519
|
+
existsEventMessage(id, data) {
|
|
520
|
+
if (sessionStorage.getItem(id)) {
|
|
521
|
+
return true;
|
|
522
|
+
}
|
|
523
|
+
sessionStorage.setItem(id, data);
|
|
524
|
+
return false;
|
|
525
|
+
},
|
|
518
526
|
listenForParentChanges() {
|
|
519
527
|
if (!this.parentRequest) {
|
|
520
528
|
return;
|
|
@@ -524,10 +532,14 @@ export default {
|
|
|
524
532
|
`ProcessMaker.Models.ProcessRequest.${this.parentRequest}`,
|
|
525
533
|
'.ProcessUpdated',
|
|
526
534
|
(data) => {
|
|
527
|
-
if (
|
|
535
|
+
if (
|
|
536
|
+
['ACTIVITY_ACTIVATED'].includes(data.event)
|
|
537
|
+
) {
|
|
528
538
|
this.closeTask(this.parentRequest);
|
|
529
539
|
}
|
|
530
|
-
if (
|
|
540
|
+
if (
|
|
541
|
+
["ACTIVITY_COMPLETED"].includes(data.event)
|
|
542
|
+
) {
|
|
531
543
|
if (this.task.process_request.status === 'COMPLETED') {
|
|
532
544
|
this.processCompleted();
|
|
533
545
|
}
|