fix: calendar board — 4 issues fixed

1. New form: Auto (vehicle) field first, client auto-filled via
   updatedNewApptVehicleId() when a vehicle is selected; getAllVehicleOptions()
   returns all vehicles as «plate — make model» for quick lookup

2. Scroll speed: JS intercepts wheel events on .cv-matrix-wrap and
   applies ×0.45 multiplier for horizontal scroll (shift+wheel or
   trackpad horizontal); scroll-behavior:smooth added to CSS

3. Event cards now show all 4 fields: 🔧 Lucrarea (title) +
   👤 Client + 🚗 Auto · plate + 🕐 Ora; each shown only if present

4. Delete bug fixed: replaced onclick=confirm() (races with wire:click)
   with wire:confirm= (Livewire native dialog — Cancel truly cancels)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-11 06:46:46 +00:00
parent f885c04f90
commit 753e81d292
2 changed files with 54 additions and 11 deletions
@@ -527,6 +527,23 @@ class CalendarBoard extends Page
return Vehicle::where('client_id', $clientId)->pluck('plate', 'id')->toArray();
}
public function getAllVehicleOptions(): array
{
return Vehicle::orderBy('plate')
->limit(300)
->get(['id', 'make', 'model', 'plate', 'client_id'])
->mapWithKeys(fn ($v) => [
$v->id => trim($v->plate . ' — ' . $v->make . ' ' . $v->model),
])->toArray();
}
public function updatedNewApptVehicleId($value): void
{
if ($value && $vehicle = Vehicle::find($value)) {
$this->newAppt['client_id'] = $vehicle->client_id;
}
}
private function calcHours(?string $start, ?string $end): float
{
if (! $start || ! $end) return 1.0;