From 06fd610359cbe7306feafd7b918065125b3651bb Mon Sep 17 00:00:00 2001 From: Benjamin Mwalimu Date: Wed, 11 Dec 2024 12:58:43 +0300 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=94=A7=20Update=20gradle=20configs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/gradle.properties | 8 +++++--- android/gradle/libs.versions.toml | 2 +- android/quest/build.gradle.kts | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/android/gradle.properties b/android/gradle.properties index 4163bed138..4cff8e9071 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -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=-Xmx4608m +org.gradle.jvmargs=-Xmx8g -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 diff --git a/android/gradle/libs.versions.toml b/android/gradle/libs.versions.toml index bf1326ee09..21adfcad9e 100644 --- a/android/gradle/libs.versions.toml +++ b/android/gradle/libs.versions.toml @@ -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" diff --git a/android/quest/build.gradle.kts b/android/quest/build.gradle.kts index ff2834411a..8edbeca100 100644 --- a/android/quest/build.gradle.kts +++ b/android/quest/build.gradle.kts @@ -199,7 +199,10 @@ android { testCoverage { jacocoVersion = BuildConfigs.jacocoVersion } - lint { abortOnError = false } + lint { + checkReleaseBuilds = true + abortOnError = false + } flavorDimensions += "apps" From 49b1e453a01311ed2df1acaa50ca446ef84fc3a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:53:50 +0300 Subject: [PATCH 2/7] Bump nanoid from 3.3.7 to 3.3.8 (#3654) Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8. - [Release notes](https://github.com/ai/nanoid/releases) - [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md) - [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8) --- updated-dependencies: - dependency-name: nanoid dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Elly Kitoto --- package-lock.json | 7 ++++--- yarn.lock | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index e269aaf09b..abe27502b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10495,15 +10495,16 @@ } }, "node_modules/nanoid": { - "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.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, diff --git a/yarn.lock b/yarn.lock index 2ace96069d..f8126b6c43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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== negotiator@0.6.3: version "0.6.3" From 8402be9bd942a507a1884036d869869d4cc63322 Mon Sep 17 00:00:00 2001 From: Fikri Milano Date: Mon, 16 Dec 2024 16:30:30 +0700 Subject: [PATCH 3/7] Update task status on draft submission (#3642) * Trigger task status update on draft submission * Fix QR properties assignment If this function launches another coroutine, any value assigned within this function will be null if accessed from outside before the coroutine completes, as the assignment process has not yet finished at the time of access. * spotless * spotless --- .../ui/questionnaire/QuestionnaireActivity.kt | 8 +++ .../questionnaire/QuestionnaireViewModel.kt | 54 +++++++++---------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireActivity.kt b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireActivity.kt index 9ed3132b57..effb4fdf9d 100644 --- a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireActivity.kt +++ b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireActivity.kt @@ -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() } } diff --git a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt index ecbe982df5..8ad2172d7f 100644 --- a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt +++ b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt @@ -706,42 +706,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, + ) } } From 7767726887fc47e15e5e64d327db459862bf15fd Mon Sep 17 00:00:00 2001 From: Fikri Milano Date: Mon, 16 Dec 2024 16:47:52 +0700 Subject: [PATCH 4/7] Get QR when using summary mode (#3661) --- .../fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt index 8ad2172d7f..30f5d0e220 100644 --- a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt +++ b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt @@ -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 @@ -1136,6 +1137,7 @@ constructor( !resourceIdentifier.isNullOrEmpty() && (questionnaireConfig.isEditable() || questionnaireConfig.isReadOnly() || + questionnaireConfig.isSummary() || questionnaireConfig.saveDraft) ) { defaultRepository From ce5a557901cab03c280c56c8f1512d9769399938 Mon Sep 17 00:00:00 2001 From: Elly Kitoto Date: Mon, 16 Dec 2024 13:48:02 +0300 Subject: [PATCH 5/7] Disable apk minification (#3660) * Disable apk minification Signed-off-by: Elly Kitoto * Format code Signed-off-by: Elly Kitoto --------- Signed-off-by: Elly Kitoto --- android/quest/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/quest/build.gradle.kts b/android/quest/build.gradle.kts index ff2834411a..8c05a99080 100644 --- a/android/quest/build.gradle.kts +++ b/android/quest/build.gradle.kts @@ -116,8 +116,8 @@ android { } getByName("release") { - isMinifyEnabled = true - isShrinkResources = true + isMinifyEnabled = false + isShrinkResources = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro", From f2b8910b5d63454834552026311bafbafb7546d1 Mon Sep 17 00:00:00 2001 From: Fikri Milano Date: Fri, 20 Dec 2024 16:31:11 +0700 Subject: [PATCH 6/7] Add missing Indonesian translation (#3668) --- .../engine/src/main/res/values-in/strings.xml | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/android/engine/src/main/res/values-in/strings.xml b/android/engine/src/main/res/values-in/strings.xml index 9e674f4fc5..d7d55b464b 100644 --- a/android/engine/src/main/res/values-in/strings.xml +++ b/android/engine/src/main/res/values-in/strings.xml @@ -1,9 +1,12 @@ Sinkronisasi manual + Sinkronkan Bahasa Keluar sebagai Tampilkan yang terlambat Cari nama atau nomor ID + Cari nama + SINKRONKAN DATA PINDAI BARCODE Tidak Ada Hasil Maaf, kami tidak dapat menemukan klien dengan nama atau nomor ID tersebut @@ -65,12 +68,15 @@ Apakah Anda yakin ingin membuang jawabannya? Buang perubahan Buang - Simpan sebagian draf + Simpan sebagai draf Batal + Batalkan Perubahan Ya Detail yang diberikan mengalami kesalahan validasi. Atasi kesalahan dan kirim lagi Validasi Gagal OK + Buka draf + Hapus draf Username Password Lupa Password @@ -123,6 +129,7 @@ PELAYANAN SELANJUTNYA KARTU PELAYANAN Pasien lainnya + Pilih lokasi RESPONS (%1$s) Mencoba masuk dengan pengguna lain Mohon tunggu... @@ -144,6 +151,7 @@ Pekan/minggu Hari Menginisiasi pengaturan … + Initializing application … e.g JohnDoe %1$d%% Ada yang salah... @@ -157,6 +165,7 @@ Info perangkat Muat ulang Resources Tidak Disinkronkan + Semua data telah tersinkronisasi Statistik Tersinkronisasi Semua data disinkronkan Diperlukan pengaturan pengguna. Aktifkan koneksi internet Anda @@ -175,4 +184,25 @@ Tanggal Perangkat Versi migrasi data + Oke + TAMBAH + Memulai migrasi data dari versi %1$d + Data aplikasi berhasil dimigrasikan ke versi %1$d + Bantu + Tidak ada data yang disetel + Sinkronisasi selesai + Kesalahan sinkronisasi + Menghitung sisa waktu dalam menit… + %1$d%% Sinkronisasi ke atas… + %1$d%% Sinkronisasi ke bawah… + COBA LAGI + Ada beberapa data yang belum tersinkronisasi + Kontak supervisor hilang atau nomor telepon yang diberikan tidak valid + TERAPKAN FILTER + Simpan perubahan draf + Apakah Anda ingin menyimpan perubahan draf? + Buka perubahan draf + Anda dapat membuka kembali formulir draf yang disimpan untuk melanjutkan atau menghapusnya + Berikutnya + Sebelumnya From 3c3dea1decbaca441f33d5f48146a8eaccd3f799 Mon Sep 17 00:00:00 2001 From: Benjamin Mwalimu Date: Fri, 20 Dec 2024 16:56:26 +0300 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=90=9B=20Add=20row=20weights=20to=20t?= =?UTF-8?q?he=20fix=20top=20bar=20icons=20being=20hidden=20when=20text=20i?= =?UTF-8?q?s=20too=20big=20(#3669)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛 Add Row weights to the top bar * ⬆️ Update the app version --- android/buildSrc/src/main/kotlin/BuildConfigs.kt | 4 ++-- .../fhircore/quest/ui/main/components/TopScreenSection.kt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android/buildSrc/src/main/kotlin/BuildConfigs.kt b/android/buildSrc/src/main/kotlin/BuildConfigs.kt index b4ac17129a..7b8368968e 100644 --- a/android/buildSrc/src/main/kotlin/BuildConfigs.kt +++ b/android/buildSrc/src/main/kotlin/BuildConfigs.kt @@ -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" diff --git a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/main/components/TopScreenSection.kt b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/main/components/TopScreenSection.kt index 29c14d7acc..cf12ec2645 100644 --- a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/main/components/TopScreenSection.kt +++ b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/main/components/TopScreenSection.kt @@ -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 @@ -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, @@ -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 = { _, _ -> },