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
note paths widget does not show hidden path
zadama0de3c97a5f3
diff --git a/src/public/app/entities/note_short.js b/src/public/app/entities/note_short.jsindex 1fa8153448..ca6bcfc01b 100644--- a/src/public/app/entities/note_short.js+++ b/src/public/app/entities/note_short.js@@ -300,7 +300,8 @@ class NoteShort {notePath: path,isInHoistedSubTree: path.includes(hoistedNotePath),isArchived: path.find(noteId => froca.notes[noteId].hasLabel('archived')),- isSearch: path.find(noteId => froca.notes[noteId].type === 'search')+ isSearch: path.find(noteId => froca.notes[noteId].type === 'search'),+ isHidden: path.includes("hidden")}));notePaths.sort((a, b) => {diff --git a/src/public/app/widgets/ribbon_widgets/note_paths.js b/src/public/app/widgets/ribbon_widgets/note_paths.jsindex 8a4cdd03c7..ab8496a3b1 100644--- a/src/public/app/widgets/ribbon_widgets/note_paths.js+++ b/src/public/app/widgets/ribbon_widgets/note_paths.js@@ -28,7 +28,7 @@ const TPL = `}</style>- <div>This note is placed into the following paths:</div>+ <div class="note-path-intro"></div><ul class="note-path-list"></ul>@@ -51,6 +51,7 @@ export default class NotePathsWidget extends NoteContextAwareWidget {doRender() {this.$widget = $(TPL);+ this.$notePathIntro = this.$widget.find(".note-path-intro");this.$notePathList = this.$widget.find(".note-path-list");this.$widget.on('show.bs.dropdown', () => this.renderDropdown());}@@ -63,7 +64,17 @@ export default class NotePathsWidget extends NoteContextAwareWidget {return;}- for (const notePathRecord of this.note.getSortedNotePaths(this.hoistedNoteId)) {+ const sortedNotePaths = this.note.getSortedNotePaths(this.hoistedNoteId)+ .filter(notePath => !notePath.isHidden);++ if (sortedNotePaths.length > 0) {+ this.$notePathIntro.text("This note is placed into the following paths:");+ }+ else {+ this.$notePathIntro.text("This note is not yet placed into the note tree.");+ }++ for (const notePathRecord of sortedNotePaths) {await this.addPath(notePathRecord);}}diff --git a/src/routes/api/date_notes.js b/src/routes/api/date_notes.jsindex ae3ce257dd..499b4390ab 100644--- a/src/routes/api/date_notes.js+++ b/src/routes/api/date_notes.js@@ -92,7 +92,9 @@ function getHiddenRoot() {parentNoteId: 'root'}).note;- hidden.addLabel('archived', "", true);+ // isInheritable: false means that this notePath is automatically not preffered but at the same time+ // the flag is not inherited to the children+ hidden.addLabel('archived', "", false);}return hidden;