mirror of
https://github.com/zadam/trilium.git
synced 2025-02-25 07:25:32 +08:00
Merge remote-tracking branch 'origin/stable'
# Conflicts: # package.json
This commit is contained in:
commit
64f1671566
3 changed files with 25 additions and 5 deletions
|
@ -69,7 +69,10 @@ export default class NotePathsWidget extends NoteContextAwareWidget {
|
||||||
this.$notePathList.empty();
|
this.$notePathList.empty();
|
||||||
|
|
||||||
if (this.noteId === 'root') {
|
if (this.noteId === 'root') {
|
||||||
await this.getRenderedPath('root');
|
this.$notePathList.empty().append(
|
||||||
|
await this.getRenderedPath('root')
|
||||||
|
);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +97,7 @@ export default class NotePathsWidget extends NoteContextAwareWidget {
|
||||||
this.$notePathList.empty().append(...renderedPaths);
|
this.$notePathList.empty().append(...renderedPaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getRenderedPath(notePath, notePathRecord) {
|
async getRenderedPath(notePath, notePathRecord = null) {
|
||||||
const title = await treeService.getNotePathTitle(notePath);
|
const title = await treeService.getNotePathTitle(notePath);
|
||||||
|
|
||||||
const $noteLink = await linkService.createNoteLink(notePath, {title});
|
const $noteLink = await linkService.createNoteLink(notePath, {title});
|
||||||
|
@ -109,20 +112,20 @@ export default class NotePathsWidget extends NoteContextAwareWidget {
|
||||||
$noteLink.addClass("path-current");
|
$noteLink.addClass("path-current");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notePathRecord.isInHoistedSubTree) {
|
if (!notePathRecord || notePathRecord.isInHoistedSubTree) {
|
||||||
$noteLink.addClass("path-in-hoisted-subtree");
|
$noteLink.addClass("path-in-hoisted-subtree");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
icons.push(`<span class="bx bx-trending-up" title="This path is outside of hoisted note and you would have to unhoist."></span>`);
|
icons.push(`<span class="bx bx-trending-up" title="This path is outside of hoisted note and you would have to unhoist."></span>`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notePathRecord.isArchived) {
|
if (notePathRecord?.isArchived) {
|
||||||
$noteLink.addClass("path-archived");
|
$noteLink.addClass("path-archived");
|
||||||
|
|
||||||
icons.push(`<span class="bx bx-archive" title="Archived"></span>`);
|
icons.push(`<span class="bx bx-archive" title="Archived"></span>`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notePathRecord.isSearch) {
|
if (notePathRecord?.isSearch) {
|
||||||
$noteLink.addClass("path-search");
|
$noteLink.addClass("path-search");
|
||||||
|
|
||||||
icons.push(`<span class="bx bx-search" title="Search"></span>`);
|
icons.push(`<span class="bx bx-search" title="Search"></span>`);
|
||||||
|
|
|
@ -43,6 +43,11 @@ function getNeighbors(note, depth) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetNote = relation.getTargetNote();
|
const targetNote = relation.getTargetNote();
|
||||||
|
|
||||||
|
if (targetNote.hasLabel('excludeFromNoteMap')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
retNoteIds.push(targetNote.noteId);
|
retNoteIds.push(targetNote.noteId);
|
||||||
|
|
||||||
for (const noteId of getNeighbors(targetNote, depth - 1)) {
|
for (const noteId of getNeighbors(targetNote, depth - 1)) {
|
||||||
|
@ -57,6 +62,11 @@ function getNeighbors(note, depth) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const sourceNote = relation.getNote();
|
const sourceNote = relation.getNote();
|
||||||
|
|
||||||
|
if (sourceNote.hasLabel('excludeFromNoteMap')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
retNoteIds.push(sourceNote.noteId);
|
retNoteIds.push(sourceNote.noteId);
|
||||||
|
|
||||||
for (const noteId of getNeighbors(sourceNote, depth - 1)) {
|
for (const noteId of getNeighbors(sourceNote, depth - 1)) {
|
||||||
|
|
|
@ -44,6 +44,7 @@ function getHiddenRoot() {
|
||||||
// isInheritable: false means that this notePath is automatically not preffered but at the same time
|
// isInheritable: false means that this notePath is automatically not preffered but at the same time
|
||||||
// the flag is not inherited to the children
|
// the flag is not inherited to the children
|
||||||
hidden.addLabel('archived', "", false);
|
hidden.addLabel('archived', "", false);
|
||||||
|
hidden.addLabel('excludeFromNoteMap', "", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return hidden;
|
return hidden;
|
||||||
|
@ -206,6 +207,12 @@ function createMissingSpecialNotes() {
|
||||||
getSinglesNoteRoot();
|
getSinglesNoteRoot();
|
||||||
getSinglesNoteRoot();
|
getSinglesNoteRoot();
|
||||||
getGlobalNoteMap();
|
getGlobalNoteMap();
|
||||||
|
|
||||||
|
const hidden = getHiddenRoot();
|
||||||
|
|
||||||
|
if (!hidden.hasOwnedLabel('excludeFromNoteMap')) {
|
||||||
|
hidden.addLabel('excludeFromNoteMap', "", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
Loading…
Reference in a new issue