feat(work-orders): dashboard becomes single hub — list/create/edit funnel through it

- WO list row click now opens /work-orders/{id}/dashboard instead of
  /edit (via ->recordUrl on the table). Edit remains reachable from
  the per-row Filament EditAction.
- CreateWorkOrder redirects to the dashboard after save instead of
  the edit page.
- Dashboard top bar exposes: "Listă" (back to WO list), "+ Nou"
  (create), and "Editare completă" (full edit form) so users don't
  have to hop through the sidebar to move between related WO screens.

The old /work-orders, /create, and /{id}/edit routes stay intact —
just the default navigation flow now converges on the dashboard.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-10 19:20:36 +00:00
parent 517d32c4d4
commit 1b8ccb116f
5 changed files with 21 additions and 2 deletions
@@ -183,6 +183,8 @@ class WorkOrderResource extends Resource
->label(__('Maistru'))
->options(fn () => User::pluck('name', 'id')),
])
// Row click opens the dashboard (single hub) instead of the raw edit form.
->recordUrl(fn (WorkOrder $r) => url('/app/work-orders/' . $r->id . '/dashboard'))
->actions([
Actions\Action::make('pdf')
->label(__('PDF'))
@@ -17,4 +17,10 @@ class CreateWorkOrder extends CreateRecord
$data['number'] = WorkOrder::generateNumber($companyId);
return $data;
}
/** After create, land on the dashboard (single hub) instead of the raw edit. */
protected function getRedirectUrl(): string
{
return url('/app/work-orders/' . $this->record->id . '/dashboard');
}
}
+3
View File
@@ -747,6 +747,7 @@
"Echipament defect": "Broken equipment",
"Edit": "Edit",
"Editare": "Edit",
"Editare completă": "Full edit",
"Editează": "Edit",
"Editează client": "Edit client",
"Editează cod echivalent": "Edit equivalent code",
@@ -871,6 +872,7 @@
"Fișă de lucru": "Work order",
"Fișă lucru": "Work order",
"Fișă lucru (opțional)": "Work order (opt.)",
"Fișă nouă": "New work order",
"Fișă închisă": "Order closed",
"Folie PPF": "PPF film",
"Folosește AI Assistant": "Use AI Assistant",
@@ -2037,6 +2039,7 @@
"Toate comenzile": "All orders",
"Toate companiile": "All companies",
"Toate câmpurile": "All fields",
"Toate fișele": "All work orders",
"Toate limbile": "All languages",
"Toate ok": "All OK",
"Toate piesele sunt în stoc.": "All parts in stock.",
+3
View File
@@ -747,6 +747,7 @@
"Echipament defect": "Неисправное оборудование",
"Edit": "Изменить",
"Editare": "Изменить",
"Editare completă": "Полное редактирование",
"Editează": "Изменить",
"Editează client": "Изменить клиента",
"Editează cod echivalent": "Изменить эквивалентный код",
@@ -871,6 +872,7 @@
"Fișă de lucru": "Заказ-наряд",
"Fișă lucru": "Заказ-наряд",
"Fișă lucru (opțional)": "Заказ-наряд (опц.)",
"Fișă nouă": "Новый заказ-наряд",
"Fișă închisă": "Наряд закрыт",
"Folie PPF": "Плёнка PPF",
"Folosește AI Assistant": "Использовать AI Assistant",
@@ -2037,6 +2039,7 @@
"Toate comenzile": "Все заказы",
"Toate companiile": "Все компании",
"Toate câmpurile": "Все поля",
"Toate fișele": "Все заказ-наряды",
"Toate limbile": "Все языки",
"Toate ok": "Всё в порядке",
"Toate piesele sunt în stoc.": "Все запчасти в наличии.",
@@ -385,15 +385,20 @@
<span style="opacity:.6;"></span>
</span>
<div class="wd-topbar-actions">
<a class="wd-btn" href="{{ url('/app/work-orders') }}" title="{{ __('Toate fișele') }}">
{{ __('Listă') }}
</a>
<a class="wd-btn wd-btn-primary" href="{{ url('/app/work-orders/create') }}" title="{{ __('Fișă nouă') }}">
+ {{ __('Nou') }}
</a>
<a class="wd-btn" href="{{ route('filament.tenant.resources.work-orders.edit', ['record' => $wo->id]) }}">
{{ __('Editează') }}
{{ __('Editare completă') }}
</a>
@if ($wo->tracking_token)
<a class="wd-btn" target="_blank" href="{{ $wo->trackingUrl() }}">
🔗 {{ __('Link tracking') }}
</a>
@endif
<button type="button" class="wd-btn wd-btn-primary">{{ __('Salvează') }}</button>
</div>
</div>