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(collections/board): remove note from board
Elian Doran0dddcbcfa1b2
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex 98797051bc..634fe3c351 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -1996,9 +1996,10 @@"delete_row": "Delete row"},"board_view": {- "delete-note": "Delete Note",- "archive-note": "Archive Note",- "unarchive-note": "Unarchive Note",+ "delete-note": "Delete note...",+ "remove-from-board": "Remove from board",+ "archive-note": "Archive note",+ "unarchive-note": "Unarchive note","move-to": "Move to","insert-above": "Insert above","insert-below": "Insert below",diff --git a/apps/client/src/widgets/collections/board/api.ts b/apps/client/src/widgets/collections/board/api.tsindex 86936bc67f..61bcbe339a 100644--- a/apps/client/src/widgets/collections/board/api.ts+++ b/apps/client/src/widgets/collections/board/api.ts@@ -156,6 +156,12 @@ export default class BoardApi {return server.put(`notes/${noteId}/title`, { title: newTitle.trim() });}+ removeFromBoard(noteId: string) {+ const note = froca.getNoteFromCache(noteId);+ if (!note) return;+ return attributes.removeOwnedLabelByName(note, this.statusAttribute);+ }+async moveWithinBoard(noteId: string, sourceBranchId: string, sourceIndex: number, targetIndex: number, sourceColumn: string, targetColumn: string) {const targetItems = this.byColumn?.get(targetColumn) ?? [];diff --git a/apps/client/src/widgets/collections/board/context_menu.ts b/apps/client/src/widgets/collections/board/context_menu.tsindex 9e4a98465c..d3f74fde40 100644--- a/apps/client/src/widgets/collections/board/context_menu.ts+++ b/apps/client/src/widgets/collections/board/context_menu.ts@@ -49,8 +49,9 @@ export function openNoteContextMenu(api: Api, event: ContextMenuEvent, note: FNotitle: columnToMoveTo,enabled: columnToMoveTo !== column,handler: () => api.changeColumn(note.noteId, columnToMoveTo)- }))+ })),},+ getArchiveMenuItem(note),{ title: "----" },{title: t("board_view.insert-above"),@@ -63,12 +64,16 @@ export function openNoteContextMenu(api: Api, event: ContextMenuEvent, note: FNohandler: () => api.insertRowAtPosition(column, branchId, "after")},{ title: "----" },+ {+ title: t("board_view.remove-from-board"),+ uiIcon: "bx bx-task-x",+ handler: () => api.removeFromBoard(note.noteId)+ },{title: t("board_view.delete-note"),uiIcon: "bx bx-trash",handler: () => branches.deleteNotes([ branchId ], false, false)},- getArchiveMenuItem(note)],selectMenuItemHandler: ({ command }) => link_context_menu.handleLinkContextMenuItem(command, note.noteId),});