-
Notifications
You must be signed in to change notification settings - Fork 238
HTML-885: Add a way to input provider obs with autocomplete search #337
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,14 @@ public Object getProviders(@RequestParam(value = "searchParam", required = false | |
|
|
||
| List<Provider> providerList = HtmlFormEntryUtil.getProviders(providerRoleIds, true); | ||
|
|
||
| /* | ||
| * A frontend bug makes it possible for the matchMode to be null, when the element is considered rendered with <controls>; | ||
| * see HTML-887. In that case, we default to MatchMode.ANYWHERE. | ||
| */ | ||
| if (matchMode == null) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By default, the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So if I'm understanding it correctly, you discovered that match mode doesn't work when hidden within a controls/when? Now, if you specific another match mode rather than "ANYWHERE" but within a controls/when, does it revert to "ANYWHERE", or is it only a problem in the "default" case? If you've confirmed there's no easy way to fix this, I'm okay with this workaround, but let's add some of the notes above as a comment in the code (and add a quick note to the text on the limitations--ie don't use match mode within a when/then).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. If I put I haven't actually implemented I will:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| matchMode = MatchMode.ANYWHERE; | ||
| } | ||
|
|
||
| List<ProviderStub> stubs; | ||
| if (searchParam == null) { | ||
| stubs = HtmlFormEntryUtil.getProviderStubs(providerList); | ||
|
|
||
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 don't love setting the primary key id to the value - it would be much better if this were the uuid - but if this is the pre-existing convention, I guess it is fine. Can you confirm?
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.
So we have
"<id> - <name>"format for Location and Person when saving them as obs values, but reading / parsing the value is more relaxed and can accept that, the id or the uuid.However,
Provideris stored as just<id>. We've been doing that for<obs style="provider_dropdown">and<obs style="provider_radio">already.None of them are stored as uuid.
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.
Yeah, sounds like legacy behavior--if it's straightforward to change all of them to use uuids (while being backwards compatible) it would likely make sense to fix, though I my gut would be to do it in a quick follow-on ticket and commit so we can track it separately in case there are any issues.
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.
Filed https://openmrs.atlassian.net/browse/HTML-888 for this.