-
Notifications
You must be signed in to change notification settings - Fork 4
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
[DT-900] Get search working again #2703
Conversation
d394bdd
to
c790330
Compare
const searchModifier = [ | ||
{ | ||
'multi_match': { | ||
'query': searchTerm, | ||
'query': filters.search[filters.search.length - 1], |
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.
Why this change if searchTerm is being set in filterHandler?
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.
For reasons I don't completely understand searchTerm
at this line reflects the previous searchTerm
state (for example if your current input was hello
, searchTerm
would be hell
)
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'm wondering if something similar could be done everywhere searchTerm is used to eliminate the need for that variable at all - not sure if that would work right though
c790330
to
3a21303
Compare
3a21303
to
58a5d3f
Compare
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.
👍🏽
Addresses
https://broadworkbench.atlassian.net/browse/DT-900
Summary
Fixes the search bar, and ensure that it works properly with any combination of filters and when clearing the search.
To do this the
searchRef
was removed and the search input is treated as if it was any other filter. The only difference is that the input changes must also be reflected to the user, so we need to set the state when the user types or clears the filters.Have you read Terra's Contributing Guide lately? If not, do that first.