-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix:no warning on empty front template #16423
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!!!
Could you also add a @NeedsTest
annotation for each testable issue raised in this review
/** Checks if the front of the template is empty or not, and show a dialog if empty | ||
* @return true if empty else false **/ | ||
fun isFrontTemplateEmpty(): Boolean { | ||
if (currentTemplate?.front.isNullOrEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to match Anki Desktop, check their source code and link the relevant lines
The test is for "No Fields", so non-blank content: AAA
should also fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anki uses update_notetype_legacy and to show errors anki uses AnkiErrors but I couldn't find something as such so I need help as I am a new contributor .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best to check in Discord to see if anyone has capacity to bring this to completion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also mark this as a draft if it's not ready for review
private fun showEmptyTemplateDialog() { | ||
AlertDialog.Builder(templateEditor).show { | ||
templateEditor.tempModel?.let { tempModel -> | ||
val templateCount = tempModel.templateCount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I have two templates, and the problem is on the first template, this should be 1, not 2
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 |
Purpose / Description
Anki and Ankidroid both have same warning dialog when trying to save front card template
Fixes
How Has This Been Tested?
Google Emulator
Learning (optional, can help others)
Describe the research stage
Links to blog posts, patterns, libraries or addons used to solve this problem
Checklist
Please, go through these checks before submitting the PR.