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 summary mode #3500

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -22,6 +22,7 @@ enum class QuestionnaireType {
DEFAULT,
EDIT,
READ_ONLY,
SUMMARY,
}

fun QuestionnaireConfig.isDefault() =
Expand All @@ -32,3 +33,6 @@ fun QuestionnaireConfig.isEditable() =

fun QuestionnaireConfig.isReadOnly() =
QuestionnaireType.valueOf(this.type) == QuestionnaireType.READ_ONLY

fun QuestionnaireConfig.isSummary() =
QuestionnaireType.valueOf(this.type) == QuestionnaireType.SUMMARY
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.smartregister.fhircore.engine.configuration.app.LocationLogOptions
import org.smartregister.fhircore.engine.domain.model.ActionParameter
import org.smartregister.fhircore.engine.domain.model.isReadOnly
import org.smartregister.fhircore.engine.domain.model.isSummary
import org.smartregister.fhircore.engine.ui.base.AlertDialogue
import org.smartregister.fhircore.engine.ui.base.BaseMultiLanguageActivity
import org.smartregister.fhircore.engine.util.DispatcherProvider
Expand Down Expand Up @@ -282,6 +283,7 @@
)
.showAsterisk(this.questionnaireConfig.showRequiredTextAsterisk)
.showRequiredText(this.questionnaireConfig.showRequiredText)
.setIsReadOnly(questionnaireConfig.isSummary())

Check warning on line 286 in android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireActivity.kt

View check run for this annotation

Codecov / codecov/patch

android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireActivity.kt#L286

Added line #L286 was not covered by tests
FikriMilano marked this conversation as resolved.
Show resolved Hide resolved
.apply {
if (questionnaireResponse != null) {
questionnaireResponse
Expand Down
Loading