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): wrap OneNote section picker in an option row
Elian Doranf4945cc5b3db
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex ec300048eb..8eea7e49c1 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -262,7 +262,8 @@"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. 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",+ "select_sections_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.","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/import_dialog.css b/apps/client/src/widgets/dialogs/import/import_dialog.cssindex 51f470e3c8..3ffbdf50d6 100644--- a/apps/client/src/widgets/dialogs/import/import_dialog.css+++ b/apps/client/src/widgets/dialogs/import/import_dialog.css@@ -52,7 +52,6 @@align-items: center;justify-content: space-between;gap: 1em;- margin-bottom: 1em;padding-bottom: 0.75em;border-bottom: 1px solid var(--main-border-color);}diff --git a/apps/client/src/widgets/dialogs/import/onenote.tsx b/apps/client/src/widgets/dialogs/import/onenote.tsxindex 9f12b2d804..29b0894bc7 100644--- a/apps/client/src/widgets/dialogs/import/onenote.tsx+++ b/apps/client/src/widgets/dialogs/import/onenote.tsx@@ -8,7 +8,7 @@ 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 OptionsRow, { OptionsRowWithToggle } from "../../type_widgets/options/components/OptionsRow.js";import iconUrl from "./icons/onenote.svg?url";import type { ImportProvider, ImportProviderPanelProps } from "./types.js";@@ -189,15 +189,16 @@ function OneNotePanel({ parentNoteId, closeDialog, setFooter }: ImportProviderPa? <p>{t("onenote_import.no_notebooks")}</p>: (<>- <p>{t("onenote_import.select_sections")}</p>- <div className="onenote-notebooks">- {notebooks.map((notebook) => (- <div className="onenote-notebook" key={notebook.id}>- <strong>{notebook.title}</strong>- <SectionTree container={notebook} selectedIds={selectedIds} onToggle={toggleSection} />- </div>- ))}- </div>+ <OptionsRow name="onenote-sections" label={t("onenote_import.select_sections")} description={t("onenote_import.select_sections_hint")} stacked>+ <div className="onenote-notebooks">+ {notebooks.map((notebook) => (+ <div className="onenote-notebook" key={notebook.id}>+ <strong>{notebook.title}</strong>+ <SectionTree container={notebook} selectedIds={selectedIds} onToggle={toggleSection} />+ </div>+ ))}+ </div>+ </OptionsRow><OptionsRowWithTogglename="onenote-debug"label={t("onenote_import.attach_source")}