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
client/dialogs: add a cancel button
Adorian Doranff14e2ae23f2
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex 8811f3eeb9..850572400a 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -2665,6 +2665,7 @@},"modal": {"close": "Close",+ "cancel": "Cancel","help_title": "Display more information about this screen"},"call_to_action": {diff --git a/apps/client/src/widgets/dialogs/bulk_actions.tsx b/apps/client/src/widgets/dialogs/bulk_actions.tsxindex 55700613b6..8ca35fe273 100644--- a/apps/client/src/widgets/dialogs/bulk_actions.tsx+++ b/apps/client/src/widgets/dialogs/bulk_actions.tsx@@ -58,7 +58,10 @@ export default function BulkActionsDialog() {className="bulk-actions-dialog"size="xl"title={t("bulk_actions.bulk_actions")}- footer={<Button text={t("bulk_actions.execute_bulk_actions")} kind="primary" />}+ footer={<>+ <Button text={t("modal.cancel")} onClick={() => setShown(false)} />+ <Button text={t("bulk_actions.execute_bulk_actions")} kind="primary" />+ </>}show={shown}onSubmit={async () => {// Let actions surface a confirmation prompt (e.g. lossy conversions) before executing.diff --git a/apps/client/src/widgets/dialogs/clone_to.tsx b/apps/client/src/widgets/dialogs/clone_to.tsxindex 568dec63ed..3a455679bf 100644--- a/apps/client/src/widgets/dialogs/clone_to.tsx+++ b/apps/client/src/widgets/dialogs/clone_to.tsx@@ -60,7 +60,10 @@ export default function CloneToDialog() {title={t("clone_to.clone_notes_to")}helpPageId="IakOLONlIfGI"size="lg"- footer={<Button text={t("clone_to.clone_to_selected_note")} keyboardShortcut="Enter" />}+ footer={<>+ <Button text={t("modal.cancel")} onClick={() => setShown(false)} />+ <Button text={t("clone_to.clone_to_selected_note")} keyboardShortcut="Enter" />+ </>}onSubmit={onSubmit}onShown={() => triggerRecentNotes(autoCompleteRef.current)}onHidden={() => setShown(false)}diff --git a/apps/client/src/widgets/dialogs/export.tsx b/apps/client/src/widgets/dialogs/export.tsxindex a142ab9f2b..ae33f28e2f 100644--- a/apps/client/src/widgets/dialogs/export.tsx+++ b/apps/client/src/widgets/dialogs/export.tsx@@ -71,7 +71,10 @@ export default function ExportDialog() {setShown(false);}}onHidden={() => setShown(false)}- footer={<Button className="export-button" text={t("export.export")} kind="primary" />}+ footer={<>+ <Button text={t("modal.cancel")} onClick={() => setShown(false)} />+ <Button className="export-button" text={t("export.export")} kind="primary" />+ </>}show={shown}><Card heading={t("export.what_to_export")}>diff --git a/apps/client/src/widgets/dialogs/import/import_dialog.tsx b/apps/client/src/widgets/dialogs/import/import_dialog.tsxindex 31ea223399..84950440dc 100644--- a/apps/client/src/widgets/dialogs/import/import_dialog.tsx+++ b/apps/client/src/widgets/dialogs/import/import_dialog.tsx@@ -5,6 +5,7 @@ import { useCallback, useEffect, useState } from "preact/hooks";import { t } from "../../../services/i18n.js";import tree from "../../../services/tree.js";+import Button from "../../react/Button.js";import { Card, CardSection } from "../../react/Card.js";import { useTriliumEvent } from "../../react/hooks.js";import Modal from "../../react/Modal.js";@@ -52,7 +53,10 @@ export default function ImportDialog() {size="lg"scrollabletitle={noteTitle ? t("import.importIntoNoteNamed", { title: noteTitle }) : t("import.importIntoNote")}- footer={footer}+ footer={<>+ <Button text={t("modal.cancel")} onClick={closeDialog} />+ {footer}+ </>}footerAlignment="right"helpPageId={provider?.helpPage}onHidden={() => setShown(false)}diff --git a/apps/client/src/widgets/dialogs/move_to.tsx b/apps/client/src/widgets/dialogs/move_to.tsxindex 985934cdfe..b1375d7d5b 100644--- a/apps/client/src/widgets/dialogs/move_to.tsx+++ b/apps/client/src/widgets/dialogs/move_to.tsx@@ -47,7 +47,10 @@ export default function MoveToDialog() {className="move-to-dialog"size="lg" maxWidth={1000}title={t("move_to.dialog_title")}- footer={<Button text={t("move_to.move_button")} keyboardShortcut="Enter" />}+ footer={<>+ <Button text={t("modal.cancel")} onClick={() => setShown(false)} />+ <Button text={t("move_to.move_button")} keyboardShortcut="Enter" />+ </>}onSubmit={onSubmit}onShown={() => triggerRecentNotes(autoCompleteRef.current)}onHidden={() => setShown(false)}diff --git a/apps/client/src/widgets/dialogs/prompt.tsx b/apps/client/src/widgets/dialogs/prompt.tsxindex 2ffd5056c3..b818f4d891 100644--- a/apps/client/src/widgets/dialogs/prompt.tsx+++ b/apps/client/src/widgets/dialogs/prompt.tsx@@ -69,7 +69,10 @@ export default function PromptDialog() {submitValue.current = null;opts.current = undefined;}}- footer={<Button text={t("prompt.ok")} keyboardShortcut="Enter" kind="primary" />}+ footer={<>+ <Button text={t("modal.cancel")} onClick={() => setShown(false)} />+ <Button text={t("prompt.ok")} keyboardShortcut="Enter" kind="primary" />+ </>}show={shown}stackable>diff --git a/apps/client/src/widgets/dialogs/sort_child_notes.tsx b/apps/client/src/widgets/dialogs/sort_child_notes.tsxindex bd5a9e87b8..89f79dca00 100644--- a/apps/client/src/widgets/dialogs/sort_child_notes.tsx+++ b/apps/client/src/widgets/dialogs/sort_child_notes.tsx@@ -45,7 +45,10 @@ export default function SortChildNotesDialog() {onSubmit={onSubmit}onHidden={() => setShown(false)}show={shown}- footer={<Button text={t("sort_child_notes.sort")} keyboardShortcut="Enter" />}+ footer={<>+ <Button text={t("modal.cancel")} onClick={() => setShown(false)} />+ <Button text={t("sort_child_notes.sort")} keyboardShortcut="Enter" />+ </>}><h5>{t("sort_child_notes.sorting_criteria")}</h5><FormRadioGroup