From aaada6d51c068f96f3f26d552eeeb654fcf9f261 Mon Sep 17 00:00:00 2001 From: paulinembabu Date: Thu, 18 Mar 2021 15:58:43 +0300 Subject: [PATCH] Bumps up Depedency versions --- opensrp-giz-malawi/build.gradle | 19 ++-- .../giz/application/GizMalawiApplication.java | 4 +- .../GizMaternityPncTransferProcessor.java | 3 +- .../giz/fragment/ChildRegisterFragment.java | 21 ++-- .../giz/model/CheckChildDetailsModel.java | 8 +- .../giz/repository/GizMalawiRepository.java | 4 + .../giz/util/GizJsonFormUtils.java | 2 +- .../src/main/res/layout/tool_bar.xml | 104 ++++++++++-------- 8 files changed, 94 insertions(+), 71 deletions(-) diff --git a/opensrp-giz-malawi/build.gradle b/opensrp-giz-malawi/build.gradle index f9931447b..132e8b788 100644 --- a/opensrp-giz-malawi/build.gradle +++ b/opensrp-giz-malawi/build.gradle @@ -113,7 +113,7 @@ android { buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '100' buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' buildConfigField "int", "VACCINE_SYNC_TIME", '0' - buildConfigField "int", "DATABASE_VERSION", '12' + buildConfigField "int", "DATABASE_VERSION", '13' buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l" buildConfigField "boolean", "TIME_CHECK", "true" buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '15' @@ -141,7 +141,7 @@ android { buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10' buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' buildConfigField "int", "VACCINE_SYNC_TIME", '0' - buildConfigField "int", "DATABASE_VERSION", '12' + buildConfigField "int", "DATABASE_VERSION", '13' buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l" buildConfigField "boolean", "TIME_CHECK", "true" buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '15' @@ -168,7 +168,7 @@ android { buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '100' buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' buildConfigField "int", "VACCINE_SYNC_TIME", '0' - buildConfigField "int", "DATABASE_VERSION", '12' + buildConfigField "int", "DATABASE_VERSION", '13' buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l" buildConfigField "boolean", "TIME_CHECK", "true" buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '15' @@ -191,7 +191,7 @@ android { buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '100' buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' buildConfigField "int", "VACCINE_SYNC_TIME", '0' - buildConfigField "int", "DATABASE_VERSION", '12' + buildConfigField "int", "DATABASE_VERSION", '13' buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l" buildConfigField "boolean", "TIME_CHECK", "true" buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '15' @@ -246,8 +246,7 @@ dependencies { exclude group: 'org.smartregister', module: 'opensrp-client-configurable-views' exclude group: 'com.android.support', module: 'appcompat-v7' } - - implementation('org.smartregister:opensrp-client-child:0.5.0-SNAPSHOT@aar') { + implementation('org.smartregister:opensrp-client-child:0.6.9-SNAPSHOT@aar') { transitive = true exclude group: 'id.zelory', module: 'compressor' exclude group: 'org.smartregister', module: 'opensrp-client-core' @@ -279,7 +278,7 @@ dependencies { exclude group: 'io.ona.rdt-capture', module: 'lib' } - api('org.smartregister:opensrp-client-core:3.3.1-SNAPSHOT@aar') { + api('org.smartregister:opensrp-client-core:4.2.13-SNAPSHOT@aar') { transitive = true exclude group: 'id.zelory', module: 'compressor' exclude group: 'com.github.bmelnychuk', module: 'atv' @@ -294,7 +293,7 @@ dependencies { exclude group: 'com.ibm.fhir', module: 'fhir-model' } - implementation('org.smartregister:opensrp-client-maternity:0.0.7-SNAPSHOT@aar') { + implementation('org.smartregister:opensrp-client-maternity:0.0.8-SNAPSHOT@aar') { transitive = true exclude group: 'id.zelory', module: 'compressor' exclude group: 'org.smartregister', module: 'opensrp-client-core' @@ -303,7 +302,7 @@ dependencies { exclude group: 'com.android.support', module: 'appcompat-v7' } - api('org.smartregister:opensrp-client-pnc:0.0.5-SNAPSHOT@aar') { + api('org.smartregister:opensrp-client-pnc:0.0.6-SNAPSHOT@aar') { transitive = true exclude group: 'id.zelory', module: 'compressor' exclude group: 'org.smartregister', module: 'opensrp-client-core' @@ -312,7 +311,7 @@ dependencies { exclude group: 'com.android.support', module: 'appcompat-v7' } - api('org.smartregister:opensrp-client-immunization:1.4.43-SNAPSHOT@aar') { + api('org.smartregister:opensrp-client-immunization:3.0.7-SNAPSHOT@aar') { transitive = true exclude group: 'id.zelory', module: 'compressor' exclude group: 'org.smartregister', module: 'opensrp-client-core' diff --git a/opensrp-giz-malawi/src/main/java/org/smartregister/giz/application/GizMalawiApplication.java b/opensrp-giz-malawi/src/main/java/org/smartregister/giz/application/GizMalawiApplication.java index 984e205b9..0e91d6f4f 100644 --- a/opensrp-giz-malawi/src/main/java/org/smartregister/giz/application/GizMalawiApplication.java +++ b/opensrp-giz-malawi/src/main/java/org/smartregister/giz/application/GizMalawiApplication.java @@ -579,7 +579,7 @@ public ECSyncHelper getEcSyncHelper() { @VisibleForTesting protected void fixHardcodedVaccineConfiguration() { - VaccineRepo.Vaccine[] vaccines = ImmunizationLibrary.getInstance().getVaccines(); + VaccineRepo.Vaccine[] vaccines = ImmunizationLibrary.getInstance().getVaccines("child"); HashMap replacementVaccines = new HashMap<>(); replacementVaccines.put("MR 2", new VaccineDuplicate("MR 2", VaccineRepo.Vaccine.mr1, -1, 548, 183, "child")); @@ -597,7 +597,7 @@ protected void fixHardcodedVaccineConfiguration() { } } - ImmunizationLibrary.getInstance().setVaccines(vaccines); + ImmunizationLibrary.getInstance().setVaccines(vaccines, "child"); } public DailyTalliesRepository dailyTalliesRepository() { diff --git a/opensrp-giz-malawi/src/main/java/org/smartregister/giz/configuration/GizMaternityPncTransferProcessor.java b/opensrp-giz-malawi/src/main/java/org/smartregister/giz/configuration/GizMaternityPncTransferProcessor.java index 422d3639a..4207af4b0 100644 --- a/opensrp-giz-malawi/src/main/java/org/smartregister/giz/configuration/GizMaternityPncTransferProcessor.java +++ b/opensrp-giz-malawi/src/main/java/org/smartregister/giz/configuration/GizMaternityPncTransferProcessor.java @@ -20,6 +20,7 @@ import org.smartregister.maternity.utils.MaternityConstants; import org.smartregister.maternity.utils.MaternityDbConstants; +import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -130,7 +131,7 @@ public JSONObject populateTransferForm(JSONObject maternityOutComeForm) { } } } - } catch (JSONException e) { + } catch (JSONException | IOException e) { Timber.e(e); } return jsonForm; diff --git a/opensrp-giz-malawi/src/main/java/org/smartregister/giz/fragment/ChildRegisterFragment.java b/opensrp-giz-malawi/src/main/java/org/smartregister/giz/fragment/ChildRegisterFragment.java index 3a8c15f3d..fd323805b 100644 --- a/opensrp-giz-malawi/src/main/java/org/smartregister/giz/fragment/ChildRegisterFragment.java +++ b/opensrp-giz-malawi/src/main/java/org/smartregister/giz/fragment/ChildRegisterFragment.java @@ -2,10 +2,10 @@ import android.view.View; import android.widget.CompoundButton; +import android.widget.ImageView; import android.widget.Toast; import androidx.appcompat.widget.SwitchCompat; -import androidx.appcompat.widget.Toolbar; import org.smartregister.child.domain.RegisterClickables; import org.smartregister.child.fragment.BaseChildRegisterFragment; @@ -20,7 +20,6 @@ import org.smartregister.giz.presenter.ChildRegisterFragmentPresenter; import org.smartregister.giz.util.AppExecutors; import org.smartregister.giz.util.DBQueryHelper; -import org.smartregister.giz.view.NavigationMenu; import org.smartregister.immunization.job.VaccineSchedulesUpdateJob; import org.smartregister.view.activity.BaseRegisterActivity; @@ -158,13 +157,17 @@ protected void onViewClicked(View view) { @Override public void onResume() { super.onResume(); - Toolbar toolbar = view.findViewById(R.id.toolbar); - toolbar.setContentInsetsAbsolute(0, 0); - toolbar.setContentInsetsRelative(0, 0); - toolbar.setContentInsetStartWithNavigation(0); - toolbar.setNavigationIcon(R.drawable.ic_action_menu); - - NavigationMenu.getInstance(getActivity(), null, toolbar); + ImageView hamburgerMenu = view.findViewById(R.id.left_menu); + if (hamburgerMenu != null) { + hamburgerMenu.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (getActivity() instanceof ChildRegisterActivity) { + ((ChildRegisterActivity) getActivity()).openDrawer(); + } + } + }); + } } @Override diff --git a/opensrp-giz-malawi/src/main/java/org/smartregister/giz/model/CheckChildDetailsModel.java b/opensrp-giz-malawi/src/main/java/org/smartregister/giz/model/CheckChildDetailsModel.java index d429facae..bbc6f6d61 100644 --- a/opensrp-giz-malawi/src/main/java/org/smartregister/giz/model/CheckChildDetailsModel.java +++ b/opensrp-giz-malawi/src/main/java/org/smartregister/giz/model/CheckChildDetailsModel.java @@ -80,7 +80,7 @@ public CheckChildDetailsModel invoke() { this.lostToFollowUp = ""; if (client.has(GizConstants.KEY.CHILD)) { - JSONObject child = GizJsonFormUtils.getJsonObject(client, GizConstants.KEY.CHILD); + JSONObject child = GizJsonFormUtils.getGizJsonObject(client, GizConstants.KEY.CHILD); // Skip deceased children if (StringUtils.isNotBlank(GizJsonFormUtils.getJsonString(child, GizConstants.KEY.DEATHDATE))) { @@ -105,13 +105,13 @@ public CheckChildDetailsModel invoke() { } } - zeirId = GizJsonFormUtils.getJsonString(GizJsonFormUtils.getJsonObject(child, GizConstants.KEY.IDENTIFIERS), ChildJsonFormUtils.ZEIR_ID); + zeirId = GizJsonFormUtils.getJsonString(GizJsonFormUtils.getGizJsonObject(child, GizConstants.KEY.IDENTIFIERS), ChildJsonFormUtils.ZEIR_ID); if (StringUtils.isNotBlank(zeirId)) { zeirId = zeirId.replace("-", ""); } - inactive = GizJsonFormUtils.getJsonString(GizJsonFormUtils.getJsonObject(child, GizConstants.KEY.ATTRIBUTES), GizConstants.KEY.INACTIVE); - lostToFollowUp = GizJsonFormUtils.getJsonString(GizJsonFormUtils.getJsonObject(child, GizConstants.KEY.ATTRIBUTES), GizConstants.KEY.LOST_TO_FOLLOW_UP); + inactive = GizJsonFormUtils.getJsonString(GizJsonFormUtils.getGizJsonObject(child, GizConstants.KEY.ATTRIBUTES), GizConstants.KEY.INACTIVE); + lostToFollowUp = GizJsonFormUtils.getJsonString(GizJsonFormUtils.getGizJsonObject(child, GizConstants.KEY.ATTRIBUTES), GizConstants.KEY.LOST_TO_FOLLOW_UP); } myResult = false; return this; diff --git a/opensrp-giz-malawi/src/main/java/org/smartregister/giz/repository/GizMalawiRepository.java b/opensrp-giz-malawi/src/main/java/org/smartregister/giz/repository/GizMalawiRepository.java index b673849ce..4b834b7b2 100644 --- a/opensrp-giz-malawi/src/main/java/org/smartregister/giz/repository/GizMalawiRepository.java +++ b/opensrp-giz-malawi/src/main/java/org/smartregister/giz/repository/GizMalawiRepository.java @@ -188,6 +188,10 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { case 12: EventClientRepository.createAdditionalColumns(db); break; + case 13: + db.execSQL(VaccineRepository.UPDATE_TABLE_ADD_IS_VOIDED_COL); + db.execSQL(VaccineRepository.UPDATE_TABLE_ADD_IS_VOIDED_COL_INDEX); + break; default: break; } diff --git a/opensrp-giz-malawi/src/main/java/org/smartregister/giz/util/GizJsonFormUtils.java b/opensrp-giz-malawi/src/main/java/org/smartregister/giz/util/GizJsonFormUtils.java index 7afd322bc..bbe13d7cb 100644 --- a/opensrp-giz-malawi/src/main/java/org/smartregister/giz/util/GizJsonFormUtils.java +++ b/opensrp-giz-malawi/src/main/java/org/smartregister/giz/util/GizJsonFormUtils.java @@ -186,7 +186,7 @@ public static String getJsonString(JSONObject jsonObject, String field) { return ""; } - public static JSONObject getJsonObject(JSONObject jsonObject, String field) { + public static JSONObject getGizJsonObject(JSONObject jsonObject, String field) { try { if (jsonObject != null && jsonObject.has(field)) { return jsonObject.getJSONObject(field); diff --git a/opensrp-giz-malawi/src/main/res/layout/tool_bar.xml b/opensrp-giz-malawi/src/main/res/layout/tool_bar.xml index dbb0aaab0..b7bcf9fda 100644 --- a/opensrp-giz-malawi/src/main/res/layout/tool_bar.xml +++ b/opensrp-giz-malawi/src/main/res/layout/tool_bar.xml @@ -5,49 +5,65 @@ android:layout_height="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto"> - + + + + + + + + + + + + - - - - - - - - - - + android:layout_height="match_parent" + android:layout_margin="0dp"> + + + + + + \ No newline at end of file