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

Translation fixes in master #1598

Merged
merged 9 commits into from
Dec 14, 2020
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
2 changes: 1 addition & 1 deletion opensrp-chw/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ android {
}

dependencies {
implementation('org.smartregister:opensrp-client-chw-core:2.0.7-SNAPSHOT@aar') {
implementation('org.smartregister:opensrp-client-chw-core:2.0.8-SNAPSHOT@aar') {
transitive = true
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'androidx.legacy', module: 'legacy-support-v4'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"validate_on_submit": true,
"show_errors_on_submit": false,
"count": "1",
"encounter_type": "Community Responder Registration",
"entity_id": "",
"relational_id": "",
"metadata": {
"start": {
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_data_type": "start",
"openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
"end": {
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_data_type": "end",
"openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
"today": {
"openmrs_entity_parent": "",
"openmrs_entity": "encounter",
"openmrs_entity_id": "encounter_date"
},
"deviceid": {
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_data_type": "deviceid",
"openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
"subscriberid": {
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_data_type": "subscriberid",
"openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
"simserial": {
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_data_type": "simserial",
"openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
"phonenumber": {
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_data_type": "phonenumber",
"openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
"encounter_location": ""
},
"step1": {
"title": "Taarifa ya usafiri wa dharura",
"fields": [
{
"key": "responder_label",
"type": "label",
"text": "Sajili taarifa ya usafiri wa dharura",
"left_padding": "20dp",
"right_padding": "20dp",
"text_size": "7sp",
"text_color": "#000000"
},
{
"key": "responder_name",
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_entity_id": "responder_name",
"type": "edit_text",
"hint": "Jina",
"edit_type": "name",
"v_required": {
"value": "true",
"err": "Tafadhali ingiza jina la usafiri wa dharura"
},
"v_regex": {
"value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*",
"err": "Tafadhali ingiza jina halali"
}
},
{
"key": "responder_phone_number",
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_entity_id": "responder_phone_number",
"type": "edit_text",
"hint": "Namba ya simu",
"v_numeric": {
"value": "true",
"err": "Nambari lazima iwe jumla ya tarakimu 10 kwa urefu"
},
"v_regex": {
"value": "(0[0-9]{9})|\\s*",
"err": "Nambari lazima iwe na tarakimu 10 na lazima ianze na 0."
},
"v_required": {
"value": "true",
"err": "Tafadhali ingiza namba ya simu ya usafiri wa dharura"
}
},
{
"key": "responder_gps",
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_entity_id": "responder_gps",
"openmrs_data_type": "text",
"hint": "Eneo la kawaida",
"type": "gps"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,8 @@ public void goToChildProfileActivity(CommonPersonObjectClient patient, Bundle bu
startActivity(intent);
}

@Override
public void setEventDate(String s) {
// do nothing
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void referToFacility() {
try {
if (BuildConfig.USE_UNIFIED_REFERRAL_APPROACH) {
JSONObject formJson = getFormUtils().getFormJson(Constants.JSON_FORM.getMalariaReferralForm());
formJson.put(Constants.REFERRAL_TASK_FOCUS, referralTypeModels.get(0).getReferralType());
formJson.put(Constants.REFERRAL_TASK_FOCUS, referralTypeModels.get(0).getFocus());
ReferralRegistrationActivity.startGeneralReferralFormActivityForResults(this, baseEntityId, formJson, true);
} else {
startFormActivity(getFormUtils().getFormJson(getReferralTypeModels().get(0).getFormName()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;

import static org.mockito.Mockito.times;

@RunWith(RobolectricTestRunner.class)
@Config(application = ChwApplication.class, sdk = 22)
public class FamilyProfileActivityTest {
Expand Down Expand Up @@ -192,4 +194,16 @@ public void testRefreshMemberFragment() throws Exception {

Mockito.verify(spyActivity).refreshMemberList(FetchStatus.fetched);
}

@Test
public void testSetEventDate() {
FamilyProfileActivity spyActivity = Mockito.spy(activity);
spyActivity.setEventDate(Mockito.anyString());
Mockito.verify(spyActivity, times(1)).setEventDate(Mockito.anyString());
}

@Test
public void testGetPresenter(){
Assert.assertEquals(presenter, activity.getFamilyProfilePresenter());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.smartregister.chw.BaseUnitTest;
import org.smartregister.family.contract.FamilyProfileActivityContract;
Expand Down Expand Up @@ -38,4 +39,11 @@ public void testDefaultSort() {
Assert.assertEquals("visits.visit_date DESC", familyProfileActivityPresenter.getDefaultSortQuery());
}

@Test
public void testGetMainCondition() {
FamilyProfileActivityPresenter familyProfileActivityPresenter = Mockito.spy((FamilyProfileActivityPresenter) presenter);
familyProfileActivityPresenter.getMainCondition();
Mockito.verify(familyProfileActivityPresenter, Mockito.times(1)).getMainCondition();
}

}