@processmaker/screen-builder 2.83.5 → 2.83.6

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.5",
3
+ "version": "2.83.6",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -1,43 +1,49 @@
1
1
  <template>
2
- <div class="m-3 card-request">
3
- <div v-for="event in emptyStartEvents" :key="event.id" class="card">
4
- <div class="card-body">
5
- <div class="d-flex justify-content-between">
6
- <div style="width: 80%">
7
- <span v-uni-id="event.id.toString()">{{ transformedName }}</span>
8
- <span v-if="process.startEvents.length > 1">
9
- : {{ event.name }}
10
- </span>
11
- <a
12
- href="#"
13
- :aria-expanded="ariaExpanded"
14
- :aria-controls="getComputedId(process)"
15
- @click="showRequestDetails"
16
- >
17
- ...
18
- </a>
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>
19
34
  </div>
20
- <div class="text-right">
21
- <button
22
- v-uni-aria-describedby="event.id.toString()"
23
- :href="getNewRequestLinkHref(process, event)"
24
- class="btn btn-primary btn-sm"
25
- @click.prevent="newRequestLink(process, event)"
26
- >
27
- <i class="fas fa-caret-square-right mr-1"></i> {{ $t("Start") }}
28
- </button>
29
- </div>
30
- </div>
31
- <div
32
- v-if="showdetail"
33
- :id="getComputedId(process)"
34
- :aria-hidden="ariaHidden"
35
- >
36
- <hr />
37
- <p class="card-text text-muted">{{ process.description }}</p>
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>
38
44
  </div>
39
45
  </div>
40
- </div>
46
+ </template>
41
47
  </div>
42
48
  </template>
43
49
 
@@ -116,7 +122,7 @@ export default {
116
122
  this.spin = 0;
117
123
  const instance = response.data;
118
124
  this.$cookies.set("fromTriggerStartEvent", true, "1min");
119
- window.location = `/requests/${instance.id}?fromRedirect=true`;
125
+ window.location = `/requests/${instance.id}?fromTriggerStartEvent=`;
120
126
  })
121
127
  .catch((err) => {
122
128
  this.disabled = false;
@@ -126,29 +132,85 @@ export default {
126
132
  }
127
133
  });
128
134
  },
129
- showRequestDetails(id) {
135
+ showRequestDetails(process, event) {
130
136
  if (this.showdetail === false) {
131
137
  this.showdetail = true;
132
138
  } else {
133
139
  this.showdetail = false;
134
140
  }
141
+ this.$root.$emit(
142
+ "bv::toggle::collapse",
143
+ this.getComputedId(process, event)
144
+ );
135
145
  },
136
146
  getNewRequestLinkHref(process, event) {
137
147
  const { id } = process;
138
148
  const startEventId = event.id;
139
149
  return `/process_events/${id}?event=${startEventId}`;
140
150
  },
141
- getComputedId(process) {
142
- return `process-${process.id}`;
151
+ getComputedId(process, event) {
152
+ return `process-${process.id}-${event.id}`;
143
153
  }
144
154
  }
145
155
  };
146
156
  </script>
147
157
 
148
158
  <style scoped>
159
+ .btn-custom {
160
+ border-radius: 4px;
161
+ border: 1px solid #eceff3;
162
+ background: #e8f0f9;
163
+ display: flex;
164
+ height: 28px;
165
+ padding: 4px 9px;
166
+ justify-content: center;
167
+ align-items: inherit;
168
+ gap: 6px;
169
+ color: #1572c2;
170
+ font-size: 14px;
171
+ font-weight: 600;
172
+ }
173
+ .btn-ellipsis {
174
+ background: #fff;
175
+ height: 28px;
176
+ justify-content: center;
177
+ align-items: center;
178
+ color: #1572c2;
179
+ font-size: 14px;
180
+ }
181
+ .btn-ellipsis:hover {
182
+ border-radius: 4px;
183
+ background: #e8f0f9;
184
+ }
149
185
  .card-request {
150
- width: 45%;
151
- min-width: 40%;
152
- max-width: 50%;
186
+ display: flex;
187
+ justify-content: space-between;
188
+ align-items: center;
189
+ border-radius: 8px;
190
+ border: 1px solid #cdddee;
191
+ background: #fff;
192
+ }
193
+ .card-info {
194
+ -webkit-line-clamp: 1;
195
+ display: -webkit-box;
196
+ -webkit-box-orient: vertical;
197
+ overflow: hidden;
198
+ }
199
+ .card-description {
200
+ -webkit-line-clamp: 2;
201
+ display: -webkit-box;
202
+ -webkit-box-orient: vertical;
203
+ overflow: hidden;
204
+ }
205
+ .card-title {
206
+ font-weight: 700;
207
+ }
208
+ .card-icon {
209
+ display: flex;
210
+ padding: 2px 1px 0px 0px;
211
+ justify-content: center;
212
+ align-items: center;
213
+ gap: 10px;
214
+ font-size: 7px;
153
215
  }
154
216
  </style>
@@ -321,6 +321,7 @@ export default {
321
321
  .list-table {
322
322
  height: 300px;
323
323
  overflow: auto;
324
+ background-color: #f9f9f9;
324
325
  }
325
326
 
326
327
  .btn-outline-secondary {
@@ -1,25 +1,15 @@
1
1
  <template>
2
2
  <div>
3
3
  <div v-if="Object.keys(processes).length && !loading" class="process-list">
4
- <div
5
- v-for="(category, index) in processes"
6
- :key="`category-${index}`"
7
- class="mt-3"
8
- >
9
- <b-container fluid>
10
- <b-card-group>
11
- <template v-for="(process, id) in category">
12
- <b-col :key="`process-${id}`" cols="6">
13
- <ProcessCard
14
- v-if="hasEmptyStartEvents(process)"
15
- :filter="filter"
16
- :process="process"
17
- />
18
- </b-col>
19
- </template>
20
- </b-card-group>
21
- </b-container>
22
- </div>
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>
23
13
  </div>
24
14
  <div v-else>
25
15
  <formEmpty link="" title="No Request to Start" url="" />
@@ -61,51 +51,18 @@ export default {
61
51
  .get(
62
52
  `start_processes?page=${this.page}&per_page=${this.perPage}&filter=${this.filter}&order_by=category.name,name` +
63
53
  "&order_direction=asc,asc" +
64
- "&include=events,categories" +
54
+ "&include=events" +
65
55
  "&without_event_definitions=true"
66
56
  )
67
57
  .then((response) => {
68
58
  const { data } = response;
69
- // Empty processes
70
- this.processes = {};
71
- // Now populate our processes array with data for rendering
72
- this.populate(data.data);
73
- // Do initial filter
74
- // Set data in paginate
75
- data.meta.from -= 1;
76
- this.$refs.listProcess.data = data;
77
- this.$refs.listProcess.setPaginationData(data.meta);
78
- const dataControls = {
79
- count: "0",
80
- showControl: true,
81
- showAvatar: false,
82
- colorTextStart: "color: #57646F",
83
- url: ""
84
- };
85
- const tasksDropdown = [];
86
- this.$emit("startControl", { dataControls, tasksDropdown });
59
+ this.processes = data.data;
87
60
  })
88
61
  .catch(() => {
89
62
  this.error = true;
90
63
  });
91
64
  });
92
65
  },
93
- populate(data) {
94
- // Each element in data represents an individual process
95
- // We need to pull out the category name, and if it's available in our processes, append it there
96
- // if not, create the category in our processes array and then append it
97
- for (const process of data) {
98
- for (const category of process.categories) {
99
- // Now determine if we have it defined in our processes list
100
- if (typeof this.processes[category.name] === "undefined") {
101
- // Create it
102
- this.processes[category.name] = [];
103
- }
104
- // Now append
105
- this.processes[category.name].push(process);
106
- }
107
- }
108
- },
109
66
  fetchData(value) {
110
67
  this.filter = value;
111
68
  this.fetch();