From aca390ee1996982248a75f1bcba35c5df154b359 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Nov 2025 11:24:44 +0200 Subject: [PATCH] chore(react/promoted_attributes): add more attributes to the input --- apps/client/src/widgets/PromotedAttributes.tsx | 12 ++++++++++++ apps/client/src/widgets/promoted_attributes.ts | 7 ------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/apps/client/src/widgets/PromotedAttributes.tsx b/apps/client/src/widgets/PromotedAttributes.tsx index 1a62b49e1..1086c350e 100644 --- a/apps/client/src/widgets/PromotedAttributes.tsx +++ b/apps/client/src/widgets/PromotedAttributes.tsx @@ -66,6 +66,12 @@ export default function PromotedAttributes() { for (const valueAttr of valueAttrs) { const definition = definitionAttr.getDefinition(); + + // if not owned, we'll force creation of a new attribute instead of updating the inherited one + if (valueAttr.noteId !== note.noteId) { + valueAttr.attributeId = ""; + } + cells.push({ definitionAttr, definition, valueAttr, valueName }); } } @@ -103,8 +109,14 @@ function PromotedAttributeCell(props: CellProps) {
diff --git a/apps/client/src/widgets/promoted_attributes.ts b/apps/client/src/widgets/promoted_attributes.ts index eb73c6885..3625cf4e0 100644 --- a/apps/client/src/widgets/promoted_attributes.ts +++ b/apps/client/src/widgets/promoted_attributes.ts @@ -23,13 +23,6 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget { const definition = definitionAttr.getDefinition(); const $input = $("") - .attr("data-attribute-id", valueAttr.noteId === this.noteId ? valueAttr.attributeId ?? "" : "") // if not owned, we'll force creation of a new attribute instead of updating the inherited one - .attr("data-attribute-type", valueAttr.type) - .attr("data-attribute-name", valueAttr.name) - .prop("value", valueAttr.value) - .prop("placeholder", t("promoted_attributes.unset-field-placeholder")) - .addClass("form-control") - .addClass("promoted-attribute-input") .on("change", (event) => this.promotedAttributeChanged(event)); if (valueAttr.type === "label") {