feat(pdf): preview in Filament modal (iframe) instead of new tab
All "Vizualizare PDF" actions now open a wide (7xl) Filament modal containing an iframe pointing at the inline PDF endpoint, with a top-right "Descarcă" and "Deschide în tab nou" fallback. - WorkOrder edit action + WO table row action - InjectorProtocol edit action + protocols table row action - Dashboard Docs tab preview button (Alpine.js overlay since it's a plain Blade view, not a Filament action) The underlying /pdf routes stay unchanged (Content-Disposition: inline, ?download=1 for attachment) — the iframe just loads the same URL. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -188,8 +188,14 @@ class WorkOrderResource extends Resource
|
||||
->label(__('PDF'))
|
||||
->icon('heroicon-m-document-magnifying-glass')
|
||||
->color('gray')
|
||||
->url(fn (WorkOrder $r) => url('/app/work-orders/' . $r->id . '/pdf'))
|
||||
->openUrlInNewTab(),
|
||||
->modalHeading(fn (WorkOrder $r) => __('Factură') . ' — WO #' . $r->number)
|
||||
->modalSubmitAction(false)
|
||||
->modalCancelActionLabel(__('Închide'))
|
||||
->modalWidth('7xl')
|
||||
->modalContent(fn (WorkOrder $r) => view('filament.tenant.pdf-preview', [
|
||||
'pdfUrl' => url('/app/work-orders/' . $r->id . '/pdf'),
|
||||
'downloadUrl' => url('/app/work-orders/' . $r->id . '/pdf?download=1'),
|
||||
])),
|
||||
Actions\EditAction::make(),
|
||||
Actions\DeleteAction::make(),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user