fix(edit-wo): resolve dashboard URL via $livewire, not $this

Inside a Filament Action's ->url() closure, \$this can bind to the
Action instance rather than the Livewire page — so \$this->record was
null and the generated URL became /app/work-orders//dashboard, which
routed as record='' and hit our friendly redirect for id 0.

Switch to \$livewire and prefer getRecord() which is always populated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-05 19:46:52 +00:00
parent c33e96caf8
commit 67a87c5a67
@@ -36,7 +36,7 @@ class EditWorkOrder extends EditRecord
->label(__('Vizualizare dashboard')) ->label(__('Vizualizare dashboard'))
->icon('heroicon-m-squares-2x2') ->icon('heroicon-m-squares-2x2')
->color('info') ->color('info')
->url(fn () => url('/app/work-orders/' . $this->record->id . '/dashboard')), ->url(fn ($livewire) => url('/app/work-orders/' . ($livewire->record?->id ?? $livewire->getRecord()?->id) . '/dashboard')),
Actions\Action::make('apply_template') Actions\Action::make('apply_template')
->label(__('Aplică șablon')) ->label(__('Aplică șablon'))
->icon('heroicon-m-clipboard-document-list') ->icon('heroicon-m-clipboard-document-list')