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-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-notes-updated-as-file-had-newer = Notes updated, as file had newer version: { $val }
importing-include-reviews = Include reviews importing-include-reviews = Include reviews
importing-also-import-progress = Also import any learning progress
importing-conflict-handling = Conflict handling
importing-include-reviews-help = importing-include-reviews-help =
If enabled, any previous reviews that the deck sharer included will also be imported. If enabled, any previous reviews that the deck sharer included will also be imported.
Otherwise, all cards will be imported as new cards. 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; export let options: ImportAnkiPackageOptions;
const settings = { const settings = {
withScheduling: {
title: tr.importingAlsoImportProgress(),
help: tr.importingIncludeReviewsHelp(),
url: HelpPage.PackageImporting.scheduling,
},
mergeNotetypes: { mergeNotetypes: {
title: tr.importingMergeNotetypes(), title: tr.importingMergeNotetypes(),
help: tr.importingMergeNotetypesHelp(), help: tr.importingMergeNotetypesHelp(),
@ -39,11 +44,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
help: tr.importingUpdateNotetypesHelp(), help: tr.importingUpdateNotetypesHelp(),
url: HelpPage.PackageImporting.updating, url: HelpPage.PackageImporting.updating,
}, },
withScheduling: {
title: tr.importingIncludeReviews(),
help: tr.importingIncludeReviewsHelp(),
url: HelpPage.PackageImporting.scheduling,
},
}; };
const helpSections = Object.values(settings) as HelpItem[]; const helpSections = Object.values(settings) as HelpItem[];
let modal: Modal; let modal: Modal;
@ -75,10 +75,23 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
}} }}
/> />
<SwitchRow bind:value={options.withScheduling} defaultValue={false}>
<SettingTitle
on:click={() =>
openHelpModal(Object.keys(settings).indexOf("withScheduling"))}
>
{settings.withScheduling.title}
</SettingTitle>
</SwitchRow>
<details>
<summary>{tr.importingConflictHandling()}</summary>
<SwitchRow bind:value={options.mergeNotetypes} defaultValue={false}> <SwitchRow bind:value={options.mergeNotetypes} defaultValue={false}>
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("mergeNotetypes"))} openHelpModal(
Object.keys(settings).indexOf("mergeNotetypes"),
)}
> >
{settings.mergeNotetypes.title} {settings.mergeNotetypes.title}
</SettingTitle> </SettingTitle>
@ -104,20 +117,14 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
> >
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("updateNotetypes"))} openHelpModal(
Object.keys(settings).indexOf("updateNotetypes"),
)}
> >
{settings.updateNotetypes.title} {settings.updateNotetypes.title}
</SettingTitle> </SettingTitle>
</EnumSelectorRow> </EnumSelectorRow>
</details>
<SwitchRow bind:value={options.withScheduling} defaultValue={false}>
<SettingTitle
on:click={() =>
openHelpModal(Object.keys(settings).indexOf("withScheduling"))}
>
{settings.withScheduling.title}
</SettingTitle>
</SwitchRow>
</TitledContainer> </TitledContainer>
</Row> </Row>
</ImportPage> </ImportPage>