Add the task calendar, holidays, workflow templates and customer removal
Task calendar (/jobs/calendar) replaces per-unit task Kanban columns (K34): a two-week Gantt of tasks per person. Bars move, resize and change person by dragging or through a keyboard dialog. Each task's estimate is booked evenly over working days into task_bookings, and what exceeds the daily maximum (jobs.daily_capacity_hours, 8 h) moves to the next working day. Tasks get planned_from/planned_to on the form. Holidays (/settings/holidays): Finnish public holidays calculated per year, which the admin can take out of use, plus company days off. Also includes the earlier uncommitted work: workflow templates with adding tasks from a template, and removing customers no module refers to. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use App\Modules\Catalog\Application\DTOs\WorkflowStepData;
|
||||
use App\Modules\Catalog\Application\DTOs\WorkflowTemplateData;
|
||||
use App\Modules\Catalog\Application\UseCases\AddWorkflowTemplate;
|
||||
use App\Modules\Catalog\Infrastructure\Persistence\Eloquent\ServiceUnitModel;
|
||||
use App\Modules\Catalog\Infrastructure\Persistence\Eloquent\WorkTypeModel;
|
||||
use App\Modules\Customers\Infrastructure\Persistence\Eloquent\CustomerModel;
|
||||
@@ -229,3 +232,34 @@ it('adds, checks, renames, moves and removes checklist items with the keyboard',
|
||||
->assertScript('document.activeElement.id', 'checklist-new-'.$task->id)
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
});
|
||||
|
||||
it('adds tasks from a workflow template with the keyboard, without accessibility issues', function (string $device, string $colorScheme) {
|
||||
$this->job->update(['status' => 'order']);
|
||||
$workType = WorkTypeModel::query()->where('name', 'videokuvaus')->sole();
|
||||
$templateId = app(AddWorkflowTemplate::class)->execute(new WorkflowTemplateData('Lyhyt video', $workType->id, [
|
||||
new WorkflowStepData('Suunnittelu', null, WorkTypeModel::query()->where('name', 'suunnittelu')->sole()->id),
|
||||
new WorkflowStepData('Kuvaus'),
|
||||
]));
|
||||
|
||||
$visit = visit(route('jobs.tasks.from-template', $this->job->id));
|
||||
$visit = $device === 'mobile' ? $visit->on()->mobile() : $visit->on()->desktop();
|
||||
$visit = $colorScheme === 'dark' ? $visit->inDarkMode() : $visit->inLightMode();
|
||||
|
||||
$visit->assertNoJavaScriptErrors()
|
||||
->assertNoAccessibilityIssues(level: 2)
|
||||
->keys('[value="'.$templateId.'"]', 'Space')
|
||||
->assertSee('Pohjan Lyhyt video tehtävät')
|
||||
->assertNoAccessibilityIssues(level: 2)
|
||||
->type('#row-1-hours', '2,5')
|
||||
->keys('main form button[type="submit"]', 'Enter')
|
||||
->assertSee('Lisättiin 2 tehtävää pohjasta Lyhyt video (videokuvaus).')
|
||||
->assertSee('Suunnittelu')
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
|
||||
expect(TaskModel::query()->where('customer_job_id', $this->job->id)->orderBy('id')->pluck('estimated_hours')->map(fn ($hours) => $hours === null ? null : (float) $hours)->all())->toBe([null, 2.5]);
|
||||
})->with([
|
||||
'desktop, light' => ['desktop', 'light'],
|
||||
'desktop, dark' => ['desktop', 'dark'],
|
||||
'mobile, light' => ['mobile', 'light'],
|
||||
'mobile, dark' => ['mobile', 'dark'],
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user