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
refactor(import): use a toggle for OneNote attach-source and fold in the order hint
Elian Doran1b7b7cdc18a1
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex c3b1fedacb..ec300048eb 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -262,9 +262,7 @@"disconnect": "Disconnect","load_failed": "Could not load your OneNote notebooks.","no_notebooks": "No notebooks were found in this account.",- "select_sections": "Select the sections to import:",- "order_hint_title": "Approximate section order",- "order_hint": "OneNote doesn't include the original ordering in the import data, so sections and groups are sorted by creation date and may not match how they appear in OneNote.",+ "select_sections": "Select the sections to import. OneNote doesn't include the original ordering in the import data, so sections and groups are sorted by creation date and may not match how they appear in OneNote.","import": "Import selected","attach_source": "Attach original HTML (debug)","attach_source_hint": "Saves each page's unmodified OneNote HTML as an attachment on the imported note, for comparing against the converted result."diff --git a/apps/client/src/widgets/dialogs/import/onenote.tsx b/apps/client/src/widgets/dialogs/import/onenote.tsxindex 37058303b8..9f12b2d804 100644--- a/apps/client/src/widgets/dialogs/import/onenote.tsx+++ b/apps/client/src/widgets/dialogs/import/onenote.tsx@@ -4,11 +4,11 @@ import { t } from "../../../services/i18n.js";import onenoteImport, { buildSectionSelections, type OneNoteAccount, type OneNoteContainer, type OneNoteNotebook, orderedChildren } from "../../../services/onenote_import.js";import toast from "../../../services/toast.js";import { isElectron, randomString } from "../../../services/utils.js";-import { ExtendedAdmonition } from "../../react/Admonition.js";import Button from "../../react/Button.js";import { Card, CardSection } from "../../react/Card.js";import FormCheckbox from "../../react/FormCheckbox.js";import LoadingSpinner from "../../react/LoadingSpinner.js";+import { OptionsRowWithToggle } from "../../type_widgets/options/components/OptionsRow.js";import iconUrl from "./icons/onenote.svg?url";import type { ImportProvider, ImportProviderPanelProps } from "./types.js";@@ -198,13 +198,10 @@ function OneNotePanel({ parentNoteId, closeDialog, setFooter }: ImportProviderPa</div>))}</div>- <ExtendedAdmonition type="note" icon="bx bx-info-circle" title={t("onenote_import.order_hint_title")}>- {t("onenote_import.order_hint")}- </ExtendedAdmonition>- <FormCheckbox+ <OptionsRowWithTogglename="onenote-debug"label={t("onenote_import.attach_source")}- hint={t("onenote_import.attach_source_hint")}+ description={t("onenote_import.attach_source_hint")}currentValue={debug}onChange={setDebug}/>