mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-01 04:49:36 +00:00
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:
parent
04ca6e5f24
commit
dcfeb1b252
1 changed files with 1 additions and 2 deletions
|
|
@ -150,8 +150,7 @@ class ProjectBomEntriesDataTable implements DataTableTypeInterface
|
||||||
->add('manufacturing_status', EnumColumn::class, [
|
->add('manufacturing_status', EnumColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.manufacturingStatus'),
|
'label' => $this->translator->trans('part.table.manufacturingStatus'),
|
||||||
'class' => ManufacturingStatus::class,
|
'class' => ManufacturingStatus::class,
|
||||||
'data' => fn (ProjectBOMEntry $context): ?ManufacturingStatus => $context->getPart()?->getManufacturingStatus(),
|
'render' => function (?ManufacturingStatus $status, Part $context): string {
|
||||||
'render' => function (?ManufacturingStatus $status): string {
|
|
||||||
if ($status === null) {
|
if ($status === null) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue