|
3 | 3 | namespace App\Livewire\Tickets; |
4 | 4 |
|
5 | 5 | use App\Domains\Client\Models\Client; |
| 6 | +use App\Domains\Core\Models\User; |
6 | 7 | use App\Domains\Ticket\Models\Ticket; |
7 | 8 | use App\Livewire\BaseIndexComponent; |
8 | | -use App\Domains\Core\Models\User; |
9 | 9 | use Illuminate\Support\Facades\Auth; |
10 | 10 |
|
11 | 11 | class TicketIndex extends BaseIndexComponent |
@@ -46,7 +46,7 @@ public function mount() |
46 | 46 | } |
47 | 47 |
|
48 | 48 | if (! $this->filter) { |
49 | | - $this->selectedStatuses = $this->selectedStatuses ?: ['open', 'in_progress', 'waiting', 'on_hold']; |
| 49 | + $this->selectedStatuses = $this->selectedStatuses ?: Ticket::ACTIVE_STATUSES; |
50 | 50 | $this->selectedPriorities = $this->selectedPriorities ?: []; |
51 | 51 | $this->selectedAssignees = $this->selectedAssignees ?: []; |
52 | 52 | $this->selectedClients = $this->selectedClients ?: []; |
@@ -285,16 +285,11 @@ public function render() |
285 | 285 | ->orderBy('name') |
286 | 286 | ->get(); |
287 | 287 |
|
288 | | - // All available statuses |
289 | | - $statuses = ['open', 'in_progress', 'waiting', 'on_hold', 'resolved', 'closed', 'cancelled']; |
| 288 | + // All available statuses from model constants |
| 289 | + $statuses = Ticket::ALL_STATUSES; |
290 | 290 |
|
291 | 291 | // Use model constants for priorities |
292 | | - $priorities = [ |
293 | | - Ticket::PRIORITY_LOW, |
294 | | - Ticket::PRIORITY_MEDIUM, |
295 | | - Ticket::PRIORITY_HIGH, |
296 | | - Ticket::PRIORITY_CRITICAL, |
297 | | - ]; |
| 292 | + $priorities = Ticket::ALL_PRIORITIES; |
298 | 293 |
|
299 | 294 | return view('livewire.tickets.ticket-index', [ |
300 | 295 | 'tickets' => $tickets, |
@@ -339,7 +334,7 @@ public function clearFilters() |
339 | 334 | public function showAllTickets() |
340 | 335 | { |
341 | 336 | // Select all statuses to show all tickets |
342 | | - $this->selectedStatuses = ['open', 'in_progress', 'waiting', 'on_hold', 'resolved', 'closed', 'cancelled']; |
| 337 | + $this->selectedStatuses = Ticket::ALL_STATUSES; |
343 | 338 | $this->resetPage(); |
344 | 339 | } |
345 | 340 | } |
0 commit comments