-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Rework the delete project dialog #6853
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
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.
Just some initial high level comments before diving any deeper
collect_app/src/main/res/layout/delete_project_dialog_layout.xml
Outdated
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/preferences/dialogs/DeleteProjectDialog.kt
Outdated
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/preferences/dialogs/DeleteProjectDialog.kt
Outdated
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/preferences/dialogs/DeleteProjectDialog.kt
Outdated
Show resolved
Hide resolved
aa18f25 to
fe8439d
Compare
fe8439d to
8bca906
Compare
collect_app/src/main/java/org/odk/collect/android/instancemanagement/InstancesDataService.kt
Outdated
Show resolved
Hide resolved
| import org.odk.collect.async.Scheduler | ||
|
|
||
| class DeleteProjectDialog( | ||
| private val projectDeleter: ProjectDeleter, |
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.
We should definitely flip the relationship between ProjectDeleter and ProjectsDataService - the former should be used by the latter. I don't want to hold this PR up, but could that be done as a follow-up change?
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.
Yes, I will do that in a follow-up pr.
material/src/main/java/org/odk/collect/material/MaterialAlertDialogFragment.kt
Show resolved
Hide resolved
...ect_app/src/test/java/org/odk/collect/android/preferences/dialogs/DeleteProjectDialogTest.kt
Outdated
Show resolved
Hide resolved
...ect_app/src/test/java/org/odk/collect/android/preferences/dialogs/DeleteProjectDialogTest.kt
Show resolved
Hide resolved
|
Should deleting a project be blocked while forms are being sent? |
A user would see that there are x forms unsent before right? If so, and they decide to delete the project, it doesn't matter if the forms are being sent or not. That's what we briefly discussed here #6853 (comment) |
I think that’s fine. The projects dialog in the main menu works the same way, and they are similar - they both display information and let you perform actions, but if you don’t, nothing bad happens. |
Yes, the text is trimmed and case-insensitive, so it can be any variation of |
|
I think it is ok. @seadowg, please comment if you disagree. |
Fixed. |
Fixed. |
No. it should take one line, like in the settings dialog 9in the main menu. for example. Fixed. |
|
Soft-deleted forms (there's a draft of the form but the blank form was deleted) are visible in "Form definitions" - is it ok? |
I think I would fix that. It should ignore soft-deleted forms now. |
No. The longer string is not reversed because it starts with left-to-right text, so Android treats the whole block as LTR even in an RTL layout. Short simple strings like 'Delete Demo project' can still appear on the right (despite the fact it is also LTR text), but longer ones keep their LTR base direction. That’s how Android works. |
It depends on the screen size, but I think that’s fine for a dialog like this. We’d need to shorten the message to save space and ensure the button is visible. I don’t think it’s worth the effort right now. @alyblenkin if you think it is important to address, please file a separate issue. |
It shouldn't. Sentence case (only the first word and proper nouns start with a capital letter) is recommended by Material Design. |
Fixed. |
Fixed. |
|
Tested with Success! Verified on Android 10 (Dominika), 14 (Szymon), 16 (Wiktor) Verified cases:
|
Agreed! |
Closes #6846
Closes #6852
Why is this the best possible solution? Were any other approaches considered?
According to our discussions, the new confirmation dialog will be a better solution, and allowing project deletion even when there are unsent forms will also be an improvement.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
We need to test deleting projects to ensure the new confirmation dialog works as expected and that projects are correctly deleted when the user confirms.
Do we need any specific form for testing your changes? If so, please attach one.
No.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No.
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest(or./gradlew testLab) and confirmed all checks still passDateFormatsTest