Files
autocrm/app/Filament/Tenant/Resources/PartResource/RelationManagers/CrossRefsRelationManager.php
T
Vasyka e680b2e63c i18n(parts-edit): override CreateAction, +19 translations for tabs/columns/empty
- CrossRefsRelationManager: explicit CreateAction/EditAction labels &
  modal headings (was auto-generated as 'Create Part Cross Ref')
- +19 translations for PartResource sections (Prețuri, Furnizor
  preferat), photo gallery helper, relation-tab titles (Loturi FIFO,
  Coduri cross), Batches columns (Intrat/Rămas/Preț unit.), CrossRefs
  column (Cod echivalent), all empty-state headings/descriptions on
  the 3 relation managers, Val. abbreviation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-07-16 11:10:09 +00:00

52 lines
1.8 KiB
PHP

<?php
namespace App\Filament\Tenant\Resources\PartResource\RelationManagers;
use Filament\Actions;
use Filament\Forms;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Schemas\Schema;
use Filament\Tables;
use Filament\Tables\Table;
class CrossRefsRelationManager extends RelationManager
{
protected static string $relationship = 'crossRefs';
protected static ?string $title = null;
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __('Coduri cross (OEM/echivalente)');
}
public function form(Schema $schema): Schema
{
return $schema->components([
Forms\Components\TextInput::make('cross_article')->label(__('Cod echivalent'))->required()->maxLength(64),
Forms\Components\TextInput::make('brand')->label(__('Brand'))->maxLength(64),
]);
}
public function table(Table $table): Table
{
return $table
->recordTitleAttribute('cross_article')
->columns([
Tables\Columns\TextColumn::make('cross_article')->label(__('Cod'))->searchable(),
Tables\Columns\TextColumn::make('brand')->placeholder('—'),
])
->headerActions([
Actions\CreateAction::make()
->label(__('Adaugă cod cross'))
->modalHeading(__('Adaugă cod echivalent')),
])
->actions([
Actions\EditAction::make()->modalHeading(__('Editează cod echivalent')),
Actions\DeleteAction::make(),
])
->emptyStateHeading(__('Niciun cod cross'))
->emptyStateDescription(__('Adaugă coduri echivalente OEM/aftermarket ca să fie găsite în căutarea din magazin.'));
}
}