From 54d3936c7b0011510dcd8aee8ee7e1c40f82f9e2 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 12 Nov 2025 21:06:44 +0200 Subject: [PATCH] feat(board/promoted_attributes): support multiple values --- .../PromotedAttributesDisplay.tsx | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx b/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx index 0ada5f823..a90d48ce4 100644 --- a/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx +++ b/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx @@ -96,12 +96,24 @@ function getAttributesWithDefinitions(note: FNote, attributesToIgnore: string[] for (const attr of promotedDefinitionAttributes) { const def = attr.getDefinition(); const [ type, name ] = attr.name.split(":", 2); - const value = type === "label" ? note.getLabelValue(name) : note.getRelationValue(name); const friendlyName = def?.promotedAlias || name; - if (!value) continue; - if (attributesToIgnore.includes(name)) continue; + const props: Omit = { def, name, type, friendlyName }; - result.push({ def, name, type, value, friendlyName }); + if (type === "label") { + const labels = note.getLabels(name); + for (const label of labels) { + if (!label.value) continue; + result.push({ ...props, value: label.value } ); + } + } else if (type === "relation") { + const relations = note.getRelations(name); + for (const relation of relations) { + if (!relation.value) continue; + result.push({ ...props, value: relation.value } ); + } + } + + if (attributesToIgnore.includes(name)) continue; } return result; }