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(dev): action to open print page easily
Elian Doranabbb4e793ff6
diff --git a/apps/client/src/widgets/ribbon/NoteActions.tsx b/apps/client/src/widgets/ribbon/NoteActions.tsxindex 33017221be..bc191b5d0b 100644--- a/apps/client/src/widgets/ribbon/NoteActions.tsx+++ b/apps/client/src/widgets/ribbon/NoteActions.tsx@@ -105,10 +105,24 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not<FormDropdownDivider /><CommandItem command="showAttachments" icon="bx bx-paperclip" disabled={isInOptionsOrHelp} text={t("note_actions.note_attachments")} />+ {glob.isDev && <DevelopmentActions note={note} />}</Dropdown>);}+function DevelopmentActions({ note }: { note: FNote }) {+ return (+ <>+ <FormDropdownDivider />+ <FormListItem disabled>Development-only Actions</FormListItem>+ <FormListItem+ icon="bx bx-printer"+ onClick={() => window.open(`/?print=#root/${note.noteId}`, "_blank")}+ >Open print page</FormListItem>+ </>+ )+}+function CommandItem({ icon, text, title, command, disabled }: { icon: string, text: string, title?: string, command: CommandNames | (() => void), disabled?: boolean, destructive?: boolean }) {return <FormListItemicon={icon}