Skip to content

AC-822 added repository layer for lastViewedPatient package#791

Merged
f4ww4z merged 3 commits intoopenmrs:masterfrom
dino-saurabh:AC-822
Aug 3, 2020
Merged

AC-822 added repository layer for lastViewedPatient package#791
f4ww4z merged 3 commits intoopenmrs:masterfrom
dino-saurabh:AC-822

Conversation

@dino-saurabh
Copy link
Collaborator

Description of what I changed

  1. added repository layer for lastViewedPatient package
  2. added necessary changes to tests
  3. Added custom callback

Issue I worked on

JIRA Issue: https://issues.openmrs.org/browse/AC-822

Checklist: I completed these to help reviewers :)

  • My pull request only contains ONE single commit
    (the number above, next to the 'Commits' tab is 1).
  • I have added tests to cover my changes. (If you refactored
    existing code that was well tested you do not have to add tests)
  • All new and existing tests passed.
  • My pull request is based on the latest changes of the master branch.

1. added repository layer for lastViewedPatient package
2. added necessary changes to tests
3. Added custom callback
@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2020

Codecov Report

Merging #791 into master will increase coverage by 0.14%.
The diff coverage is 37.50%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
...lastviewedpatients/LastViewedPatientsActivity.java 0.00% <0.00%> (ø)
.../providerdashboard/ProviderDashboardPresenter.java 37.03% <ø> (ø)
...erdashboard/ProviderManagerDashboardPresenter.java 41.37% <ø> (ø)
...nmrs/mobile/api/repository/ProviderRepository.java 33.59% <ø> (+0.26%) ⬆️
...mobile/api/workers/provider/AddProviderWorker.java 0.00% <ø> (ø)
...ile/api/workers/provider/DeleteProviderWorker.java 0.00% <ø> (ø)
...ile/api/workers/provider/UpdateProviderWorker.java 0.00% <ø> (ø)
...g/openmrs/mobile/utilities/ApplicationConstants.kt 10.00% <ø> (ø)
...enmrs/mobile/api/repository/PatientRepository.java 20.53% <29.72%> (+7.64%) ⬆️
...astviewedpatients/LastViewedPatientsPresenter.java 57.75% <60.71%> (-0.65%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9ae672a...a7fe9d0. Read the comment docs.

@dino-saurabh
Copy link
Collaborator Author

@f4ww4z @rishabh-997 please review !!

Copy link
Collaborator

@f4ww4z f4ww4z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuGO0 See my comments.

callbackListener.onResponse();
}
} else {
ToastUtil.error("Patient[" + patient.getId() + "] cannot be synced due to server error" + response.message());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any error should be caught by the presenter and logged there instead of here. Then use strings.xml for this (since you need Context)

Copy link
Collaborator Author

@dino-saurabh dino-saurabh Aug 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 .

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@f4ww4z Sir, you want these changes in this PR i will push them!! 👍 .

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above comment.

Copy link
Collaborator

@f4ww4z f4ww4z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@dino-saurabh
Copy link
Collaborator Author

@f4ww4z I have those changes locally I forgot to push . I will push them tonight 👍

@dino-saurabh
Copy link
Collaborator Author

@f4ww4z Sir pushed changes please review !!

@dino-saurabh dino-saurabh requested a review from f4ww4z August 3, 2020 13:42
Copy link
Collaborator

@f4ww4z f4ww4z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @LuGO0 !

@f4ww4z f4ww4z merged commit 378b807 into openmrs:master Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants