Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(board/promoted_attributes): render non-promoted attribute defs too
Elian Doran5dbe9e7da664
diff --git a/apps/client/src/entities/fnote.ts b/apps/client/src/entities/fnote.tsindex 6d0a15506d..e59ac671d4 100644--- a/apps/client/src/entities/fnote.ts+++ b/apps/client/src/entities/fnote.ts@@ -839,8 +839,7 @@ export default class FNote {return [];}- const promotedAttrs = this.getAttributes()- .filter((attr) => attr.isDefinition())+ const promotedAttrs = this.getAttributeDefinitions().filter((attr) => {const def = attr.getDefinition();@@ -860,6 +859,11 @@ export default class FNote {return promotedAttrs;}+ getAttributeDefinitions() {+ return this.getAttributes()+ .filter((attr) => attr.isDefinition());+ }+hasAncestor(ancestorNoteId: string, followTemplates = false, visitedNoteIds: Set<string> | null = null) {if (this.noteId === ancestorNoteId) {return true;diff --git a/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx b/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsxindex a8ae11c8a4..51cb4649ea 100644--- a/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx+++ b/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx@@ -91,7 +91,7 @@ function formatRelation(attr: AttributeWithDefinitions): ComponentChildren {}function getAttributesWithDefinitions(note: FNote, attributesToIgnore: string[] = []): AttributeWithDefinitions[] {- const promotedDefinitionAttributes = note.getPromotedDefinitionAttributes();+ const promotedDefinitionAttributes = note.getAttributeDefinitions();const result: AttributeWithDefinitions[] = [];for (const attr of promotedDefinitionAttributes) {const def = attr.getDefinition();