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

Add condition to not populate string value if it's empty #2521

Merged
merged 13 commits into from
Sep 4, 2024

Conversation

FikriMilano
Copy link
Collaborator

@FikriMilano FikriMilano commented Apr 23, 2024

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #2520

Description
Add condition to not populate string value if it's empty

Alternative(s) considered
N/A

Type
Bug fix

Screenshots (if applicable)

Screen.Recording.2024-04-23.at.09.20.54.mov

Checklist

  • I have read and acknowledged the Code of conduct.
  • I have read the Contributing page.
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA.
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach.
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project.
  • I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally.
  • I have built and run the demo app(s) to verify my change fixes the issue and/or does not break the demo app(s).

Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

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

This is great - thanks very much for the contribution and jajoo for reviewing.

@FikriMilano, is there any way you can add a test to this? can you add a test file for optionselectdialogfragment? if it's easy to do we can also add a test in QuestionnaireUiEspressoTest

@FikriMilano
Copy link
Collaborator Author

@jingtang10
I've been working on the test for a while now (as a side quest).

When adding unit test, there's an issue of the view within the fragment giving null values e.g. the dialog title returns null even though it has been assigned with a value (The log has passed the code that assign value to the title).

Another issue that might came up is, accessing the viewModel to check the saved options, but the viewModel is private. I need to add a public getter to for the viewmodel, and mark it as VisibleForTesting, if that's ok.

I've tried espresso, there's no issue with the dialog title value, but there's a bit of an issue with accessing the viewModel flow property with coroutine.

So yeah, continuing on this, let's see what I can do.

ndegwamartin added a commit to opensrp/android-fhir that referenced this pull request Jul 30, 2024
    - With unmerged PR #9
    - WUP PR google#2178

- WUP google#2652
- WUP google#2521
- WUP google#2645
- WUP google#2648
- WUP google#2650
@FikriMilano FikriMilano requested a review from a team as a code owner September 3, 2024 10:40
Copy link
Collaborator

@MJ1998 MJ1998 left a comment

Choose a reason for hiding this comment

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

LGTM

@MJ1998 MJ1998 merged commit cc0dc19 into google:master Sep 4, 2024
6 checks passed
@jingtang10 jingtang10 deleted the 2520-open-choice-missing-string-value branch September 4, 2024 10:29
ndegwamartin pushed a commit to opensrp/android-fhir that referenced this pull request Sep 10, 2024
* Add condition to not populate string value if it's empty

* Revert "Add condition to not populate string value if it's empty"

This reverts commit 6f652e1.

* Filter only non-empty text should be saved

* spotless

* Address review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Open choice missing string value
3 participants