ui updates for ticket layout now with multipel attachments
This commit is contained in:
@@ -19,6 +19,8 @@ final class KanbanBoard extends Component
|
||||
{
|
||||
public ?int $board_id = null;
|
||||
|
||||
public int $refreshNonce = 0;
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->board_id = KanbanBoardModel::query()
|
||||
@@ -56,13 +58,12 @@ final class KanbanBoard extends Component
|
||||
Auth::user()
|
||||
);
|
||||
|
||||
$this->skipRender();
|
||||
|
||||
$message = 'Ticket '.$ticket->reference.' moved from '.$oldStatusName.' to '.$status->name.'.';
|
||||
session()->flash('success', $message);
|
||||
$this->dispatch('wms:toast', type: 'success', title: 'Ticket moved', message: $message);
|
||||
|
||||
$this->refreshBoard();
|
||||
$this->dispatch('helpdesk-kanban-refresh');
|
||||
$this->dispatch('helpdesk-kanban-ticket-moved', ticketId: $ticket->id, statusId: $status->id);
|
||||
$this->dispatch('wms:toast', type: 'success', title: 'Ticket moved', message: $message);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,13 +98,21 @@ final class KanbanBoard extends Component
|
||||
$fresh = $ticket->fresh(['status', 'priority', 'category', 'project', 'team', 'board']) ?? $ticket;
|
||||
$workflow->dispatch($fresh, 'ticket.updated', Auth::user());
|
||||
|
||||
$this->skipRender();
|
||||
|
||||
$message = 'Ticket '.$fresh->reference.' moved from '.$oldBoardName.' to '.$board->name.'.';
|
||||
session()->flash('success', $message);
|
||||
$this->dispatch('wms:toast', type: 'success', title: 'Board changed', message: $message);
|
||||
|
||||
$this->refreshBoard();
|
||||
$this->dispatch('helpdesk-kanban-refresh');
|
||||
$this->dispatch('helpdesk-kanban-ticket-moved', ticketId: $fresh->id, boardId: $board->id);
|
||||
$this->dispatch('wms:toast', type: 'success', title: 'Board changed', message: $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Force the board to fetch fresh database rows after moves or polling.
|
||||
*/
|
||||
#[On('helpdesk-kanban-refresh')]
|
||||
public function refreshBoard(): void
|
||||
{
|
||||
$this->refreshNonce++;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,17 +121,7 @@ final class KanbanBoard extends Component
|
||||
public function updatedBoardId(int|string|null $value): void
|
||||
{
|
||||
$this->board_id = is_numeric($value) ? (int) $value : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the board after a drag/drop move, board change or external ticket update.
|
||||
*/
|
||||
#[On('helpdesk-kanban-refresh')]
|
||||
#[On('ticket-updated')]
|
||||
#[On('ticket-moved')]
|
||||
public function refreshBoard(): void
|
||||
{
|
||||
// Livewire will re-run render(), which reloads all board columns from the database.
|
||||
$this->refreshBoard();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,6 +154,7 @@ final class KanbanBoard extends Component
|
||||
'board' => $board,
|
||||
'statuses' => $board?->statuses ?? collect(),
|
||||
'ticketsByStatus' => $this->ticketsByStatus($board),
|
||||
'refreshNonce' => $this->refreshNonce,
|
||||
])->layout('layouts.app');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user