From 2166fada7211aac2d43187cf2ee76d372678523c Mon Sep 17 00:00:00 2001 From: lgalis Date: Thu, 2 Feb 2017 23:45:02 -0500 Subject: [PATCH 1/2] Fix search box display for Configuration management providers --- app/controllers/provider_foreman_controller.rb | 3 +-- app/helpers/application_helper.rb | 2 +- app/views/provider_foreman/explorer.html.haml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/provider_foreman_controller.rb b/app/controllers/provider_foreman_controller.rb index 525b547c468..9f5af326183 100644 --- a/app/controllers/provider_foreman_controller.rb +++ b/app/controllers/provider_foreman_controller.rb @@ -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 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1cfb19dbff6..4e30b010a71 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1600,7 +1600,7 @@ def tree_with_advanced_search? containers_filter cs_filter configuration_scripts - foreman_providers + configuration_manager_providers images images_filter instances diff --git a/app/views/provider_foreman/explorer.html.haml b/app/views/provider_foreman/explorer.html.haml index 07f45f603ee..48cfcb952e7 100644 --- a/app/views/provider_foreman/explorer.html.haml +++ b/app/views/provider_foreman/explorer.html.haml @@ -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 From e5db19ff7c64a9ccff1b30c34445e2dbb72d1868 Mon Sep 17 00:00:00 2001 From: lgalis Date: Fri, 3 Feb 2017 09:50:08 -0500 Subject: [PATCH 2/2] Spec for configuration_manager_providers tree advanced search flag Spec for configuration_manager_providers tree advanced search flag --- spec/helpers/application_helper_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 2b6133a5289..4ebfe706ce9 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -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,