-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Improvements to bulk finalize #5776
Conversation
744ab93
to
7da40de
Compare
c25d4ba
to
561c7db
Compare
5bb89af
to
df0d3ef
Compare
} | ||
|
||
@Test | ||
public void migratesFinalizeInFormEntryToNewKey() { |
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.
I couldn't think of another way to support upgrades and imports from up to date versions other than creating a new key. Otherwise, we'd end up with QR codes from up to date versions with only "finalise in form entry" disabled also disabling bulk finalise.
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 means that if you have the existing finalize
key in your QR code, it will forever more turn off both finalization at end of form and bulk finalize when you scan it in, right? That sounds fine and good.
If you start from a clean Collect install and you hide finalization from form entry, that will no affect bulk finalization. If you build a QR code from those settings, bulk finalization will be enabled unless you also explicitly unchecked it.
Unless I made a mistake in my interpretation, I think the approach is great.
|
||
data class Action(val text: String, val listener: () -> Unit) | ||
|
||
abstract class SnackbarPresenterObserver<T : Any?>(private val parentView: View) : |
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 can probably use this in a few more places, but as with other PRs for v2023.3 I wanted to minimise the merge conflict risk.
DraftsMenuProvider draftsMenuProvider = new DraftsMenuProvider(this, bulkFinalizationViewModel::finalizeAllDrafts); | ||
addMenuProvider(draftsMenuProvider, this); | ||
bulkFinalizationViewModel.getDraftsCount().observe(this, draftsCount -> { | ||
draftsMenuProvider.setDraftsCount(draftsCount); |
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've previously played around with handling observations in MenuProviders
i.e. treating them more like a Fragment
than a View
. I was finding that I needed a lot of test infrastructure to get this working however and that the component seems to prefer this more View
like setup.
There's unfortunately no docs around MenuProvider
yet, so it's hard to know what the intention is.
collect_app/src/main/java/org/odk/collect/android/formmanagement/InstancesDataService.kt
Show resolved
Hide resolved
...p/src/main/java/org/odk/collect/android/instancemanagement/FinalizeAllSnackbarPresenter.java
Outdated
Show resolved
Hide resolved
4c9d8a4
to
02b71ea
Compare
|
|
We’re trying a new process where the strings will be finalized separately. So as long as there’s some relevant text it’s ok for now.
Yes. So I guess in an encrypted project nothing could ever be bulk finalized. A more interesting case is when some forms have encryptions and others don’t. |
… in form entry disabled
02b71ea
to
5db872d
Compare
I've updated the branch. Probably it didn't contain all recently merged changes. |
|
|
All dialogs on this branch are in old UI because #5676 was merged to master and will be a part of v2023.4 not v2023.3 |
That message could be improved but as @lognaturel said:
it's ok for now. |
Maybe it would be better to see the |
In v2023.2 we added this: #5416
so if you upgrade from v2022.3.0 the upgrade path is like:
The old |
@lognaturel Could you take one last look at all of our comments before @grzesiek2010 will merge this pull request? |
Tested with Success! Verified on device with Android 10 Verified cases:
|
Tested with Success! Verified on device with Android 13 |
Thank you @srujner and @dbemke! This one is tricky! The strings are fine, we’ll do a pass over all of them in a bit. We’ll talk about how we all liked this process in our retro. Agreed with @grzesiek2010 that the app killing case is ok. I think we should file an issue about settings from versions prior to 2023.2. For completeness, if “Mark as finalized” was hidden and its default value was unchecked (so forms were always saved as draft from form end), I think we should hide the bulk finalize option so we don’t open a path to finalizing. Good find! But again, let’s do it as its own issue. |
Improvements to bulk finalize
Improvements to bulk finalize
Closes #5740
Closes #5763
Closes #5741
Blocked by #5775Why is this the best possible solution? Were any other approaches considered?
Comments inline.
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?
Other than the behaviour described in the three issues, I think testing QR imports/exports would be good as we've added and removed settings keys.
Before submitting this PR, please make sure you have:
./gradlew checkAll
and confirmed all checks still pass OR confirm CircleCI build passes and run./gradlew connectedDebugAndroidTest
locally.