i18n(wo relations): translated snapshot names + explicit empty states

- WorksRelationManager Name column: getStateUsing(labor?->label()) so
  the row shows the labor's localized name (not the raw snapshot);
  fallback to stored snapshot when labor is missing.
- 4 explicit empty states with helper description + icon on Works,
  Parts, SubcontractJobs, Payments — replaces Filament's auto-generated
  'Не найдено X / Создать X для старта.'
- 4 CreateAction titles / modal headings for all four relation managers.
- Notification 'Piesa returnată în stoc' / 'Nimic de restituit' wrapped.
- +11 translation keys.

All 306 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-26 10:59:47 +00:00
parent 9609295a9e
commit de2964c854
6 changed files with 57 additions and 13 deletions
@@ -87,7 +87,9 @@ class PartsRelationManager extends RelationManager
]),
])
->headerActions([
Actions\CreateAction::make(),
Actions\CreateAction::make()
->label(__('Adaugă piesă'))
->modalHeading(__('Adaugă piesă în fișă')),
])
->actions([
Actions\Action::make('smart_price')
@@ -154,12 +156,15 @@ class PartsRelationManager extends RelationManager
$r, (float) $data['qty'], $data['notes'] ?? null
);
Notification::make()
->title($batch ? 'Piesa returnată în stoc' : 'Nimic de restituit')
->title($batch ? __('Piesa returnată în stoc') : __('Nimic de restituit'))
->{$batch ? 'success' : 'warning'}()
->send();
}),
Actions\EditAction::make(),
Actions\DeleteAction::make(),
]);
])
->emptyStateHeading(__('Nicio piesă montată.'))
->emptyStateDescription(__('Adaugă piesele necesare din catalog. Stocul se rezervă automat, iar la marcarea „Montată" scade FIFO.'))
->emptyStateIcon('heroicon-o-cube');
}
}