-
Notifications
You must be signed in to change notification settings - Fork 221
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
(feat) O3-2255: Using REST endpoint to fetch address template and updated the tests for the address component #769
Conversation
Size Change: -42.5 kB (-2%) Total Size: 2.14 MB
ℹ️ View Unchanged
|
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.
Apologies for semi-hijacking this to make some stricter types. Looks good apart from one bit of commented code left in.
setValidationSchema((validationSchema) => validationSchema.concat(addressValidationSchema)); | ||
} | ||
}, [inEditMode, addressTemplate, initialAddressFieldValues]); | ||
// useEffect(() => { |
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.
We can delete this right?
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, I missed 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.
Hi @ibacher !
This brings to another question.
Do we need the regex validation from the address template to work on the frontend?
Thanks!
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.
@vasharma05 Probably eventually, but it's not the highest priority.
Will the value for |
@denniskigen It looks like we're properly pulling defaults from the address template, so if someone puts a value in there, it will be the default, but we should be able to unset it. |
Thank you @ibacher for the strict typings! Regarding the default @denniskigen, @gracepotma filed this ticket to remove the dev3. As I suggested before as well in the coffee break, I believe we should have a default value in the reference application, let not be Cambodia, but something so that the end user is aware that we have the defaults functioning in the address template. What do you say about this @gracepotma ? |
Requirements
Summary
This PR updates the address component in the patient registration form to fetch the address configuration using the REST endpoint
/es/rest/v1/addresstemplate
. This improves the label provided for the different fields on the form and the translation is also handled on the backend itself.Alongside, the test cases were updated with the new endpoint's results as mock and added new test suite for the address search component.
Screenshots
Related Issue
https://issues.openmrs.org/browse/O3-2255
Other
None.