Skip to content

Commit

Permalink
Merge pull request #295 from lgalis/advanced_search_fix_for_foreman_c…
Browse files Browse the repository at this point in the history
…onfiguration_povider

Fix search box display for Configuration management providers
  • Loading branch information
Dan Clarizio authored Feb 3, 2017
2 parents bc17276 + e5db19f commit 495040e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/controllers/provider_foreman_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -924,8 +924,7 @@ def update_partials(record_showing, presenter, r)
def replace_search_box(presenter, r)
# Replace the searchbox
presenter.replace(:adv_searchbox_div,
r[:partial => 'layouts/x_adv_searchbox',
:locals => {:nameonly => x_active_tree == :configuration_manager_providers_tree}])
r[:partial => 'layouts/x_adv_searchbox'])

presenter[:clear_gtl_list_grid] = @gtl_type && @gtl_type != 'list'
end
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,7 @@ def tree_with_advanced_search?
containers_filter
cs_filter
configuration_scripts
foreman_providers
configuration_manager_providers
images
images_filter
instances
Expand Down
2 changes: 1 addition & 1 deletion app/views/provider_foreman/explorer.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- content_for :search do
= render(:partial => "layouts/x_adv_searchbox", :locals => {:nameonly => x_active_tree == :configuration_manager_providers_tree})
= render(:partial => "layouts/x_adv_searchbox")
= render(:partial => 'layouts/quick_search')

-# These are the initial divs that will go inside center_cell_div
Expand Down
13 changes: 13 additions & 0 deletions spec/helpers/application_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,19 @@
expect(result).to be_truthy
end

it 'should return true for the configuration providers tree' do
controller.instance_variable_set(:@sb,
:active_tree => :configuration_manager_providers_tree,
:trees => {
:configuration_manager_providers_tree => {
:tree => :configuration_manager_providers_tree,
:type => :configuration_manager_providers
}
})
result = helper.tree_with_advanced_search?
expect(result).to be_truthy
end

it 'should return false for tree w/o advanced search' do
controller.instance_variable_set(:@sb,
:active_tree => :reports_tree,
Expand Down

0 comments on commit 495040e

Please sign in to comment.