feat(board/promoted_attributes): render non-promoted attribute defs too

This commit is contained in:
Elian Doran 2025-11-13 08:52:42 +02:00
parent fd9b6e9e67
commit 5dbe9e7da6
No known key found for this signature in database
2 changed files with 7 additions and 3 deletions

View File

@ -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;

View File

@ -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();