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
@@ -73,7 +73,8 @@ class WorksRelationManager extends RelationManager
return $table
->recordTitleAttribute('name')
->columns([
Tables\Columns\TextColumn::make('name')->label(__('Manoperă'))->wrap(),
Tables\Columns\TextColumn::make('name')->label(__('Manoperă'))->wrap()
->getStateUsing(fn ($record) => $record->labor?->label() ?: $record->name),
Tables\Columns\TextColumn::make('hours')->label(__('Ore'))->numeric(decimalPlaces: 2)->alignRight(),
Tables\Columns\TextColumn::make('price_per_hour')->label(__('Preț/h'))->money('MDL')->alignRight(),
Tables\Columns\TextColumn::make('total')
@@ -117,6 +118,9 @@ class WorksRelationManager extends RelationManager
->actions([
Actions\EditAction::make(),
Actions\DeleteAction::make(),
]);
])
->emptyStateHeading(__('Nicio manoperă efectuată.'))
->emptyStateDescription(__('Adaugă manopere din catalog — piesele implicite se adaugă automat în tab-ul Piese.'))
->emptyStateIcon('heroicon-o-wrench');
}
}