Rebuild the Kanban board after the prototype, with the job editor and quick intake dialog
- Toolbar: whose board (own, a person, a service line, all), pipeline views (daily, sales, full), urgent and late filters with a live count, normal and compact density, and the quick intake button. - Columns side by side with horizontal scrolling on desktop, stacked on phones; each user's own column colours and order, the urgent column's threshold menu, and the continuing jobs column. - Cards in customer colours: job cards with their tasks checked off inside the card (the status select is gone), continuing job cards with the next period, PIN and quick add, and pinned task cards. Dragging moves and orders cards; the keyboard opens the job editor from the card title. - Job editor dialog: every job detail, tasks with checklists and templates, quick hours (TimeTracking) and expenses (Expenses), history. - The quick intake form also adds a contact person, initial status and priority, and opens as a dialog on the board. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -14,8 +14,9 @@ use Illuminate\Validation\Rule;
|
||||
use Livewire\Form;
|
||||
|
||||
/**
|
||||
* Quick job intake on a phone: only what is needed to open a job (spec 6).
|
||||
* Everything else gets the defaults and is filled in later.
|
||||
* Quick job intake on a phone and in the board's dialog: only what is
|
||||
* needed to open a job (docs/ui-kanban-board.md 6). Everything else gets
|
||||
* the defaults and is filled in later.
|
||||
*/
|
||||
class QuickJobForm extends Form
|
||||
{
|
||||
@@ -31,6 +32,27 @@ class QuickJobForm extends Form
|
||||
|
||||
public string $status = JobStatus::Tentative->value;
|
||||
|
||||
public string $priority = Priority::Normal->value;
|
||||
|
||||
public string $customer_contact_id = '';
|
||||
|
||||
/** The intake has a new contact person of the customer to add. */
|
||||
public bool $adding_contact = false;
|
||||
|
||||
public string $new_contact_name = '';
|
||||
|
||||
public string $new_contact_phone = '';
|
||||
|
||||
/**
|
||||
* The statuses a job can start in at intake.
|
||||
*
|
||||
* @return list<JobStatus>
|
||||
*/
|
||||
public static function startStatuses(): array
|
||||
{
|
||||
return [JobStatus::Prospect, JobStatus::Tentative, JobStatus::QuoteRequest, JobStatus::Order, JobStatus::InProduction];
|
||||
}
|
||||
|
||||
public function toData(): CustomerJobData
|
||||
{
|
||||
$this->validate();
|
||||
@@ -42,8 +64,9 @@ class QuickJobForm extends Form
|
||||
responsibleUserId: (int) $this->responsible_user_id,
|
||||
kind: JobKind::OneOff->value,
|
||||
status: $this->status,
|
||||
priority: Priority::Normal->value,
|
||||
priority: $this->priority,
|
||||
description: trim($this->description) === '' ? null : $this->description,
|
||||
customerContactId: $this->customer_contact_id === '' ? null : (int) $this->customer_contact_id,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -52,7 +75,7 @@ class QuickJobForm extends Form
|
||||
*/
|
||||
public function clearForNextJob(): void
|
||||
{
|
||||
$this->reset('customer_id', 'name', 'description', 'service_unit_id');
|
||||
$this->reset('customer_id', 'name', 'description', 'service_unit_id', 'priority', 'customer_contact_id', 'adding_contact', 'new_contact_name', 'new_contact_phone');
|
||||
$this->resetErrorBag();
|
||||
}
|
||||
|
||||
@@ -83,7 +106,11 @@ class QuickJobForm extends Form
|
||||
'description' => ['nullable', 'string', 'max:2000'],
|
||||
'service_unit_id' => ['required', 'integer'],
|
||||
'responsible_user_id' => ['required', 'integer'],
|
||||
'status' => ['required', Rule::in([JobStatus::Tentative->value, JobStatus::Prospect->value])],
|
||||
'status' => ['required', Rule::in(array_map(fn (JobStatus $status): string => $status->value, self::startStatuses()))],
|
||||
'priority' => ['required', Rule::enum(Priority::class)],
|
||||
'customer_contact_id' => ['nullable', 'integer'],
|
||||
'new_contact_name' => [$this->adding_contact ? 'required' : 'nullable', 'string', 'max:255'],
|
||||
'new_contact_phone' => ['nullable', 'string', 'max:50'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -100,6 +127,10 @@ class QuickJobForm extends Form
|
||||
'service_unit_id.required' => __('jobs.quick.service_unit_required'),
|
||||
'responsible_user_id.required' => __('jobs.errors.responsible_required'),
|
||||
'status.in' => __('jobs.errors.status_not_allowed'),
|
||||
'priority.*' => __('jobs.errors.status_not_allowed'),
|
||||
'new_contact_name.required' => __('jobs.quick.contact_name_required'),
|
||||
'new_contact_name.max' => __('jobs.errors.too_long', ['max' => 255]),
|
||||
'new_contact_phone.max' => __('jobs.errors.too_long', ['max' => 50]),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user