Skip to content

Commit 14de845

Browse files
authoredSep 8, 2023
Merging Notetypes on Import (ankitects#2612)
* Remember original id when importing notetype * Reuse notetypes with matching original id * Add field and template ids * Enable merging imported notetypes * Fix test Note should be updated if the incoming note's notetype is remapped to the existing note's notetype. On the other hand, it should be skipped if its notetype id is mapped to some new notetype. * Change field and template ids to i32 * Add merge notetypes flag to proto message * Add dialog for apkg import * Move HelpModal into components * Generalize import dialog * Move SettingTitle into components * Add help modal to ImportAnkiPackagePage * Move SwitchRow into components * Fix backend method import * Make testable in browser * Fix broken modal * Wrap in container and fix margins * Update commented Anki version of new proto fields * Check ids when comparing notetype schemas * Add tooltip for merging notetypes. * Allow updating notes regardless of mtime * Gitignore yarn-error.log * Allow updating notetypes regardless of mtime * Fix apkg help carousel * Use i64s for template and field ids * Add option to omit importing scheduling info * Restore last settings in apkg import dialog * Display error when getting metadata in webview * Update manual links for apkg importing * Apply suggestions from code review Co-authored-by: Damien Elmes <[email protected]> * Omit schduling -> Import all cards as new cards * Tweak importing-update-notes-help * UpdateCondition → ImportAnkiPackageUpdateCondition * Load keyboard.ftl * Skip updating dupes in 'update alwyas' case * Explain more when merging notetypes is required * "omit scheduling" → "with scheduling" * Skip updating notetype dupes if 'update always' * Merge duplicated notetypes from previous imports * Fix rebase aftermath * Fix panic when merging * Clarify 'update notetypes' help * Mention 'merge notetypes' in the log * Add a test which covers the previously panicking path * Use nested ftl messages to ensure consistency * Make order of merged fields deterministic * Rewrite test to trigger panic * Update version comment on new fields
1 parent ba7140d commit 14de845

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1409
-275
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ node_modules
1414
.ninja_log
1515
.ninja_deps
1616
/extra
17+
yarn-error.log

‎build/configure/src/web.rs

+11
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,17 @@ fn build_and_check_pages(build: &mut Build) -> Result<()> {
314314
":sass"
315315
],
316316
)?;
317+
build_page(
318+
"import-anki-package",
319+
true,
320+
inputs![
321+
//
322+
":ts:lib",
323+
":ts:components",
324+
":ts:sveltelib",
325+
":sass"
326+
],
327+
)?;
317328
// we use the generated .css file separately
318329
build_page(
319330
"editable",

0 commit comments

Comments
 (0)
Please sign in to comment.