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

Save the help card visibility in a Set #2357

Merged
merged 19 commits into from
Feb 1, 2024

Conversation

FikriMilano
Copy link
Collaborator

@FikriMilano FikriMilano commented Dec 7, 2023

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

Fixes #2356

Description

  1. Create a Set that keeps the Questionnaire Item of the help card, if the Questionnaire Item of that help card exists in the state flow, then that help card will be visible when the screen got re-rendered i.e. when changing answer
  2. Create a callback to save the help card visibility to the Set

Alternative(s) considered
N/A

Type
Bug fix

Screenshots (if applicable)

Screen_recording_20231207_160124.webm

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).

@FikriMilano FikriMilano requested review from santosh-pingle and a team as code owners December 7, 2023 08:58
@FikriMilano FikriMilano force-pushed the 2356-save-help-card-state branch from b044821 to 984459e Compare December 22, 2023 09:30
@FikriMilano
Copy link
Collaborator Author

@jingtang10 this is ready for review again.
Also, please have a nice holiday :D

@FikriMilano FikriMilano changed the title Save the help card visibility in a state flow Save the help card visibility in a Set Jan 19, 2024
@FikriMilano
Copy link
Collaborator Author

@jingtang10 this PR is ready for review

@jingtang10 jingtang10 enabled auto-merge (squash) January 31, 2024 15:32
@jingtang10 jingtang10 merged commit ab3b5ec into google:master Feb 1, 2024
3 checks passed
@jingtang10 jingtang10 deleted the 2356-save-help-card-state branch February 1, 2024 01:25
sharon2719 pushed a commit to opensrp/android-fhir that referenced this pull request Feb 6, 2024
* Save the help card visibility in a state flow

* spotless

* Use Set to avoid duplication

* Use stateFlow.update{ }

* Use boolean instead of int and remove dependency to the View class

* Add default value for helpCardStateChangedCallback

* Address review

* Fix test

* Unwrap set from state flow

* Remove .invoke from callback

* Change openedHelpCardSet type from QuestionnaireItem to QrItem

* spotlessApply
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.

help info box disappears after changing answer
2 participants