-
Notifications
You must be signed in to change notification settings - Fork 41
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
Anc issue fix 906 for the human readable values not updating in events when the translation is on #892
Conversation
…' into anc-issue-fix-906 # Conflicts: # gradle.properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests fro the new functionality on the JsonFormUtils
|
||
public void saveUserId(String username, String userId) { | ||
preferences.edit().putString(AllConstants.USER_ID_PREFIX + username, userId).apply(); | ||
} | ||
|
||
public String getUserId(String userName) { | ||
return StringUtils.isNotBlank(userName) ? preferences.getString(AllConstants.USER_ID_PREFIX + userName, null) : ""; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junaidwarsivd What does the user id
do? Why are we concatenating it with the username
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dubdabasoduba these changes are from the https://github.com/opensrp/opensrp-client-core/pull/887/files merge as it has some resolved codacy issues as well as these changes also needs to be merged in the targeted branch issue ref# opensrp/opensrp-client-anc#878
|
||
public void saveUserId(String userName, String baseEntityId) { | ||
if (userName != null) { | ||
allSharedPreferences.saveUserId(userName, baseEntityId); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what we are using the user ID
for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these also came from https://github.com/opensrp/opensrp-client-core/pull/887/files
if(valueOpenMRSAttribute.has(VALUE)) | ||
popupJson.put(VALUE, valueOpenMRSAttribute.getString(VALUE)); | ||
else | ||
popupJson.put(VALUE, valueOpenMRSAttribute.getString(OPENMRS_ENTITY_ID)); | ||
if(valueOpenMRSAttribute.has(TEXT)) | ||
popupJson.put(TEXT,valueOpenMRSAttribute.getString(TEXT)); | ||
if(valueOpenMRSAttribute.has(OPTIONS_FIELD_NAME)) | ||
popupJson.put(OPTIONS_FIELD_NAME,valueOpenMRSAttribute.getJSONArray(OPTIONS_FIELD_NAME)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please share a sample JSON for the popupJson
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dubdabasoduba
{"key":"hiv_test_status","openmrs_entity":"concept","openmrs_entity_id":"165383AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","value":"done_today","text":"Done today","options":[{"key":"done_today","text":"Done today","type":"done_today","openmrs_entity_parent":"","openmrs_entity":"concept","openmrs_entity_id":"165383AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}],"type":"extended_radio_button","openmrs_entity_parent":""}
in options only the selected key is added to avoid the extra looping when filling up the human readable values
…refs' into anc-issue-fix-906
issue reference : opensrp/opensrp-client-anc#906