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:
@@ -19,6 +19,7 @@ use App\Modules\Shared\Domain\ValueObjects\Money;
|
||||
use Livewire\Attributes\Computed;
|
||||
use Livewire\Attributes\Locked;
|
||||
use Livewire\Attributes\On;
|
||||
use App\Modules\Jobs\Presentation\Livewire\Concerns\DescribesJobHistory;
|
||||
use Livewire\Component;
|
||||
|
||||
/**
|
||||
@@ -26,6 +27,8 @@ use Livewire\Component;
|
||||
*/
|
||||
new class extends Component
|
||||
{
|
||||
use DescribesJobHistory;
|
||||
|
||||
#[Locked]
|
||||
public int $jobId;
|
||||
|
||||
@@ -57,20 +60,6 @@ new class extends Component
|
||||
return app(CustomerJobQueries::class)->findDetails($this->jobId) ?? abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<JobChangeEntry>
|
||||
*/
|
||||
#[Computed]
|
||||
public function changes(): array
|
||||
{
|
||||
$changes = app(CustomerJobQueries::class)->changes($this->jobId);
|
||||
|
||||
// Changes of the quoted amount are shown only to those who may see quotes (spec 5.7).
|
||||
return Gate::allows('money.quotes')
|
||||
? $changes
|
||||
: array_values(array_filter($changes, fn (JobChangeEntry $change): bool => ! in_array($change->field, ['quoted_amount', 'monthly_fee'], true)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<TaskSummary>
|
||||
*/
|
||||
@@ -159,43 +148,6 @@ new class extends Component
|
||||
$this->js("document.getElementById('remove-task-dialog').close(); document.getElementById('tasks-heading').focus()");
|
||||
}
|
||||
|
||||
public function formatDate(?string $date): string
|
||||
{
|
||||
return $date === null ? __('jobs.not_set') : CarbonImmutable::parse($date)->format('j.n.Y');
|
||||
}
|
||||
|
||||
/**
|
||||
* A history value as text: names for ids, labels for enum keys,
|
||||
* Finnish dates.
|
||||
*/
|
||||
public function historyValue(string $field, ?string $value): string
|
||||
{
|
||||
if ($value === null || $value === '') {
|
||||
return __('jobs.not_set');
|
||||
}
|
||||
|
||||
$ids = array_map('intval', explode(',', $value));
|
||||
$named = fn (array $names): string => implode(', ', array_map(
|
||||
fn (int $id): string => $names[$id] ?? __('jobs.history.unknown', ['id' => $id]),
|
||||
$ids,
|
||||
));
|
||||
|
||||
return match ($field) {
|
||||
'starts_on', 'due_on', 'planned_from', 'planned_to' => $this->formatDate($value),
|
||||
'quoted_amount', 'monthly_fee' => Money::fromCents((int) $value)->format(),
|
||||
'kind' => __('jobs.kinds.'.$value),
|
||||
'status' => __('jobs.statuses.'.$value),
|
||||
'priority' => __('jobs.priorities.'.$value),
|
||||
'payment_basis' => __('jobs.payment_bases.'.$value),
|
||||
'customer' => $named(app(CustomerQueries::class)->namesByIds($ids)),
|
||||
'service_units' => $named(app(CatalogQueries::class)->serviceUnitNames($ids)),
|
||||
'responsible_user', 'contact_user', 'biller_user', 'members' => $named(app(UserAccountQueries::class)->namesByIds($ids)),
|
||||
'customer_contact' => app(CustomerQueries::class)->findContact($this->job->customer->id, $ids[0])->name ?? __('jobs.history.unknown', ['id' => $ids[0]]),
|
||||
'billing_unit' => app(CustomerQueries::class)->findBillingUnit($this->job->customer->id, $ids[0])->name ?? __('jobs.history.unknown', ['id' => $ids[0]]),
|
||||
default => $value,
|
||||
};
|
||||
}
|
||||
|
||||
public function render(): mixed
|
||||
{
|
||||
return $this->view()->title($this->job->number.' '.$this->job->name);
|
||||
|
||||
Reference in New Issue
Block a user