From e9f40c48e3e7a6666ef452f0a1b95ec074f98808 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 12 Nov 2025 20:56:15 +0200 Subject: [PATCH] feat(board/promoted_attributes): basic support for color attributes --- .../widgets/attribute_widgets/PromotedAttributesDisplay.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx b/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx index e2451a4cd..b24845a0d 100644 --- a/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx +++ b/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx @@ -7,6 +7,7 @@ import { DefinitionObject } from "../../services/promoted_attribute_definition_p import { formatDateTime } from "../../utils/formatters"; import { ComponentChildren } from "preact"; import Icon from "../react/Icon"; +import css_class_manager from "../../services/css_class_manager"; interface PromotedAttributesDisplayProps { note: FNote; @@ -26,8 +27,9 @@ export default function PromotedAttributesDisplay({ note, ignoredAttributes }: P return promotedDefinitionAttributes?.length > 0 && (
{promotedDefinitionAttributes?.map((attr) => { + const className = `${attr.type === "label" ? "label" + " " + attr.def.labelType : "relation"}`; return ( - + {formatLabelValue(attr)} ); @@ -74,6 +76,8 @@ function formatLabelValue(attr: AttributeWithDefinitions): ComponentChildren { return <> {attr.friendlyName}; case "url": return <>{attr.friendlyName}; + case "color": + return <>{attr.friendlyName}; case "text": default: return <>{attr.friendlyName}: {value};