@processmaker/screen-builder 2.83.12-1 → 2.83.13

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.83.12-1",
3
+ "version": "2.83.13",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -71,38 +71,18 @@ export default {
71
71
 
72
72
  // Methods below are used in the components
73
73
 
74
- async getTasks(params) {
74
+ getTasks(params) {
75
75
  const endpoint = get(
76
76
  window,
77
77
  "PM4ConfigOverrides.getTasksEndpoint",
78
78
  "/tasks"
79
79
  );
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;
80
+ return this.get(endpoint + params).then((response) => {
81
+ if (response.data.screen && response.data.screen.nested) {
82
+ this.addNestedScreenCache(response.data.screen.nested);
83
+ }
84
+ return response;
85
+ });
106
86
  },
107
87
  addNestedScreenCache(nested) {
108
88
  nested.forEach((screen) => {
@@ -1,49 +1,47 @@
1
1
  <template>
2
2
  <div>
3
- <template v-for="event in emptyStartEvents">
4
- <div :key="event.id" class="mb-3 card-request">
5
- <div class="card-body">
6
- <div class="d-flex justify-content-between">
7
- <div>
8
- <span v-uni-id="event.id.toString()" class="card-info card-title">
9
- {{ transformedName }}
10
- </span>
11
- <span class="card-info">
12
- {{ event.name }}
13
- </span>
14
- </div>
15
- <div class="d-flex align-items-center">
16
- <button
17
- :aria-expanded="ariaExpanded"
18
- :aria-controls="getComputedId(process, event)"
19
- class="btn btn-ellipsis btn-sm mr-1"
20
- @click="showRequestDetails(process, event)"
21
- >
22
- <i class="fas fa-ellipsis-v"></i>
23
- </button>
24
- <button
25
- v-uni-aria-describedby="event.id.toString()"
26
- :href="getNewRequestLinkHref(process, event)"
27
- class="btn btn-custom btn-sm"
28
- @click.prevent="newRequestLink(process, event)"
29
- >
30
- {{ $t("Start") }}
31
- <i class="fas fa-play mr-1 card-icon"></i>
32
- </button>
33
- </div>
3
+ <div class="mb-3 card-request">
4
+ <div class="card-body">
5
+ <div class="d-flex justify-content-between">
6
+ <div>
7
+ <span v-uni-id="event.id.toString()" class="card-info card-title">
8
+ {{ transformedName }}
9
+ </span>
10
+ <span class="card-info">
11
+ {{ event.name }}
12
+ </span>
13
+ </div>
14
+ <div class="d-flex align-items-center">
15
+ <button
16
+ :aria-expanded="ariaExpanded"
17
+ :aria-controls="getComputedId(process, event)"
18
+ class="btn btn-ellipsis btn-sm mr-1"
19
+ @click="showRequestDetails(process, event)"
20
+ >
21
+ <i class="fas fa-ellipsis-v"></i>
22
+ </button>
23
+ <button
24
+ v-uni-aria-describedby="event.id.toString()"
25
+ :href="getNewRequestLinkHref(process, event)"
26
+ class="btn btn-custom btn-sm"
27
+ @click.prevent="newRequestLink(process, event)"
28
+ >
29
+ {{ $t("Start") }}
30
+ <i class="fas fa-play mr-1 card-icon"></i>
31
+ </button>
34
32
  </div>
35
- <b-collapse
36
- :id="getComputedId(process, event)"
37
- :aria-hidden="ariaHidden"
38
- >
39
- <hr />
40
- <p class="card-text text-muted card-description">
41
- {{ process.description }}
42
- </p>
43
- </b-collapse>
44
33
  </div>
34
+ <b-collapse
35
+ :id="getComputedId(process, event)"
36
+ :aria-hidden="ariaHidden"
37
+ >
38
+ <hr />
39
+ <p class="card-text text-muted card-description">
40
+ {{ process.description }}
41
+ </p>
42
+ </b-collapse>
45
43
  </div>
46
- </template>
44
+ </div>
47
45
  </div>
48
46
  </template>
49
47
 
@@ -54,7 +52,7 @@ const uniqIdsMixin = createUniqIdsMixin();
54
52
 
55
53
  export default {
56
54
  mixins: [uniqIdsMixin],
57
- props: ["name", "description", "filter", "id", "process"],
55
+ props: ["name", "description", "filter", "id", "process", "event"],
58
56
  data() {
59
57
  return {
60
58
  disabled: false,
@@ -1,15 +1,17 @@
1
1
  <template>
2
2
  <div>
3
3
  <div v-if="Object.keys(processes).length && !loading" class="process-list">
4
- <b-container fluid>
5
- <div v-for="(process, index) in processes" :key="`process-${index}`">
6
- <ProcessCard
7
- v-if="hasEmptyStartEvents(process)"
8
- :filter="filter"
9
- :process="process"
10
- />
11
- </div>
12
- </b-container>
4
+ <div class="row">
5
+ <template v-for="(process, index) in processes">
6
+ <div v-for="(event, indexE) in emptyStartEvents(process)" :key="`process-${index}-${indexE}`" class="col-sm-6">
7
+ <ProcessCard
8
+ :filter="filter"
9
+ :process="process"
10
+ :event="event"
11
+ />
12
+ </div>
13
+ </template>
14
+ </div>
13
15
  </div>
14
16
  <div v-else>
15
17
  <formEmpty link="" title="No Request to Start" url="" />
@@ -39,6 +41,12 @@ export default {
39
41
  this.$root.$on("dropdownSelectionStart", this.fetchData);
40
42
  },
41
43
  methods: {
44
+ emptyStartEvents(process) {
45
+ return process.startEvents.filter(
46
+ (event) =>
47
+ !event.eventDefinitions || event.eventDefinitions.length === 0
48
+ );
49
+ },
42
50
  hasEmptyStartEvents(process) {
43
51
  return !!process.events.find(
44
52
  (event) =>
@@ -480,11 +480,7 @@ export default {
480
480
  return allowed ? this.parentRequest : this.requestId
481
481
  },
482
482
  processUpdated: _.debounce(function(data) {
483
- if (
484
- (data.event === "ACTIVITY_COMPLETED" ||
485
- data.event === "ACTIVITY_ACTIVATED") &&
486
- data.elementType === 'task'
487
- ) {
483
+ if (data.event === 'ACTIVITY_ACTIVATED') {
488
484
  this.reload();
489
485
  }
490
486
  if (data.event === 'ACTIVITY_EXCEPTION') {
@@ -533,12 +529,14 @@ export default {
533
529
  '.ProcessUpdated',
534
530
  (data) => {
535
531
  if (
536
- ['ACTIVITY_ACTIVATED'].includes(data.event)
532
+ ['ACTIVITY_ACTIVATED'].includes(data.event) &&
533
+ !this.existsEventMessage(`${data.event}-${this.userId}-${this.taskId}`)
537
534
  ) {
538
535
  this.closeTask(this.parentRequest);
539
536
  }
540
537
  if (
541
- ["ACTIVITY_COMPLETED"].includes(data.event)
538
+ ["ACTIVITY_COMPLETED"].includes(data.event) &&
539
+ !this.existsEventMessage(`${data.event}-${this.userId}-${this.taskId}`)
542
540
  ) {
543
541
  if (this.task.process_request.status === 'COMPLETED') {
544
542
  this.processCompleted();