Skip to content

Commit 5dbe9e7

Browse files
committed
feat(board/promoted_attributes): render non-promoted attribute defs too
1 parent fd9b6e9 commit 5dbe9e7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

apps/client/src/entities/fnote.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,8 +839,7 @@ export default class FNote {
839839
return [];
840840
}
841841

842-
const promotedAttrs = this.getAttributes()
843-
.filter((attr) => attr.isDefinition())
842+
const promotedAttrs = this.getAttributeDefinitions()
844843
.filter((attr) => {
845844
const def = attr.getDefinition();
846845

@@ -860,6 +859,11 @@ export default class FNote {
860859
return promotedAttrs;
861860
}
862861

862+
getAttributeDefinitions() {
863+
return this.getAttributes()
864+
.filter((attr) => attr.isDefinition());
865+
}
866+
863867
hasAncestor(ancestorNoteId: string, followTemplates = false, visitedNoteIds: Set<string> | null = null) {
864868
if (this.noteId === ancestorNoteId) {
865869
return true;

apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function formatRelation(attr: AttributeWithDefinitions): ComponentChildren {
9191
}
9292

9393
function getAttributesWithDefinitions(note: FNote, attributesToIgnore: string[] = []): AttributeWithDefinitions[] {
94-
const promotedDefinitionAttributes = note.getPromotedDefinitionAttributes();
94+
const promotedDefinitionAttributes = note.getAttributeDefinitions();
9595
const result: AttributeWithDefinitions[] = [];
9696
for (const attr of promotedDefinitionAttributes) {
9797
const def = attr.getDefinition();

0 commit comments

Comments
 (0)