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/relation): group by relation
Elian Doran47f7968dc402
diff --git a/apps/client/src/entities/fnote.ts b/apps/client/src/entities/fnote.tsindex 230c4783c5..425742ee3b 100644--- a/apps/client/src/entities/fnote.ts+++ b/apps/client/src/entities/fnote.ts@@ -804,6 +804,16 @@ export default class FNote {return this.getAttributeValue(LABEL, name);}+ getLabelOrRelation(nameWithPrefix: string) {+ if (nameWithPrefix.startsWith("#")) {+ return this.getLabelValue(nameWithPrefix.substring(1));+ } else if (nameWithPrefix.startsWith("~")) {+ return this.getRelationValue(nameWithPrefix.substring(1));+ } else {+ return this.getLabelValue(nameWithPrefix);+ }+ }+/*** @param name - relation name* @returns relation value if relation exists, null otherwisediff --git a/apps/client/src/widgets/collections/board/data.ts b/apps/client/src/widgets/collections/board/data.tsindex f283e2dc78..a37487ec90 100644--- a/apps/client/src/widgets/collections/board/data.ts+++ b/apps/client/src/widgets/collections/board/data.ts@@ -57,7 +57,8 @@ export async function getBoardData(parentNote: FNote, groupByColumn: string, perreturn {byColumn,- newPersistedData+ newPersistedData,+ isInRelationMode: groupByColumn.startsWith("~")};}@@ -70,7 +71,7 @@ async function recursiveGroupBy(branches: FBranch[], byColumn: ColumnMap, groupBawait recursiveGroupBy(note.getChildBranches(), byColumn, groupByColumn, includeArchived, seenNoteIds);}- const group = note.getLabelValue(groupByColumn);+ const group = note.getLabelOrRelation(groupByColumn);if (!group || seenNoteIds.has(note.noteId)) {continue;}