Skip to content

feat(parts table): add eda reference prefix and value columns#1266

Open
hrueger wants to merge 1 commit intoPart-DB:masterfrom
hrueger:feat/parts-table-eda-info
Open

feat(parts table): add eda reference prefix and value columns#1266
hrueger wants to merge 1 commit intoPart-DB:masterfrom
hrueger:feat/parts-table-eda-info

Conversation

@hrueger
Copy link

@hrueger hrueger commented Feb 22, 2026

Hi,
I hope this makes sense 👍 I don't have my part descriptions formatted the same way everywhere, so I'd like to show this in a separate column.

Feel free to suggest any changes / improvements!

Copilot AI review requested due to automatic review settings February 22, 2026 20:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two dedicated columns to the Parts DataTable to display EDA reference prefix and EDA value separately, improving table readability when descriptions are inconsistently formatted.

Changes:

  • Add eda_info_reference_prefix column with label, rendering, and natural-sort ordering.
  • Add eda_info_value column with label, rendering, and natural-sort ordering.

Comment on lines +234 to +239
'render' => fn($value, Part $context) => htmlspecialchars($context->getEdaInfo()->getReferencePrefix() ?? ''),
'orderField' => 'NATSORT(part.eda_info.reference_prefix)'
])
->add('eda_info_value', TextColumn::class, [
'label' => $this->translator->trans('eda_info.value'),
'render' => fn($value, Part $context) => htmlspecialchars($context->getEdaInfo()->getValue() ?? ''),
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new EDA columns don’t set a Doctrine field. With TwoStepORMAdapter, default field mapping is only applied when the column name matches a mapped entity field, so eda_info_reference_prefix/eda_info_value will have field = null and therefore won’t participate in global search (and any other criteria that relies on field). If these columns should be searchable, set field (and optionally searchField) to part.eda_info.reference_prefix / part.eda_info.value and you can then render from the $value argument instead of re-reading from $context.

Suggested change
'render' => fn($value, Part $context) => htmlspecialchars($context->getEdaInfo()->getReferencePrefix() ?? ''),
'orderField' => 'NATSORT(part.eda_info.reference_prefix)'
])
->add('eda_info_value', TextColumn::class, [
'label' => $this->translator->trans('eda_info.value'),
'render' => fn($value, Part $context) => htmlspecialchars($context->getEdaInfo()->getValue() ?? ''),
'field' => 'part.eda_info.reference_prefix',
'searchField' => 'part.eda_info.reference_prefix',
'render' => fn($value, Part $context) => htmlspecialchars($value ?? ''),
'orderField' => 'NATSORT(part.eda_info.reference_prefix)'
])
->add('eda_info_value', TextColumn::class, [
'label' => $this->translator->trans('eda_info.value'),
'field' => 'part.eda_info.value',
'searchField' => 'part.eda_info.value',
'render' => fn($value, Part $context) => htmlspecialchars($value ?? ''),

Copilot uses AI. Check for mistakes.
@hrueger
Copy link
Author

hrueger commented Feb 23, 2026

I'm unsure about what copilot suggests here, as none of the other add calls here do that. I have to confess though, that I don't fully understand the whole structure ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants