Skip to content

Commit 50000a3

Browse files
authored
Merge pull request #5775 from ProcessMaker/feature/FOUR-12594
FOUR-12594 Request Columns final order
2 parents b269305 + 9247aae commit 50000a3

File tree

2 files changed

+47
-10
lines changed

2 files changed

+47
-10
lines changed

ProcessMaker/Http/Resources/ProcessRequests.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ public function toArray($request)
2020
if (in_array('participants', $include)) {
2121
$array['participants'] = $this->participants;
2222
}
23+
if (in_array('activeTasks', $include)) {
24+
$array['active_tasks'] = $this->tokens()
25+
->select(['id', 'element_name', 'status', 'user_id'])
26+
->where('status', 'ACTIVE')
27+
->where('element_type', 'task')
28+
->get();
29+
}
2330
if (in_array('user', $include)) {
2431
$array['user'] = new Users($this->user);
2532
}

resources/js/requests/components/RequestsListing.vue

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,37 @@
5151
>
5252
<span v-uni-id="props.rowData.id.toString()">{{ props.rowData.name }}</span>
5353
</template>
54+
<template
55+
slot="active_tasks"
56+
slot-scope="props"
57+
>
58+
<div
59+
v-for="task in props.rowData.active_tasks"
60+
:key="`active_task-${task.id}`"
61+
>
62+
<b-link
63+
class="text-nowrap"
64+
:href="openTask(task)"
65+
>
66+
{{ task.element_name }}
67+
</b-link>
68+
</div>
69+
</template>
5470
<template
5571
slot="participants"
5672
slot-scope="props"
5773
>
58-
<avatar-image
74+
<div
5975
v-for="participant in props.rowData.participants"
60-
:key="participant.id"
61-
size="25"
62-
hide-name="true"
63-
:input-data="participant"
64-
/>
76+
:key="`participant-${participant.id}`"
77+
>
78+
<avatar-image
79+
size="25"
80+
hide-name="true"
81+
:input-data="participant"
82+
/>
83+
{{ participant.fullname }}
84+
</div>
6585
</template>
6686
<template
6787
slot="actions"
@@ -225,9 +245,10 @@ export default {
225245
default: true,
226246
},
227247
{
228-
label: "Status",
229-
field: "status",
230-
sortable: true,
248+
label: "Task Name",
249+
field: "active_tasks",
250+
name: "__slot:active_tasks",
251+
sortable: false,
231252
default: true,
232253
},
233254
{
@@ -236,6 +257,12 @@ export default {
236257
sortable: false,
237258
default: true,
238259
},
260+
{
261+
label: "Status",
262+
field: "status",
263+
sortable: true,
264+
default: true,
265+
},
239266
{
240267
label: "Started",
241268
field: "initiated_at",
@@ -255,6 +282,9 @@ export default {
255282
openRequest(data, index) {
256283
return `/requests/${data.id}`;
257284
},
285+
openTask(task) {
286+
return `/tasks/${task.id}/edit`;
287+
},
258288
formatStatus(status) {
259289
let color = "success",
260290
label = "In Progress";
@@ -339,7 +369,7 @@ export default {
339369
this.page +
340370
"&per_page=" +
341371
this.perPage +
342-
"&include=process,participants,data" +
372+
"&include=process,participants,activeTasks,data" +
343373
"&pmql=" +
344374
encodeURIComponent(pmql) +
345375
"&filter=" +

0 commit comments

Comments
 (0)