Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues: Closes #307
Scope: Create (or Update) Patient dialog
Requested reviewers: @zestyping
User-visible changes
#307
Do not close patient_dialog_fragment on hitting "Ok". Wait until ItemCreateEvent or ItemUpdatedEvent to dismiss dialog.
Also, disable the Ok button while request is in flight. Re-enable if submission failed.
This means that if a duplicate id is entered by mistake, the user can edit their information and re-submit, instead of having to re-enter everything.
Verification performed
Created new user with duplicate id, and verified dialog was not closed, and that I was able to edit the information and re-submit.
Created new patient without duplicate id. Verified patient was created successfully.
Guidance for reviewers
Would like a second set of eyes to check the event bus wiring. I am concerned about the potential for leaks here.
Guidance for testers
Add and edit patients. Confirm that entering invalid information rejected by the server does not dismiss dialog, but shows error toast, and allows user to re-enter patient data. Confirm that entering correct data is still accepted by server, and dismisses dialog. Confirm that you can't hit "ok" multiple times in quick succession to send multiple requests.