|
-
-
+
+
{{ $customer->name }}
{{ __('time.sheet.customer') }}
@@ -254,8 +254,8 @@
wire:change="saveCell({{ $taskId }}, '{{ $day }}', $event.target.value)"
@error($errorKey) aria-invalid="true" aria-describedby="{{ $fieldId }}-error" @enderror
@class([
- 'h-6 w-12 rounded border px-0.5 text-center font-mono text-[11px] tabular-nums focus-visible:outline-2 focus-visible:outline-primary-600 aria-invalid:border-red-700 dark:focus-visible:outline-primary-300 dark:aria-invalid:border-red-300',
- 'border-emerald-600 bg-emerald-50 font-semibold text-emerald-900 dark:border-emerald-500/50 dark:bg-emerald-950/50 dark:text-emerald-100' => $quarters > 0,
+ 'h-7 w-14 rounded border px-0.5 text-center font-mono text-sm font-normal tabular-nums focus-visible:outline-2 focus-visible:outline-primary-600 aria-invalid:border-red-700 dark:focus-visible:outline-primary-300 dark:aria-invalid:border-red-300',
+ 'border-emerald-600 bg-emerald-50 text-emerald-900 dark:border-emerald-500/50 dark:bg-emerald-950/50 dark:text-emerald-100' => $quarters > 0,
'border-slate-400 bg-slate-50 text-slate-700 dark:border-[#5a5e66] dark:bg-[#1b1d20] dark:text-zinc-200' => $quarters === 0,
])
/>
@@ -266,7 +266,7 @@
class="flex h-6 w-6 items-center justify-center rounded border border-slate-400 bg-slate-100 text-xs font-bold text-slate-800 transition select-none hover:bg-emerald-100 focus-visible:outline-2 focus-visible:outline-primary-600 dark:border-[#5a5e66] dark:bg-[#1b1d20] dark:text-zinc-100 dark:hover:bg-emerald-500/25 dark:focus-visible:outline-primary-300"
>+
@else
- {{ WorkedHours::formatClock($quarters) }}
+ {{ WorkedHours::formatClock($quarters) }}
@if ($cell?->approved)
{{ __('time.approval.cell_approved') }}
diff --git a/tests/Browser/JobsAccessibilityTest.php b/tests/Browser/JobsAccessibilityTest.php
index 758e708..593bdfd 100644
--- a/tests/Browser/JobsAccessibilityTest.php
+++ b/tests/Browser/JobsAccessibilityTest.php
@@ -134,6 +134,38 @@ it('has no accessibility issues on the Kanban board and no sideways scrolling on
'mobile, dark' => ['mobile', 'dark'],
]);
+it('shows the columns as a carousel on a phone, moved with the stage buttons', function () {
+ visit(route('jobs.board'))
+ ->on()->mobile()
+ ->assertSee('Vaihe 1/')
+ ->click('Seuraava vaihe')
+ ->wait(1)
+ ->assertSee('Vaihe 2/')
+ ->assertScript('document.querySelector(".kanban-scroll").scrollLeft > 0', true)
+ ->assertScript('document.documentElement.scrollWidth <= window.innerWidth', true)
+ ->assertNoAccessibilityIssues(level: 2);
+});
+
+it('turns the phone carousel towards the edge a card is dragged to', function () {
+ $moveTo = fn (string $edge): string => '(() => { const box = document.querySelector(".kanban-scroll").getBoundingClientRect(); '
+ .'document.dispatchEvent(new PointerEvent("pointermove", { clientX: '.['right' => 'box.right - 5', 'left' => 'box.left + 5', 'centre' => 'box.left + box.width / 2'][$edge].', clientY: box.top + 100 })); return true; })()';
+
+ visit(route('jobs.board'))
+ ->on()->mobile()
+ ->assertSee('Vaihe 1/')
+ ->assertScript('(() => { document.body.classList.add("sorting"); return true; })()', true)
+ ->assertScript($moveTo('right'), true)
+ ->wait(0.6)
+ ->assertScript($moveTo('centre'), true)
+ ->wait(0.6)
+ ->assertSee('Vaihe 2/')
+ ->assertScript($moveTo('left'), true)
+ ->wait(0.6)
+ ->assertScript($moveTo('centre'), true)
+ ->wait(0.6)
+ ->assertSee('Vaihe 1/');
+});
+
it('moves a card to another column with the keyboard through the job editor', function () {
visit(route('jobs.board'))
->assertScript('document.querySelector("#column-quotes").textContent.includes("Messuvideo")', true)
|