-
Notifications
You must be signed in to change notification settings - Fork 987
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
Fixes #28182 - fixing broken search bar in facts #7554
Conversation
Issues: #28182 |
|
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 ran into this bug last Friday so I can confirm it's annoying. However, I wonder if a separate parameter really the correct way. Shouldn't it check if params[:search]
is not blank? The search may also be a complex expression. Some cases I can think of that might fail, but not sure if they will:
name = myfact or name = my_other_fact
should be(name = myfact or name = my_other_fact) and ...
name = myfact and fqdn = host.example.com
will result inname = myfact and fqdn = host.example.com and fqdn = host.example.com
(note the double space)
It would be good to have test cases for this.
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 believe Ewoud is right and we could simplify this.
Thanks @ezr-ondrej , @ekohl ! I've added also a test |
def has_search_param? | ||
params[:search].blank? | ||
end |
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.
This appears unused and also reversed the logic.
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.
Tested, seems to work properly. Just the left-over has_search_param?
method needs cleaning.
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.
Thanks @amirfefer !
2.1 - 84d0f49 |
In Host -> Facts page the search bar contains
host = $fqdn
, and after cleaning it up and search for another query this happens:it should add a separator " and ":