diff --git a/src/public/app/menus/tree_context_menu.ts b/src/public/app/menus/tree_context_menu.ts index 650432828..c765f9d0d 100644 --- a/src/public/app/menus/tree_context_menu.ts +++ b/src/public/app/menus/tree_context_menu.ts @@ -52,7 +52,7 @@ export default class TreeContextMenu implements SelectMenuItemEventListener`, command: "editBranchPrefix", uiIcon: "bx bx-rename", - enabled: isNotRoot && parentNotSearch && noSelectedNotes && notOptions + enabled: isNotRoot && parentNotSearch && noSelectedNotes && notOptionsOrHelp }, - { title: t("tree-context-menu.convert-to-attachment"), command: "convertNoteToAttachment", uiIcon: "bx bx-paperclip", enabled: isNotRoot && !isHoisted && notOptions }, + { title: t("tree-context-menu.convert-to-attachment"), command: "convertNoteToAttachment", uiIcon: "bx bx-paperclip", enabled: isNotRoot && !isHoisted && notOptionsOrHelp }, { title: `${t("tree-context-menu.duplicate-subtree")} `, command: "duplicateSubtree", uiIcon: "bx bx-outline", - enabled: parentNotSearch && isNotRoot && !isHoisted && notOptions + enabled: parentNotSearch && isNotRoot && !isHoisted && notOptionsOrHelp }, { title: "----" }, @@ -136,7 +136,7 @@ export default class TreeContextMenu implements SelectMenuItemEventListener`, command: "deleteNotes", uiIcon: "bx bx-trash destructive-action-icon", - enabled: isNotRoot && !isHoisted && parentNotSearch && notOptions + enabled: isNotRoot && !isHoisted && parentNotSearch && notOptionsOrHelp }, { title: "----" }, - { title: t("tree-context-menu.import-into-note"), command: "importIntoNote", uiIcon: "bx bx-import", enabled: notSearch && noSelectedNotes && notOptions }, + { title: t("tree-context-menu.import-into-note"), command: "importIntoNote", uiIcon: "bx bx-import", enabled: notSearch && noSelectedNotes && notOptionsOrHelp }, - { title: t("tree-context-menu.export"), command: "exportNote", uiIcon: "bx bx-export", enabled: notSearch && noSelectedNotes && notOptions }, + { title: t("tree-context-menu.export"), command: "exportNote", uiIcon: "bx bx-export", enabled: notSearch && noSelectedNotes && notOptionsOrHelp }, { title: "----" }, diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index a5cdac300..1793d6c65 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -550,7 +550,12 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { $span.append($refreshSearchButton); } - if (!["search", "launcher"].includes(note.type) && !note.isOptions() && !note.isLaunchBarConfig()) { + // TODO: Deduplicate with server's notes.ts#getAndValidateParent + if (!["search", "launcher"].includes(note.type) + && !note.isOptions() + && !note.isLaunchBarConfig() + && !note.noteId.startsWith("_help") + ) { const $createChildNoteButton = $(``).on( "click", cancelClickPropagation diff --git a/src/services/notes.ts b/src/services/notes.ts index d0a699984..5f91632f4 100644 --- a/src/services/notes.ts +++ b/src/services/notes.ts @@ -146,7 +146,10 @@ function getAndValidateParent(params: GetValidateParams) { } if (!params.ignoreForbiddenParents) { - if (["_lbRoot", "_hidden"].includes(parentNote.noteId) || parentNote.noteId.startsWith("_lbTpl") || parentNote.isOptions()) { + if (["_lbRoot", "_hidden"].includes(parentNote.noteId) + || parentNote.noteId.startsWith("_lbTpl") + || parentNote.noteId.startsWith("_help") + || parentNote.isOptions()) { throw new ValidationError(`Creating child notes into '${parentNote.noteId}' is not allowed.`); } }