Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

Factorize mod schema

Open Arthur-Milchior opened this issue 5 years ago • 8 comments

There is a lot of code duplication for each changes that need a full sync. I factorize it.

Furthermore, I discovered that the app did not ask the user to confirm whether they want to confirm something when they need to confirm they want a full sync. I changed it so that it asks to confirm both.

Actually, asking for confirmation before asking the user to enter a name for a field would make sens too.

Arthur-Milchior avatar Dec 27 '20 12:12 Arthur-Milchior

Codecov Report

Merging #7965 (bd7b996) into master (b417a22) will increase coverage by 0.07%. The diff coverage is 29.54%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #7965      +/-   ##
============================================
+ Coverage     36.78%   36.85%   +0.07%     
- Complexity     3677     3680       +3     
============================================
  Files           339      339              
  Lines         35512    35431      -81     
  Branches       4714     4715       +1     
============================================
- Hits          13063    13059       -4     
+ Misses        20950    20873      -77     
  Partials       1499     1499              
Impacted Files Coverage Δ Complexity Δ
...oid/src/main/java/com/ichi2/anki/ModelBrowser.java 2.34% <0.00%> (+0.05%) 3.00 <0.00> (ø)
...src/main/java/com/ichi2/anki/ModelFieldEditor.java 1.85% <0.00%> (+0.39%) 2.00 <0.00> (ø)
...Droid/src/main/java/com/ichi2/anki/NoteEditor.java 39.51% <0.00%> (+0.37%) 119.00 <0.00> (-1.00) :arrow_up:
...oid/src/main/java/com/ichi2/anki/AnkiActivity.java 53.06% <31.57%> (-1.59%) 51.00 <2.00> (+2.00) :arrow_down:
...c/main/java/com/ichi2/anki/CardTemplateEditor.java 70.13% <100.00%> (+3.72%) 19.00 <0.00> (ø)
...ava/com/ichi2/anki/dialogs/ConfirmationDialog.java 88.00% <100.00%> (ø) 8.00 <1.00> (ø)
...nkiDroid/src/main/java/com/ichi2/anki/UIUtils.java 60.78% <0.00%> (-3.93%) 9.00% <0.00%> (-1.00%)
...src/main/java/com/ichi2/anki/CollectionHelper.java 29.31% <0.00%> (-2.59%) 21.00% <0.00%> (ø%)
...oid/src/main/java/com/ichi2/async/TaskManager.java 56.25% <0.00%> (-2.09%) 13.00% <0.00%> (+1.00%) :arrow_down:
...Droid/src/main/java/com/ichi2/libanki/Storage.java 28.30% <0.00%> (-1.89%) 14.00% <0.00%> (ø%)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b417a22...bd7b996. Read the comment docs.

codecov[bot] avatar Dec 27 '20 12:12 codecov[bot]

I'll take a look to figure out how to test activities when I'm done with templates

Arthur-Milchior avatar Dec 28 '20 08:12 Arthur-Milchior

Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

github-actions[bot] avatar Mar 01 '21 02:03 github-actions[bot]

This was clearly not meant to be closed. I understand it need more tests, and I need to understand how to test activities. But avoiding code duplication is still very relevant

Arthur-Milchior avatar Mar 24 '21 19:03 Arthur-Milchior

@david-allison-1 If I removed the cases where you have doubt and did a PR containing only the cases that are easy to check for NF, would you accept it?

Arthur-Milchior avatar Mar 24 '21 19:03 Arthur-Milchior

Definitely

david-allison avatar Mar 24 '21 19:03 david-allison

I removed the elements where you added comment. We should first commit #8390 and #8391

Arthur-Milchior avatar Mar 30 '21 02:03 Arthur-Milchior

@Arthur-Milchior Would you be happy to close this?

Now we're in Kotlin this can be done in a much nicer manner.

david-allison avatar Aug 23 '22 21:08 david-allison

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

github-actions[bot] avatar Mar 07 '23 20:03 github-actions[bot]