-
Notifications
You must be signed in to change notification settings - Fork 59
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
Delete saved draft feature #3631
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3631 +/- ##
=========================================
+ Coverage 27.3% 27.4% +0.1%
- Complexity 787 789 +2
=========================================
Files 282 282
Lines 14699 14695 -4
Branches 2634 2632 -2
=========================================
+ Hits 4023 4040 +17
+ Misses 10132 10100 -32
- Partials 544 555 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
|
move delete draft classes to questionnaire package
Add ability to set alert dialog button color
@@ -43,6 +43,12 @@ enum class AlertIntent { | |||
|
|||
data class AlertDialogListItem(val key: String, val value: String) | |||
|
|||
data class AlertDialogButton( |
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.
nice refactor!
defaultRepository.update(questionnaireResponse) | ||
defaultRepository.addOrUpdate( |
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.
In the unlikely event that one passes and the other fails, might be best to wrap this with a DB transaction.
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'd probably want to create a new method in defaultRespository for this and then within it use the txn block
fhirEngine.withTransaction {
...
}
...d/engine/src/test/java/org/smartregister/fhircore/engine/data/local/DefaultRepositoryTest.kt
Outdated
Show resolved
Hide resolved
val questionnaireResponse = | ||
defaultRepository.searchQuestionnaireResponse( | ||
resourceId = questionnaireConfig.resourceIdentifier!!, | ||
resourceType = questionnaireConfig.resourceType!!, | ||
questionnaireId = questionnaireConfig.id, | ||
encounterId = null, | ||
questionnaireResponseStatus = QuestionnaireResponseStatus.INPROGRESS.toCode(), | ||
) | ||
|
||
if (questionnaireResponse != null) { | ||
questionnaireResponse.status = QuestionnaireResponseStatus.STOPPED | ||
defaultRepository.update(questionnaireResponse) | ||
defaultRepository.addOrUpdate( |
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.
Unless this is covered by another test we can add a unit test to verify that this method QuestionnaireDraftDialogViewModel.deleteDraft
,
- Searches for for the QuestionnaireResponse
- Updates the QuestionnaireResponse
- Creates the AuditEvent
Co-authored-by: Martin Ndegwa <[email protected]>
Missing change on adding the transaction block
IMPORTANT: Where possible all PRs must be linked to a Github issue
Fixes #3605
Link to docs
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