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 []; return [];
} }
const promotedAttrs = this.getAttributes() const promotedAttrs = this.getAttributeDefinitions()
.filter((attr) => attr.isDefinition())
.filter((attr) => { .filter((attr) => {
const def = attr.getDefinition(); const def = attr.getDefinition();
@ -860,6 +859,11 @@ export default class FNote {
return promotedAttrs; return promotedAttrs;
} }
getAttributeDefinitions() {
return this.getAttributes()
.filter((attr) => attr.isDefinition());
}
hasAncestor(ancestorNoteId: string, followTemplates = false, visitedNoteIds: Set<string> | null = null) { hasAncestor(ancestorNoteId: string, followTemplates = false, visitedNoteIds: Set<string> | null = null) {
if (this.noteId === ancestorNoteId) { if (this.noteId === ancestorNoteId) {
return true; return true;

View File

@ -91,7 +91,7 @@ function formatRelation(attr: AttributeWithDefinitions): ComponentChildren {
} }
function getAttributesWithDefinitions(note: FNote, attributesToIgnore: string[] = []): AttributeWithDefinitions[] { function getAttributesWithDefinitions(note: FNote, attributesToIgnore: string[] = []): AttributeWithDefinitions[] {
const promotedDefinitionAttributes = note.getPromotedDefinitionAttributes(); const promotedDefinitionAttributes = note.getAttributeDefinitions();
const result: AttributeWithDefinitions[] = []; const result: AttributeWithDefinitions[] = [];
for (const attr of promotedDefinitionAttributes) { for (const attr of promotedDefinitionAttributes) {
const def = attr.getDefinition(); const def = attr.getDefinition();