Skip to content
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

Fixed patient form editing not working. #4

Merged

Conversation

manuelroemer
Copy link
Member

The patient registration form was not functional as it didn't display the current values of a patient at the moment.
The changes in here (re-)enable that functionality, at least partially.

Required for future work on making the edit form available offline.

Added first fns for offline editing.
@manuelroemer
Copy link
Member Author

There are already some preparations for offline editing in here. These are not the focus of this PR and can absolutely change again in following PRs.

The focus of this one is mainly making the form work again when online.

// `=== false` is here on purpose (`inEditMode` is a triple state value).
// We *only* want to set initial address field values when *creating* a patient.
// We must wait until after loading for this info.
if (inEditMode === false) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only exception to my previous comment.
Overwriting patient address data from the backend with default values seemed wrong to me. I can remove the if here though if that's a wrong assumption on my side.

Copy link
Contributor

@FlorianRappl FlorianRappl left a comment

Choose a reason for hiding this comment

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

LGTM - thanks! 🍻

@FlorianRappl FlorianRappl merged commit bc2e031 into openmrs:main May 27, 2021
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.

2 participants