Skip to content

FOUR-12594 Request Columns final order #5775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ProcessMaker/Http/Resources/ProcessRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ public function toArray($request)
if (in_array('participants', $include)) {
$array['participants'] = $this->participants;
}
if (in_array('activeTasks', $include)) {
$array['active_tasks'] = $this->tokens()
->select(['id', 'element_name', 'status', 'user_id'])
->where('status', 'ACTIVE')
->where('element_type', 'task')
->get();
}
if (in_array('user', $include)) {
$array['user'] = new Users($this->user);
}
Expand Down
50 changes: 40 additions & 10 deletions resources/js/requests/components/RequestsListing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,37 @@
>
<span v-uni-id="props.rowData.id.toString()">{{ props.rowData.name }}</span>
</template>
<template
slot="active_tasks"
slot-scope="props"
>
<div
v-for="task in props.rowData.active_tasks"
:key="`active_task-${task.id}`"
>
<b-link
class="text-nowrap"
:href="openTask(task)"
>
{{ task.element_name }}
</b-link>
</div>
</template>
<template
slot="participants"
slot-scope="props"
>
<avatar-image
<div
v-for="participant in props.rowData.participants"
:key="participant.id"
size="25"
hide-name="true"
:input-data="participant"
/>
:key="`participant-${participant.id}`"
>
<avatar-image
size="25"
hide-name="true"
:input-data="participant"
/>
{{ participant.fullname }}
</div>
</template>
<template
slot="actions"
Expand Down Expand Up @@ -225,9 +245,10 @@ export default {
default: true,
},
{
label: "Status",
field: "status",
sortable: true,
label: "Task Name",
field: "active_tasks",
name: "__slot:active_tasks",
sortable: false,
default: true,
},
{
Expand All @@ -236,6 +257,12 @@ export default {
sortable: false,
default: true,
},
{
label: "Status",
field: "status",
sortable: true,
default: true,
},
{
label: "Started",
field: "initiated_at",
Expand All @@ -255,6 +282,9 @@ export default {
openRequest(data, index) {
return `/requests/${data.id}`;
},
openTask(task) {
return `/tasks/${task.id}/edit`;
},
formatStatus(status) {
let color = "success",
label = "In Progress";
Expand Down Expand Up @@ -339,7 +369,7 @@ export default {
this.page +
"&per_page=" +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is removed the "&" in this section?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't removed.
Seems github is highlighting it in red 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very strange

this.perPage +
"&include=process,participants,data" +
"&include=process,participants,activeTasks,data" +
"&pmql=" +
encodeURIComponent(pmql) +
"&filter=" +
Expand Down