Tweaks to import screen

- Tweak wording
- Move conflict handling options to a disclosure
This commit is contained in:
Damien Elmes 2023-10-26 11:19:19 +10:00
parent ceb8a4ac20
commit 9362ef9620
2 changed files with 49 additions and 40 deletions

View File

@ -50,6 +50,8 @@ importing-notes-skipped-as-theyre-already-in = Notes skipped, as up-to-date copi
importing-notes-skipped-update-due-to-notetype = Notes not updated, as notetype has been modified since you first imported the notes: { $val }
importing-notes-updated-as-file-had-newer = Notes updated, as file had newer version: { $val }
importing-include-reviews = Include reviews
importing-also-import-progress = Also import any learning progress
importing-conflict-handling = Conflict handling
importing-include-reviews-help =
If enabled, any previous reviews that the deck sharer included will also be imported.
Otherwise, all cards will be imported as new cards.

View File

@ -24,6 +24,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export let options: ImportAnkiPackageOptions;
const settings = {
withScheduling: {
title: tr.importingAlsoImportProgress(),
help: tr.importingIncludeReviewsHelp(),
url: HelpPage.PackageImporting.scheduling,
},
mergeNotetypes: {
title: tr.importingMergeNotetypes(),
help: tr.importingMergeNotetypesHelp(),
@ -39,11 +44,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
help: tr.importingUpdateNotetypesHelp(),
url: HelpPage.PackageImporting.updating,
},
withScheduling: {
title: tr.importingIncludeReviews(),
help: tr.importingIncludeReviewsHelp(),
url: HelpPage.PackageImporting.scheduling,
},
};
const helpSections = Object.values(settings) as HelpItem[];
let modal: Modal;
@ -75,41 +75,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
}}
/>
<SwitchRow bind:value={options.mergeNotetypes} defaultValue={false}>
<SettingTitle
on:click={() =>
openHelpModal(Object.keys(settings).indexOf("mergeNotetypes"))}
>
{settings.mergeNotetypes.title}
</SettingTitle>
</SwitchRow>
<EnumSelectorRow
bind:value={options.updateNotes}
defaultValue={0}
choices={updateChoices()}
>
<SettingTitle
on:click={() =>
openHelpModal(Object.keys(settings).indexOf("updateNotes"))}
>
{settings.updateNotes.title}
</SettingTitle>
</EnumSelectorRow>
<EnumSelectorRow
bind:value={options.updateNotetypes}
defaultValue={0}
choices={updateChoices()}
>
<SettingTitle
on:click={() =>
openHelpModal(Object.keys(settings).indexOf("updateNotetypes"))}
>
{settings.updateNotetypes.title}
</SettingTitle>
</EnumSelectorRow>
<SwitchRow bind:value={options.withScheduling} defaultValue={false}>
<SettingTitle
on:click={() =>
@ -118,6 +83,48 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
{settings.withScheduling.title}
</SettingTitle>
</SwitchRow>
<details>
<summary>{tr.importingConflictHandling()}</summary>
<SwitchRow bind:value={options.mergeNotetypes} defaultValue={false}>
<SettingTitle
on:click={() =>
openHelpModal(
Object.keys(settings).indexOf("mergeNotetypes"),
)}
>
{settings.mergeNotetypes.title}
</SettingTitle>
</SwitchRow>
<EnumSelectorRow
bind:value={options.updateNotes}
defaultValue={0}
choices={updateChoices()}
>
<SettingTitle
on:click={() =>
openHelpModal(Object.keys(settings).indexOf("updateNotes"))}
>
{settings.updateNotes.title}
</SettingTitle>
</EnumSelectorRow>
<EnumSelectorRow
bind:value={options.updateNotetypes}
defaultValue={0}
choices={updateChoices()}
>
<SettingTitle
on:click={() =>
openHelpModal(
Object.keys(settings).indexOf("updateNotetypes"),
)}
>
{settings.updateNotetypes.title}
</SettingTitle>
</EnumSelectorRow>
</details>
</TitledContainer>
</Row>
</ImportPage>