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

Fix response not showing in summary mode #3670

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import org.smartregister.fhircore.engine.domain.model.ActionParameterType
import org.smartregister.fhircore.engine.domain.model.RuleConfig
import org.smartregister.fhircore.engine.domain.model.isEditable
import org.smartregister.fhircore.engine.domain.model.isReadOnly
import org.smartregister.fhircore.engine.domain.model.isSummary
import org.smartregister.fhircore.engine.util.castToType

fun QuestionnaireResponse.QuestionnaireResponseItemComponent.asLabel() =
Expand Down Expand Up @@ -298,10 +299,11 @@ suspend fun Questionnaire.prepopulateUniqueIdAssignment(
* Determines the [QuestionnaireResponse.Status] depending on the [saveDraft] and [isEditable]
* values contained in the [QuestionnaireConfig]
*
* returns [COMPLETED] when [isEditable] is [true] returns [INPROGRESS] when [saveDraft] is [true]
* returns [COMPLETED] when [isEditable] or [isSummary] is [true] returns [INPROGRESS] when
* [saveDraft] is [true]
*/
fun QuestionnaireConfig.questionnaireResponseStatus(): String? {
return if (this.isEditable()) {
return if (this.isEditable() || this.isSummary()) {
QuestionnaireResponseStatus.COMPLETED.toCode()
} else if (this.saveDraft) {
QuestionnaireResponseStatus.INPROGRESS.toCode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class QuestionnaireActivity : BaseMultiLanguageActivity() {
}

private fun handleBackPress() {
if (questionnaireConfig.isReadOnly()) {
if (questionnaireConfig.isReadOnly() || questionnaireConfig.isSummary()) {
finish()
} else if (questionnaireConfig.saveDraft) {
AlertDialogue.showThreeButtonAlert(
Expand Down
Loading