-
Notifications
You must be signed in to change notification settings - Fork 357
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
Fix Control explorer policies Search clear button #3745
Fix Control explorer policies Search clear button #3745
Conversation
@miq-bot add_label bug |
753ffb7
to
94f657b
Compare
f774ff1
to
410f5be
Compare
@miq-bot remove_label wip |
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, looks good, but please update the test.
let(:tree) { :any_tree } | ||
|
||
before do | ||
allow(controller).to receive(:params).and_return(:action => 'adv_search_text_clear') |
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.
controller.instance_variable_set(:@_params, :action => 'adv_search_text_clear')
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1563316 Fix Search clear button when searching text under Control -> Explorer screens.
Add spec test to check the variable for Control -> Explorer screens, when clearing search text from the Search form by search clear button.
410f5be
to
880a385
Compare
@skateman test successfully updated. Thank you! ⭐ |
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.
Checked commits hstastna/manageiq-ui-classic@4ec0391~...880a385 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Gaprindashvili? |
@miq-bot add_label gaprindashvili/yes |
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1563316
Fix Search clear button when searching text under Control -> Explorer screens.
Before searching text:
Before: (after clicking on clear search button, nothing has happened)
After: (after clicking on clear search button, the same as before searching text)
Details:
The problem was that after
adv_search_text_clear
method (in application controller) was called,@search_text
was reset tonil
BUT then set again to the previous value. This was happening the next way: inadv_search_text_clear
,reload
method callstree_select
from miq policy controller, where because of callingget_node_info
method@search_text
was set again, inset_search_text
method here: https://github.com/ManageIQ/manageiq-ui-classic/compare/master...hstastna:Control_explorer_policies_search_clear_button?expand=1#diff-81673877a9cc40eb5089aa4a42bd3764R915The solution is to reset also
@sb[:pol_search_text][x_active_tree]
, not just@search_text
or@sb[:search_text]
as it is inadv_search_text_clear
in app controller. This change is safe when changing accordions under Control -> Explorer: it keeps search text in@sb[:pol_search_text][x_active_tree]
asx_active_tree
changes, until search text is cleared for appropriate tree/accordion.