Skip to content
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

Disable 'Save as draft' when 'Moving backwards' is disabled #5647

Merged
merged 4 commits into from
Jul 5, 2023

Conversation

grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Jun 27, 2023

Closes #5148

What has been done to verify that this works as intended?

I've tested the fix manually and added automated tests.

Why is this the best possible solution? Were any other approaches considered?

There is not much to discuss here. I've handled that new setting in the same way like other settings related to moving backwards/editing forms.

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?

Please test the case described in the issue and generally that the settings that should be disabled when moving backwards is disabled are handled properly.
It's also important to make sure that settings are migrated properly. For example, if moving backwards was disabled in the previous version after upgrading Save as draft should be disabled, and Finalize should be enabled (in Settings -> Access control -> Form Entry Settings).

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:

  • run ./gradlew checkAll and confirmed all checks still pass OR confirm CircleCI build passes and run ./gradlew connectedDebugAndroidTest locally.
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@grzesiek2010 grzesiek2010 marked this pull request as ready for review June 27, 2023 12:19
import org.odk.collect.android.support.rules.TestRuleChain

@RunWith(AndroidJUnit4::class)
class MovingBackwardsTest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the thinking around adding this instead of adding tests to FormEntryAccessPreferencesFragmentTest?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't test disabling moving backwards in isolation (using fragment-scenario like in FormEntryAccessPreferencesFragmentTest) because that fragment displays MovingBackwardsDialog which calls a listener from ProjectPreferencesActivity and then it calls a method from FormEntryAccessPreferencesFragment, so there is that activity involved.

@seadowg seadowg added the high priority Should be looked at before other PRs/issues label Jun 28, 2023
Copy link
Member

@seadowg seadowg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a (potential) test change here. This is ready for QA!

@srujner
Copy link

srujner commented Jul 5, 2023

Tested with Success!

Verified on device with Android 13

Verified cases:

@dbemke
Copy link

dbemke commented Jul 5, 2023

Tested with Success!

Verified on device with Android 10

@seadowg seadowg merged commit 982e981 into getodk:master Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behavior verified high priority Should be looked at before other PRs/issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clicking "Save as draft" when "Moving backwards" is disabled creates inaccessible submissions
4 participants