-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fix refreshing profile data #2523
Conversation
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #2523 +/- ##
=========================================
+ Coverage 64.8% 65.4% +0.5%
- Complexity 1050 1095 +45
=========================================
Files 209 213 +4
Lines 9156 9344 +188
Branches 1805 1860 +55
=========================================
+ Hits 5942 6111 +169
+ Misses 2059 2038 -21
- Partials 1155 1195 +40
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Breaking config changesRemovedproperty: " AddedAffected config: Sample "onSubmitActions": [
{
"trigger": "ON_QUESTIONNAIRE_SUBMISSION",
"workflow": "LAUNCH_REGISTER",
"id": "householdRegister",
"display": "All Households",
"popNavigationBackStack": true
}
] |
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
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.
lgtm! test failure looks related to missing fun call mock on eventBus
android/engine/src/main/java/org/smartregister/fhircore/engine/task/FhirTaskUtil.kt
Outdated
Show resolved
Hide resolved
* Check in the task is part of another task and if so check if the parent task is | ||
* completed,cancelled,failed or entered in error. | ||
*/ | ||
private suspend fun Task.preReqConditionSatisfied() = |
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 think we can rename this fun and consolidate the precondition
private suspend fun Task.preReqConditionSatisfied() = | |
private suspend fun Task.preconditionSatisfied() = | |
this.executionStartIsBeforeOrToday() && | |
this.status == Task.TaskStatus.REQUESTED && |
if (task.executionStartIsBeforeOrToday() && | ||
task.status == Task.TaskStatus.REQUESTED && | ||
task.preReqConditionSatisfied() | ||
) { |
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.
why not also consider the above 2 conditions part of the precondition, and add them to that function?
if (task.executionStartIsBeforeOrToday() && | |
task.status == Task.TaskStatus.REQUESTED && | |
task.preReqConditionSatisfied() | |
) { | |
if task.preReqConditionSatisfied() { |
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 see. I think the conditions here are breaking the functionality for marking Tasks as ready. The conditions for updating the dependent Tasks should be separate from the parent Task.
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 see. I think the conditions here are breaking the functionality for marking Tasks as ready. The conditions for updating the dependent Tasks should be separate from the parent Task.
...d/engine/src/main/java/org/smartregister/fhircore/engine/util/extension/ResourceExtension.kt
Outdated
Show resolved
Hide resolved
...d/engine/src/main/java/org/smartregister/fhircore/engine/util/extension/ResourceExtension.kt
Outdated
Show resolved
Hide resolved
android/quest/src/main/java/org/smartregister/fhircore/quest/ui/profile/ProfileFragment.kt
Outdated
Show resolved
Hide resolved
…i/profile/ProfileFragment.kt Co-authored-by: Peter Lubell-Doughtie <peter@ona.io>
…/util/extension/ResourceExtension.kt Co-authored-by: Peter Lubell-Doughtie <peter@ona.io>
…/util/extension/ResourceExtension.kt Co-authored-by: Peter Lubell-Doughtie <peter@ona.io>
…/task/FhirTaskUtil.kt Co-authored-by: Peter Lubell-Doughtie <peter@ona.io>
- Fix Failing tests - Add unit tests ✅
@dubdabasoduba before we split the PR for the 0.2.4 branch could you please confirm that the logic for updating task status is correct? From the logic seems like we:
Note: The above logic was not added by this PR just refactored into it. Also please review the code to confirm my assertions above. |
@ndegwamartin this is correct. We might want to check in with the PMs on enabling dependent tasks when the pre-requisite was CANCELLED, FAILED or ENTEREDINERROR |
@ndegwamartin this works well.
This PR is also needed to avoid a crash on remove family functionality |
Could you let me know which profile you tried opening here? if the profile is related to a household it would work with the |
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
@dubdabasoduba I deleted the conditional checks that relied on the dependent Tasks, for which I needed confirmation from you. |
* Fix refreshing profile data Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com> * Resolve list view not refreshing data Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com> * Handle questionnaire on submission actions Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com> * Fix failing tests Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com> * Update android/quest/src/main/java/org/smartregister/fhircore/quest/ui/profile/ProfileFragment.kt Co-authored-by: Peter Lubell-Doughtie <peter@ona.io> * Update android/engine/src/main/java/org/smartregister/fhircore/engine/util/extension/ResourceExtension.kt Co-authored-by: Peter Lubell-Doughtie <peter@ona.io> * Update android/engine/src/main/java/org/smartregister/fhircore/engine/util/extension/ResourceExtension.kt Co-authored-by: Peter Lubell-Doughtie <peter@ona.io> * Update android/engine/src/main/java/org/smartregister/fhircore/engine/task/FhirTaskUtil.kt Co-authored-by: Peter Lubell-Doughtie <peter@ona.io> * Fix Build 💚 - Fix Failing tests - Add unit tests ✅ * Fix Build 💚 * Fix updating Task status to READY Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com> --------- Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com> Co-authored-by: Peter Lubell-Doughtie <peter@ona.io> Co-authored-by: Martin Ndegwa <ndegwamartin@users.noreply.github.com> Co-authored-by: Martin Ndegwa <mndegwa@ona.io>
IMPORTANT: Where possible all PRs must be linked to a Github issue
Fixes https://github.com/opensrp/fhir-resources/issues/1940
Fixes https://github.com/opensrp/fhir-resources/issues/1695
Engineer Checklist
strings.xml
file./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the project's style guideCode Reviewer Checklist
strings.xml
file