From 0dddcbcfa1b2ff0484b1d5be2de50970b51b0d48 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 12 Sep 2025 22:25:33 +0300 Subject: [PATCH] feat(collections/board): remove note from board --- apps/client/src/translations/en/translation.json | 7 ++++--- apps/client/src/widgets/collections/board/api.ts | 6 ++++++ .../client/src/widgets/collections/board/context_menu.ts | 9 +++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 98797051b..634fe3c35 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.ts index 86936bc67..61bcbe339 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.ts index 9e4a98465..d3f74fde4 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: FNo title: 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: FNo handler: () => 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), });