ui updates for ticket layout now with multipel attachments
This commit is contained in:
@@ -8,6 +8,7 @@ use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Livewire\Attributes\On;
|
||||
use Livewire\Component;
|
||||
use Modules\Helpdesk\Models\KanbanBoard as KanbanBoardModel;
|
||||
use Modules\Helpdesk\Models\Status;
|
||||
@@ -55,12 +56,13 @@ final class KanbanBoard extends Component
|
||||
Auth::user()
|
||||
);
|
||||
|
||||
$this->board_id = $board?->id;
|
||||
$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->dispatch('helpdesk-kanban-ticket-moved', ticketId: (int) $ticket->id, statusId: (int) $status->id);
|
||||
$this->dispatch('helpdesk-kanban-refresh');
|
||||
$this->dispatch('helpdesk-kanban-ticket-moved', ticketId: $ticket->id, statusId: $status->id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,10 +97,13 @@ 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->dispatch('helpdesk-kanban-ticket-moved', ticketId: (int) $fresh->id, statusId: (int) $fresh->status_id);
|
||||
$this->dispatch('helpdesk-kanban-refresh');
|
||||
$this->dispatch('helpdesk-kanban-ticket-moved', ticketId: $fresh->id, boardId: $board->id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,6 +114,17 @@ final class KanbanBoard extends Component
|
||||
$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.
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the Kanban board.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user