-
Notifications
You must be signed in to change notification settings - Fork 426
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
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. |
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.
Thanks @deepak140596 , please address my comments.
Also, what is meant by the toast message at the above image? Can you change it to a phrase?
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
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.
The UI for all of this looks great! @deepak140596 do address all my comments:
- For
AddProvider
screen, 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
providermanager
toprovidermanagerdashboard
and all the classes inside it to follow theProviderManagerDashboard
name. Then, create theaddprovider
package and work on the 'add provider' screen inside it. - Change
provider_manager
instrings.xml
toProvider Manager
.
identifierTIL = findViewById(R.id.add_provider_identifier_til); | ||
|
||
if (editProvider != null) { | ||
String displayName = editProvider.getPerson().getDisplay(); |
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.
Did you try accessing the given, middle and family names using getNames
?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is being done here? This complexity is too high.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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.
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)