-
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-1831: Registration: Support person attribute of type Location #1032
(feat) O3-1831: Registration: Support person attribute of type Location #1032
Conversation
@usamaidrsk Seems like this is very close. Can you wrap it up and I'll review? |
Ping @usamaidrsk ? It's still failing CI and still a draft. |
This work is being blocked by TRUNK-6246 |
@usamaidrsk Looks like the blocking issue has not been resolved, this is still in draft, and CI is failing. Why did you review request me and Ian? |
...c/patient-registration/field/person-attributes/location-person-attribute-field.component.tsx
Outdated
Show resolved
Hide resolved
...c/patient-registration/field/person-attributes/location-person-attribute-field.component.tsx
Outdated
Show resolved
Hide resolved
...c/patient-registration/field/person-attributes/location-person-attribute-field.component.tsx
Show resolved
Hide resolved
...rc/patient-registration/field/person-attributes/location-person-attribute-field.resource.tsx
Outdated
Show resolved
Hide resolved
...rc/patient-registration/field/person-attributes/location-person-attribute-field.resource.tsx
Outdated
Show resolved
Hide resolved
...rc/patient-registration/field/person-attributes/location-person-attribute-field.resource.tsx
Outdated
Show resolved
Hide resolved
Ping @usamaidrsk , it's been a month... |
Ping again, @usamaidrsk |
Hi @brandones |
294d56b
to
014ab66
Compare
Hello @brandones, this PR is now ready for review |
...on-app/src/patient-registration/field/person-attributes/person-attribute-field.component.tsx
Show resolved
Hide resolved
...c/patient-registration/field/person-attributes/location-person-attribute-field.component.tsx
Outdated
Show resolved
Hide resolved
...c/patient-registration/field/person-attributes/location-person-attribute-field.component.tsx
Outdated
Show resolved
Hide resolved
if (locationOptions.find(({ label }) => label === value)) return; | ||
// If the input is a new value, set the search query | ||
setSearchQuery(value); | ||
// Clear the current selected value since the input doesn't match any existing options | ||
setValue(null); |
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.
I would feel more confident about this if you'd posted a video showing you testing a few cases—starting to type a valid location name, typing nonsense, typing a location name exactly, selecting a location, changing the input text after having selected a location. I think this code makes sense but I don't have 100% confidence in it.
urlSearchParameters.append('_summary', 'data'); | ||
|
||
if (!debouncedSearchQuery) { | ||
urlSearchParameters.append('_count', '5'); |
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 screenshot you posted shows more than 5 locations, with no search query. I guess the screenshot is out of date? Please update it. Ideally with a video.
Also, why such a small number?
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.
I have added the video on the description, and for the count being 5, I was trying to eliminate the scroll on the select dropdown, but I can change that to a number you suggest.
Thanks
Thanks @usamaidrsk . The code looks much better, and the video is helpful. Unfortunately the UX seems quite bad, based on your video. You type "out" and "Outpatient clinic" disappears, you see all options disappear, and then nothing comes up, etc. As a starting point for improving it, I think the list of options should not be cleared until results from the search have been returned by the server. It might also be nice to put a loading spinner on the right side of the input box while new results are loading, to indicate that the user's input to the search input box is being responded to. |
7813ad8
to
92637ef
Compare
Hi @brandones please take a look at this. |
Much better, thanks @usamaidrsk . But having the loading indicator push the dropdown downward creates layout shift, which is a bad UX. Please adjust the loading indicator so that it doesn't create layout shift. Maybe it could float with absolute positioning toward the right side of the input box or something. |
Thanks again @brandones for your feedback on the review.
Regarding the loading indicator, at first I had it as you're suggesting. On desktop, I positioned the indicator on the right side of the input field. However, for tablet view, where the input spans full width, placing the indicator on the right required shrinking the input width while loading and then expanding it back once loading is complete, which seemed not good UX too. I wanted to let you know about that before I do as suggested. Thanks |
@usamaidrsk We should be using a Dropdown here which has a skeleton state to indicate that it's loading. |
Thanks @ibacher cc @brandones |
I see. I'd probably opt for a loading indicator inside the combo box on its right edge. |
Yeah, that sounds good. Could we have done something similar, that I can refer too. |
@usamaidrsk We haven't, but it's just CSS, should be pretty straightforward. Adding something to the right side of an input box (e.g. an eye icon, an x icon) is a very common thing to do, I'm sure there's plenty of info on Google/SO/etc. |
Hi @brandones, I have improved it, see this here! Thanks |
92637ef
to
83d841b
Compare
That looks really nice @usamaidrsk , great work. Hopefully the UX reasoning is clear to you, for future work. |
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.
LGTM
I still think it might be nicer to have a higher limit for the number of locations to load. Feel free to merge this as it is, or to up the limit. Since loading takes so long it might be nice to minimize how many times the user has to wait for that loading to happen in order to find the location they want to select, which I figure would be accomplished by loading a longer list of locations each time. |
(please post a video if you do change it) |
I have increased the number of loactions loaded on searching from 5 to 10. Here is the video |
Yeah I think that makes more sense to me. Thank you @usamaidrsk . And if someone wants to change that number again in the future it's easy enough. |
Thanks @brandones , it was great work here! |
Requirements
Summary
This PR add support for person attribute type Location, on patient registration.
test config
Screenshots
register-location.mp4
Related Issue
O3-1831
Other