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:
+12
-6
@@ -49,17 +49,23 @@ class PaymentsRelationManager extends RelationManager
|
||||
Tables\Columns\TextColumn::make('reference')->placeholder('—'),
|
||||
])
|
||||
->headerActions([
|
||||
Actions\CreateAction::make()->mutateFormDataUsing(function (array $data, RelationManager $livewire): array {
|
||||
$wo = $livewire->getOwnerRecord();
|
||||
$data['client_id'] = $wo->client_id;
|
||||
$data['user_id'] = auth()->id();
|
||||
return $data;
|
||||
}),
|
||||
Actions\CreateAction::make()
|
||||
->label(__('Adaugă plată'))
|
||||
->modalHeading(__('Adaugă plată la fișă'))
|
||||
->mutateFormDataUsing(function (array $data, RelationManager $livewire): array {
|
||||
$wo = $livewire->getOwnerRecord();
|
||||
$data['client_id'] = $wo->client_id;
|
||||
$data['user_id'] = auth()->id();
|
||||
return $data;
|
||||
}),
|
||||
])
|
||||
->actions([
|
||||
Actions\EditAction::make(),
|
||||
Actions\DeleteAction::make(),
|
||||
])
|
||||
->emptyStateHeading(__('Nicio plată'))
|
||||
->emptyStateDescription(__('Adaugă plățile parțiale sau totale primite pentru această fișă. Statusul plății se actualizează automat.'))
|
||||
->emptyStateIcon('heroicon-o-banknotes')
|
||||
->defaultSort('paid_at', 'desc');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user