mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
feat(collections/board): remove note from board
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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) ?? [];
|
||||
|
||||
|
||||
@@ -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),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user