board switching

This commit is contained in:
Mark Gregory
2026-06-29 12:42:09 +01:00
parent 689493bbd7
commit 7e6e53463b
2 changed files with 29 additions and 4 deletions
+21
View File
@@ -25,6 +25,18 @@ final class KanbanBoard extends Component
public function mount(): void
{
$requestedBoardId = request()->query('board_id');
if (is_numeric($requestedBoardId)) {
$requestedBoardId = (int) $requestedBoardId;
if (KanbanBoardModel::query()->whereKey($requestedBoardId)->exists()) {
$this->board_id = $requestedBoardId;
return;
}
}
$this->board_id = KanbanBoardModel::query()
->where('is_default', true)
->orderBy('sort_order')
@@ -139,6 +151,15 @@ final class KanbanBoard extends Component
$this->refreshBoard();
}
/**
* Switch the visible board without relying on DOM morph side effects.
*/
public function selectBoard(int|string|null $value): void
{
$this->board_id = is_numeric($value) ? (int) $value : null;
$this->refreshBoard();
}
/**
* Render the Kanban board.
*/