AC-822 added repository layer for lastViewedPatient package#791
AC-822 added repository layer for lastViewedPatient package#791f4ww4z merged 3 commits intoopenmrs:masterfrom
Conversation
1. added repository layer for lastViewedPatient package 2. added necessary changes to tests 3. Added custom callback
Codecov Report
@@ Coverage Diff @@
## master #791 +/- ##
==========================================
+ Coverage 13.87% 14.01% +0.14%
==========================================
Files 227 227
Lines 9234 9254 +20
Branches 890 893 +3
==========================================
+ Hits 1281 1297 +16
- Misses 7854 7855 +1
- Partials 99 102 +3
Continue to review full report at Codecov.
|
|
@f4ww4z @rishabh-997 please review !! |
openmrs-client/src/main/java/org/openmrs/mobile/api/repository/PatientRepository.java
Outdated
Show resolved
Hide resolved
| callbackListener.onResponse(); | ||
| } | ||
| } else { | ||
| ToastUtil.error("Patient[" + patient.getId() + "] cannot be synced due to server error" + response.message()); |
There was a problem hiding this comment.
Any error should be caught by the presenter and logged there instead of here. Then use strings.xml for this (since you need Context)
There was a problem hiding this comment.
@f4ww4zSir these violations are from matching patients presenter should we keep them to a different PR (for issue AC-826 ) since this one was for lastViewedPatient package?
these came in for review since I just reformatted the code and these were out of formatting standards .
There was a problem hiding this comment.
@f4ww4z Sir, you want these changes in this PR i will push them!! 👍 .
There was a problem hiding this comment.
@LuGO0 I see, nevermind, do it for AC-826
| @Override | ||
| public void onFailure(@NonNull Call<PatientDto> call, @NonNull Throwable t) { | ||
| //string resource added "patient_cannot_be_synced_due_to_request_error_message" | ||
| ToastUtil.notify("Patient[ " + patient.getId() + "] cannot be synced due to request error " + t.toString()); |
There was a problem hiding this comment.
See previous comment. You should call ToastUtil in the presenter.
| //added string resource "patient_update_unsuccessful_server_error" | ||
| ToastUtil.error( | ||
| "Patient " + patient.getPerson().getName().getNameString() + " cannot be updated due to server error will retry sync " + response.message()); | ||
| "Patient " + patient.getPerson().getName().getNameString() + " cannot be updated due to server error will retry sync " + response.message()); |
f4ww4z
left a comment
There was a problem hiding this comment.
@LuGO0 Sorry I didn't realize they were only formatting changes. Address my comments for AC-826. Also push your changes for the
Use the patientDao class variable instead of creating a new one
comment.
openmrs-client/src/main/java/org/openmrs/mobile/api/repository/PatientRepository.java
Outdated
Show resolved
Hide resolved
|
@f4ww4z I have those changes locally I forgot to push . I will push them tonight 👍 |
|
@f4ww4z Sir pushed changes please review !! |
Description of what I changed
Issue I worked on
JIRA Issue: https://issues.openmrs.org/browse/AC-822
Checklist: I completed these to help reviewers :)
(the number above, next to the 'Commits' tab is 1).
existing code that was well tested you do not have to add tests)