Skip to content

Commit

Permalink
Merge branch 'main' into fct-bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
dubdabasoduba authored Dec 20, 2024
2 parents ea70827 + 3c3dea1 commit 436c00f
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 47 deletions.
4 changes: 2 additions & 2 deletions android/buildSrc/src/main/kotlin/BuildConfigs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ object BuildConfigs {
const val minSdk = 26
const val compileSdk = 34
const val targetSdk = 34
const val versionCode = 11
const val versionName = "2.0.1"
const val versionCode = 12
const val versionName = "2.0.2"
const val applicationId = "org.smartregister.opensrp"
const val jvmToolchain = 17
const val kotlinCompilerExtensionVersion = "1.5.8"
Expand Down
32 changes: 31 additions & 1 deletion android/engine/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<resources>
<string name="manual_sync">Sinkronisasi manual</string>
<string name="sync">Sinkronkan</string>
<string name="language">Bahasa</string>
<string name="logout_as_user">Keluar sebagai </string>
<string name="show_overdue">Tampilkan yang terlambat</string>
<string name="search_hint">Cari nama atau nomor ID</string>
<string name="search">Cari nama</string>
<string name="sync_data">SINKRONKAN DATA</string>
<string name="scan_bar_code">PINDAI BARCODE</string>
<string name="empty_client_list_message_title">Tidak Ada Hasil</string>
<string name="empty_client_list_message_details">Maaf, kami tidak dapat menemukan klien dengan nama atau nomor ID tersebut</string>
Expand Down Expand Up @@ -65,12 +68,15 @@
<string name="questionnaire_in_progress_alert_back_pressed_message">Apakah Anda yakin ingin membuang jawabannya?</string>
<string name="questionnaire_alert_back_pressed_title">Buang perubahan</string>
<string name="questionnaire_alert_back_pressed_button_title">Buang</string>
<string name="questionnaire_alert_back_pressed_save_draft_button_title">Simpan sebagian draf</string>
<string name="questionnaire_alert_back_pressed_save_draft_button_title">Simpan sebagai draf</string>
<string name="questionnaire_alert_neutral_button_title">Batal</string>
<string name="questionnaire_alert_negative_button_title">Batalkan Perubahan</string>
<string name="questionnaire_alert_confirm_button_title">Ya</string>
<string name="questionnaire_alert_invalid_message">Detail yang diberikan mengalami kesalahan validasi. Atasi kesalahan dan kirim lagi</string>
<string name="questionnaire_alert_invalid_title">Validasi Gagal</string>
<string name="questionnaire_alert_ack_button_title">OK</string>
<string name="questionnaire_alert_open_draft_button_title">Buka draf</string>
<string name="questionnaire_alert_delete_draft_button_title">Hapus draf</string>
<string name="username">Username</string>
<string name="password">Password</string>
<string name="forgot_password">Lupa Password</string>
Expand Down Expand Up @@ -123,6 +129,7 @@
<string name="upcoming_services">PELAYANAN SELANJUTNYA</string>
<string name="service_card">KARTU PELAYANAN</string>
<string name="other_patients">Pasien lainnya</string>
<string name="select_location">Pilih lokasi</string>
<string name="responses">RESPONS (%1$s)</string>
<string name="multi_user_login_attempt">Mencoba masuk dengan pengguna lain</string>
<string name="please_wait">Mohon tunggu...</string>
Expand All @@ -144,6 +151,7 @@
<string name="weeks">Pekan/minggu</string>
<string name="days">Hari</string>
<string name="initializing">Menginisiasi pengaturan &#8230;</string>
<string name="initializing_application">Initializing application &#8230;</string>
<string name="username_sample" translatable="false">e.g JohnDoe</string>
<string name="percentage_progress" translatable="false">%1$d%%</string>
<string name="error_occurred">Ada yang salah...</string>
Expand All @@ -157,6 +165,7 @@
<string name="device_info">Info perangkat</string>
<string name="refresh">Muat ulang</string>
<string name="unsynced_resources">Resources Tidak Disinkronkan</string>
<string name="all_resources_synced">Semua data telah tersinkronisasi</string>
<string name="synced_statistics">Statistik Tersinkronisasi</string>
<string name="all_data_synced">Semua data disinkronkan</string>
<string name="invalid_offline_login_state">Diperlukan pengaturan pengguna. Aktifkan koneksi internet Anda</string>
Expand All @@ -175,4 +184,25 @@
<string name="device_date">Tanggal</string>
<string name="device">Perangkat</string>
<string name="data_migration_version">Versi migrasi data</string>
<string name="ok">Oke</string>
<string name="add">TAMBAH</string>
<string name="data_migration_started">Memulai migrasi data dari versi %1$d</string>
<string name="data_migration_completed">Data aplikasi berhasil dimigrasikan ke versi %1$d</string>
<string name="help">Bantu</string>
<string name="no_data">Tidak ada data yang disetel</string>
<string name="sync_complete">Sinkronisasi selesai</string>
<string name="sync_error">Kesalahan sinkronisasi</string>
<string name="minutes_remaining">Menghitung sisa waktu dalam menit…</string>
<string name="sync_up_inprogress">%1$d%% Sinkronisasi ke atas…</string>
<string name="sync_down_inprogress">%1$d%% Sinkronisasi ke bawah…</string>
<string name="retry">COBA LAGI</string>
<string name="unsynced_data_present">Ada beberapa data yang belum tersinkronisasi</string>
<string name="missing_supervisor_contact">Kontak supervisor hilang atau nomor telepon yang diberikan tidak valid</string>
<string name="apply_filter">TERAPKAN FILTER</string>
<string name="questionnaire_save_draft_title">Simpan perubahan draf</string>
<string name="questionnaire_save_draft_message">Apakah Anda ingin menyimpan perubahan draf?</string>
<string name="open_draft_changes_title">Buka perubahan draf</string>
<string name="open_draft_changes_message">Anda dapat membuka kembali formulir draf yang disimpan untuk melanjutkan atau menghapusnya</string>
<string name="button_pagination_next">Berikutnya</string>
<string name="button_pagination_previous">Sebelumnya</string>
</resources>
8 changes: 5 additions & 3 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx6144m
org.gradle.jvmargs=-Xmx10g -XX:MaxMetaspaceSize=4g

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

org.gradle.daemon=true
android.useAndroidX=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.suppressUnsupportedCompileSdk=34
android.jetifier.ignorelist=jackson-core
#org.gradle.daemon.max-idle-time=10800000 // 3 hours in milliseconds

org.gradle.warning.mode=all
org.gradle.configuration-cache=true
org.gradle.caching=false
org.gradle.parallel=true
org.gradle.configureondemand=true

android.enableR8.fullMode=true
android.enableR8.fullMode=false
2 changes: 1 addition & 1 deletion android/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ androidx-test= "1.6.2"
appcompat = "1.7.0"
benchmark-junit = "1.3.3"
cardview = "1.0.0"
common-utils = "1.0.0-SNAPSHOT"
common-utils = "1.0.1-SNAPSHOT"
compose-ui = "1.6.8"
compressor = "3.0.1"
constraintlayout = "2.1.4"
Expand Down
9 changes: 6 additions & 3 deletions android/quest/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ android {
}

getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
isMinifyEnabled = false
isShrinkResources = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
Expand Down Expand Up @@ -199,7 +199,10 @@ android {

testCoverage { jacocoVersion = BuildConfigs.jacocoVersion }

lint { abortOnError = false }
lint {
checkReleaseBuilds = true
abortOnError = false
}

flavorDimensions += "apps"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fun TopScreenSection(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
) {
Row(verticalAlignment = Alignment.CenterVertically) {
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.weight(4f)) {
Icon(
when (toolBarHomeNavigation) {
ToolBarHomeNavigation.OPEN_DRAWER -> Icons.Filled.Menu
Expand All @@ -169,7 +169,7 @@ fun TopScreenSection(

Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(start = 8.dp),
modifier = Modifier.padding(start = 8.dp).weight(1f),
) {
SetupToolbarIcons(
menuIcons = topScreenSection?.menuIcons,
Expand Down Expand Up @@ -412,7 +412,7 @@ private fun RenderMenuIcon(
@Composable
fun TopScreenSectionWithFilterItemOverNinetyNinePreview() {
TopScreenSection(
title = "All Clients",
title = "All Clients All Clients All Clients All Clients All Clients",
searchQuery = SearchQuery("Eddy"),
filteredRecordsCount = 120,
onSearchTextChanged = { _, _ -> },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,14 @@ class QuestionnaireActivity : BaseMultiLanguageActivity() {
lifecycleScope.launch {
retrieveQuestionnaireResponse()?.let { questionnaireResponse ->
viewModel.saveDraftQuestionnaire(questionnaireResponse, questionnaireConfig)
setResult(
Activity.RESULT_OK,
Intent().apply {
putExtra(QUESTIONNAIRE_RESPONSE, questionnaireResponse as Serializable)
putExtra(QUESTIONNAIRE_CONFIG, questionnaireConfig as Parcelable)
putExtra(ON_RESULT_TYPE, ActivityOnResultType.QUESTIONNAIRE.name)
},
)
finish()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import org.smartregister.fhircore.engine.domain.model.ActionParameter
import org.smartregister.fhircore.engine.domain.model.ActionParameterType
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.rulesengine.RulesExecutor
import org.smartregister.fhircore.engine.task.FhirCarePlanGenerator
import org.smartregister.fhircore.engine.util.DispatcherProvider
Expand Down Expand Up @@ -706,42 +707,40 @@ constructor(
* This function saves [QuestionnaireResponse] as draft if any of the [QuestionnaireResponse.item]
* has an answer.
*/
fun saveDraftQuestionnaire(
suspend fun saveDraftQuestionnaire(
questionnaireResponse: QuestionnaireResponse,
questionnaireConfig: QuestionnaireConfig,
) {
viewModelScope.launch {
val hasPages = questionnaireResponse.item.any { it.hasItem() }
val questionnaireHasAnswer =
questionnaireResponse.item.any {
if (!hasPages) {
it.answer.any { answerComponent -> answerComponent.hasValue() }
} else {
questionnaireResponse.item.any { page ->
page.item.any { pageItem ->
pageItem.answer.any { answerComponent -> answerComponent.hasValue() }
}
val hasPages = questionnaireResponse.item.any { it.hasItem() }
val questionnaireHasAnswer =
questionnaireResponse.item.any {
if (!hasPages) {
it.answer.any { answerComponent -> answerComponent.hasValue() }
} else {
questionnaireResponse.item.any { page ->
page.item.any { pageItem ->
pageItem.answer.any { answerComponent -> answerComponent.hasValue() }
}
}
}
questionnaireResponse.questionnaire =
questionnaireConfig.id.asReference(ResourceType.Questionnaire).reference
if (
!questionnaireConfig.resourceIdentifier.isNullOrBlank() &&
questionnaireConfig.resourceType != null
) {
questionnaireResponse.subject =
questionnaireConfig.resourceIdentifier!!.asReference(
questionnaireConfig.resourceType!!,
)
}
if (questionnaireHasAnswer) {
questionnaireResponse.status = QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS
defaultRepository.addOrUpdate(
addMandatoryTags = true,
resource = questionnaireResponse,
questionnaireResponse.questionnaire =
questionnaireConfig.id.asReference(ResourceType.Questionnaire).reference
if (
!questionnaireConfig.resourceIdentifier.isNullOrBlank() &&
questionnaireConfig.resourceType != null
) {
questionnaireResponse.subject =
questionnaireConfig.resourceIdentifier!!.asReference(
questionnaireConfig.resourceType!!,
)
}
}
if (questionnaireHasAnswer) {
questionnaireResponse.status = QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS
defaultRepository.addOrUpdate(
addMandatoryTags = true,
resource = questionnaireResponse,
)
}
}

Expand Down Expand Up @@ -1138,6 +1137,7 @@ constructor(
!resourceIdentifier.isNullOrEmpty() &&
(questionnaireConfig.isEditable() ||
questionnaireConfig.isReadOnly() ||
questionnaireConfig.isSummary() ||
questionnaireConfig.saveDraft)
) {
defaultRepository
Expand Down
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5990,9 +5990,9 @@ multicast-dns@^7.2.5:
thunky "^1.0.2"

nanoid@^3.3.7:
version "3.3.7"
resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz"
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==
version "3.3.8"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf"
integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==

[email protected]:
version "0.6.3"
Expand Down

0 comments on commit 436c00f

Please sign in to comment.