Add customer job Kanban board

Phase 1, item 6:
- New page /jobs/board: one column per Kanban status (archived left
  out), one card per job with number, name, customer, priority and due
  date. Filters for my jobs (default), priority and service unit;
  subcontractors see only their own cards and cannot move them.
- Cards move by dragging (Livewire wire:sort across column groups) or
  with each card's status select, which works with the keyboard. Moves
  go through ChangeJobStatus, so they are recorded in the job history;
  the result is announced and focus returns to the moved card.
- Billing statuses only for management and the job's biller: the
  jobs.set-billing-status gate now takes the biller's user id.
- Column links with counts at the top; columns wrap with the screen
  width, so there is no sideways scrolling.
- CustomerJobQueries::board() and the biller on job summaries.
- Menu link and a link from the job list; spec and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-23 19:15:54 +02:00
co-authored by Claude Opus 5.5
parent b3d8e66477
commit 7f3b6dff78
15 changed files with 484 additions and 11 deletions
+41
View File
@@ -104,3 +104,44 @@ it('takes in a job on a phone with the keyboard alone', function () {
->assertScript('document.activeElement.id', 'quick-created')
->assertNoAccessibilityIssues(level: 2);
});
it('has no accessibility issues on the Kanban board and no sideways scrolling on a phone', function (string $device, string $colorScheme) {
CustomerJobModel::factory()->create(['name' => 'Tilattu työ', 'status' => 'order', 'responsible_user_id' => $this->user->id, 'customer_id' => $this->customer->id]);
$visit = visit(route('jobs.board'));
$visit = $device === 'mobile' ? $visit->on()->mobile() : $visit->on()->desktop();
$visit = $colorScheme === 'dark' ? $visit->inDarkMode() : $visit->inLightMode();
$visit->assertSee('Tilattu työ')
->assertScript('document.documentElement.scrollWidth <= window.innerWidth', true)
->assertNoJavaScriptErrors()
->assertNoAccessibilityIssues(level: 2);
})->with([
'desktop, light' => ['desktop', 'light'],
'desktop, dark' => ['desktop', 'dark'],
'mobile, light' => ['mobile', 'light'],
'mobile, dark' => ['mobile', 'dark'],
]);
it('moves a card to another column with the keyboard', function () {
$select = '#job-status-'.$this->job->id;
visit(route('jobs.board'))
->assertScript('document.querySelector("#column-tentative").textContent.includes("Messuvideo")', true)
->select($select, 'order')
->assertSee('Työ '.$this->job->number.' Messuvideo siirretty tilaan Tilaus.')
->assertScript('document.querySelector("#column-order").textContent.includes("Messuvideo")', true)
->assertScript('document.activeElement.id', 'job-status-'.$this->job->id)
->assertNoAccessibilityIssues(level: 2);
expect($this->job->fresh()->status->value)->toBe('order');
});
it('moves a card by dragging it to another column', function () {
visit(route('jobs.board'))
->on()->desktop()
->drag('[wire\:sort\:item="'.$this->job->id.'"]', '#column-order ul')
->assertSee('siirretty tilaan Tilaus.');
expect($this->job->fresh()->status->value)->toBe('order');
});