AC-622: Add, Edit,Delete Providers#611
Conversation
Codecov Report
@@ Coverage Diff @@
## master #611 +/- ##
==========================================
- Coverage 14.39% 14.31% -0.08%
==========================================
Files 190 194 +4
Lines 8823 9025 +202
Branches 767 784 +17
==========================================
+ Hits 1270 1292 +22
- Misses 7474 7654 +180
Partials 79 79
Continue to review full report at Codecov.
|
|
@f4ww4z, made the PR. Please review it. |
openmrs-client/src/main/java/org/openmrs/mobile/api/retrofit/ProviderRepository.java
Outdated
Show resolved
Hide resolved
openmrs-client/src/main/java/org/openmrs/mobile/api/retrofit/ProviderRepository.java
Outdated
Show resolved
Hide resolved
openmrs-client/src/main/java/org/openmrs/mobile/api/retrofit/ProviderRepository.java
Outdated
Show resolved
Hide resolved
openmrs-client/src/main/java/org/openmrs/mobile/api/retrofit/ProviderRepository.java
Outdated
Show resolved
Hide resolved
openmrs-client/src/main/java/org/openmrs/mobile/api/retrofit/ProviderRepository.java
Outdated
Show resolved
Hide resolved
openmrs-client/src/main/java/org/openmrs/mobile/api/retrofit/ProviderRepository.java
Outdated
Show resolved
Hide resolved
...ava/org/openmrs/mobile/activities/providermanager/ProviderManagementRecyclerViewAdapter.java
Outdated
Show resolved
Hide resolved
openmrs-client/src/main/java/org/openmrs/mobile/api/RestApi.java
Outdated
Show resolved
Hide resolved
openmrs-client/src/main/java/org/openmrs/mobile/api/retrofit/ProviderRepository.java
Outdated
Show resolved
Hide resolved
openmrs-client/src/main/java/org/openmrs/mobile/api/retrofit/ProviderRepository.java
Outdated
Show resolved
Hide resolved
|
@f4ww4z , now Edit , Delete and Adding Providers are working. |
099cb3e to
0789a2a
Compare
f4ww4z
left a comment
There was a problem hiding this comment.
The UI for all of this looks great! @deepak140596 do address all my comments:
- For
AddProviderscreen, it needs to be following the MVP pattern still, don't put all the code into 1 big class. - To sort these screens out (the 'provider manager dashboard' and the 'add provider' screens), I suggest you rename the
providermanagertoprovidermanagerdashboardand all the classes inside it to follow theProviderManagerDashboardname. Then, create theaddproviderpackage and work on the 'add provider' screen inside it. - Change
provider_managerinstrings.xmltoProvider Manager.
| identifierTIL = findViewById(R.id.add_provider_identifier_til); | ||
|
|
||
| if (editProvider != null) { | ||
| String displayName = editProvider.getPerson().getDisplay(); |
There was a problem hiding this comment.
Did you try accessing the given, middle and family names using getNames ?
There was a problem hiding this comment.
Yes. It always shows the size as 0. I think there is some problem in the backend where the names are store in Display and are lost in the List variable.
There was a problem hiding this comment.
@deepak140596 Can you investigate this and file a new issue?
| String displayName = editProvider.getPerson().getDisplay(); | ||
|
|
||
| firstNameEt.setText(displayName.substring(0, displayName.indexOf(' '))); | ||
| lastNameEt.setText(displayName.substring(displayName.lastIndexOf(' ') + 1)); |
There was a problem hiding this comment.
What is being done here? This complexity is too high.
There was a problem hiding this comment.
It extracts the first and last names of the Provider. I have broken this line into two parts.
...-client/src/main/java/org/openmrs/mobile/activities/providermanager/AddProviderActivity.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
|
|
||
| Person createPerson() { |
There was a problem hiding this comment.
Why did you choose to create this method? You can possibly rename this to createPersonFromUserInput.
...-client/src/main/java/org/openmrs/mobile/activities/providermanager/AddProviderActivity.java
Outdated
Show resolved
Hide resolved
...-client/src/main/java/org/openmrs/mobile/activities/providermanager/AddProviderActivity.java
Outdated
Show resolved
Hide resolved
...-client/src/main/java/org/openmrs/mobile/activities/providermanager/AddProviderActivity.java
Outdated
Show resolved
Hide resolved
|
1 more thing: make sure to add tests to the Presenter of 'add providers' screen, at least. |
f4ww4z
left a comment
There was a problem hiding this comment.
Looks good @deepak140596 !

Description of what I changed
Added Swipe Option menu to delete and edit providers.
Added FAB to add providers.
Created ProviderRepository with Callback.
Created Activity to add and edit providers.
Issue I worked on
JIRA Issue: https://issues.openmrs.org/browse/AC-622
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)