Added a custom render function for the 'manufacturing_status' column to handle null values and translate the status using the translator service.

This commit is contained in:
Marc Kreidler 2026-02-24 20:48:57 +01:00
parent 04ca6e5f24
commit dcfeb1b252

View file

@ -150,8 +150,7 @@ class ProjectBomEntriesDataTable implements DataTableTypeInterface
->add('manufacturing_status', EnumColumn::class, [
'label' => $this->translator->trans('part.table.manufacturingStatus'),
'class' => ManufacturingStatus::class,
'data' => fn (ProjectBOMEntry $context): ?ManufacturingStatus => $context->getPart()?->getManufacturingStatus(),
'render' => function (?ManufacturingStatus $status): string {
'render' => function (?ManufacturingStatus $status, Part $context): string {
if ($status === null) {
return '';
}