Skip to content

Commit 9984273

Browse files
committed
Add status, priority and severity ID's to ticket listing data
1 parent fc4dee5 commit 9984273

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/Traq/Queries/TicketFilterQuery.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public function query(bool $withLimit = false): string
104104
v.slug AS version_slug,
105105
c.name AS component,
106106
s.name AS `status`,
107+
t.status_id,
107108
p.name AS priority,
108109
t.priority_id,
109110
sv.name AS severity,

src/Traq/ViewModels/TicketView.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class TicketView
5252
protected ?string $version_slug;
5353
protected ?string $component;
5454
protected string $status;
55+
protected int $status_id;
5556
protected string $priority;
5657
protected int $priority_id;
5758
protected string $severity;
@@ -186,12 +187,15 @@ public function toArray(): array
186187
'name' => $this->component,
187188
] : null,
188189
'status' => [
190+
'id' => $this->status_id,
189191
'name' => $this->status,
190192
],
191193
'priority' => [
194+
'id' => $this->priority_id,
192195
'name' => $this->priority,
193196
],
194197
'severity' => [
198+
'id' => $this->severity_id,
195199
'name' => $this->severity,
196200
],
197201
'project' => [

src/views/default/tickets/index.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
<i class="fa-solid fa-chevron-down text-gray-400" x-show="!open"></i>
144144
<i class="fa-solid fa-chevron-up text-gray-400" x-show="open"></i>
145145
</button>
146-
<div x-show="open" class="dropdown" @click.outside="open = false" x-ref="dropdownMenu">
146+
<div x-show="open" class="dropdown" @click.outside="open = false" x-ref="dropdownMenu" x-transition>
147147
<ul>
148148
<li>
149149
<label>
@@ -272,7 +272,7 @@
272272
</thead>
273273
<tbody>
274274
<template x-for="ticket in tickets" :key="ticket.ticket_id">
275-
<tr :class="`priority-${ticket.priority_id}`">
275+
<tr :class="`priority-${ticket.priority.id}`">
276276
<template x-if="enableMassActions">
277277
<td>
278278
<input

0 commit comments

Comments
 (0)