From 1b8ccb116f502084e765700d675cdc5a6c0b0779 Mon Sep 17 00:00:00 2001 From: Vasyka Date: Mon, 10 Aug 2026 19:20:36 +0000 Subject: [PATCH] =?UTF-8?q?feat(work-orders):=20dashboard=20becomes=20sing?= =?UTF-8?q?le=20hub=20=E2=80=94=20list/create/edit=20funnel=20through=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- app/Filament/Tenant/Resources/WorkOrderResource.php | 2 ++ .../WorkOrderResource/Pages/CreateWorkOrder.php | 6 ++++++ lang/en.json | 3 +++ lang/ru.json | 3 +++ .../filament/tenant/pages/work-order-dashboard.blade.php | 9 +++++++-- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/Filament/Tenant/Resources/WorkOrderResource.php b/app/Filament/Tenant/Resources/WorkOrderResource.php index 5e87498..a57c29b 100644 --- a/app/Filament/Tenant/Resources/WorkOrderResource.php +++ b/app/Filament/Tenant/Resources/WorkOrderResource.php @@ -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')) diff --git a/app/Filament/Tenant/Resources/WorkOrderResource/Pages/CreateWorkOrder.php b/app/Filament/Tenant/Resources/WorkOrderResource/Pages/CreateWorkOrder.php index 7074392..d0fe166 100644 --- a/app/Filament/Tenant/Resources/WorkOrderResource/Pages/CreateWorkOrder.php +++ b/app/Filament/Tenant/Resources/WorkOrderResource/Pages/CreateWorkOrder.php @@ -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'); + } } diff --git a/lang/en.json b/lang/en.json index fdbab38..6f50852 100644 --- a/lang/en.json +++ b/lang/en.json @@ -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.", diff --git a/lang/ru.json b/lang/ru.json index 76271ab..779f91c 100644 --- a/lang/ru.json +++ b/lang/ru.json @@ -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.": "Все запчасти в наличии.", diff --git a/resources/views/filament/tenant/pages/work-order-dashboard.blade.php b/resources/views/filament/tenant/pages/work-order-dashboard.blade.php index d152fbd..48b480a 100644 --- a/resources/views/filament/tenant/pages/work-order-dashboard.blade.php +++ b/resources/views/filament/tenant/pages/work-order-dashboard.blade.php @@ -385,15 +385,20 @@