Add quick job intake for phones
Phase 1, item 5: - New page /jobs/quick (Pikavastaanotto): customer (search or quick add), name, short description, service unit, responsible person and starting status (Alustava or Prospekti) in one column. The job is created with CreateCustomerJob, so numbering, reference checks and history are the same as on the full form. - After saving, the form clears for the next job (responsible person and status stay), and a status message with the job number and links to the job and its edit page takes focus. - The customer search of the job form moves to a PicksCustomer trait and an <x-jobs.customer-picker> component shared by both pages. - Menu link and a list button for users who may open jobs; nav items accept several route patterns. - PHPStan ignores unused-trait only for Livewire Concerns, which are used from excluded single-file components. - Spec and CLAUDE.md updated. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use App\Modules\Catalog\Infrastructure\Persistence\Eloquent\ServiceUnitModel;
|
||||
use App\Modules\Customers\Infrastructure\Persistence\Eloquent\CustomerModel;
|
||||
use App\Modules\Jobs\Infrastructure\Persistence\Eloquent\CustomerJobModel;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
@@ -69,3 +70,37 @@ it('finds and picks a customer, and adds and removes a tag, with the keyboard',
|
||||
->assertScript('document.activeElement.id', 'new-tag')
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
});
|
||||
|
||||
it('has no accessibility issues on the quick intake, also with errors', function (string $device, string $colorScheme) {
|
||||
$visit = visit(route('jobs.quick'));
|
||||
$visit = $device === 'mobile' ? $visit->on()->mobile() : $visit->on()->desktop();
|
||||
$visit = $colorScheme === 'dark' ? $visit->inDarkMode() : $visit->inLightMode();
|
||||
|
||||
$visit->assertNoJavaScriptErrors()
|
||||
->assertNoAccessibilityIssues(level: 2)
|
||||
->press('Tallenna työ')
|
||||
->assertSee('Valitse palveluyksikkö.')
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
})->with([
|
||||
'desktop, light' => ['desktop', 'light'],
|
||||
'desktop, dark' => ['desktop', 'dark'],
|
||||
'mobile, light' => ['mobile', 'light'],
|
||||
'mobile, dark' => ['mobile', 'dark'],
|
||||
]);
|
||||
|
||||
it('takes in a job on a phone with the keyboard alone', function () {
|
||||
$unit = ServiceUnitModel::query()->where('name', 'Markkinointi')->sole();
|
||||
|
||||
visit(route('jobs.quick'))
|
||||
->on()->mobile()
|
||||
->type('#customer-search', 'Mainos')
|
||||
->assertSee('1 osuma.')
|
||||
->keys('[aria-label="Valitse Mainos Oy"]', 'Enter')
|
||||
->assertScript('document.activeElement.id', 'change-customer')
|
||||
->type('[wire\:model="form.name"]', 'Kevätkampanja')
|
||||
->select('[wire\:model="form.service_unit_id"]', (string) $unit->id)
|
||||
->keys('[wire\:model="form.name"]', 'Enter')
|
||||
->assertSee('Kevätkampanja luotu.')
|
||||
->assertScript('document.activeElement.id', 'quick-created')
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user