Skip to content

Commit

Permalink
Merge pull request #6730 from bdunne/cam
Browse files Browse the repository at this point in the history
Display all of the following, not just Foreman
  • Loading branch information
h-kataria authored Mar 5, 2020
2 parents b889203 + c5a59a4 commit 9e5201a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
8 changes: 4 additions & 4 deletions app/controllers/provider_foreman_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ def class_for_provider_node
nodes = x_node.split('-')
case nodes.first
when "root" then ManageIQ::Providers::ConfigurationManager
when "fr" then ManageIQ::Providers::Foreman::ConfigurationManager::ConfigurationProfile
when "cp", "cs" then ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem
when "fr" then ConfigurationProfile
when "cp", "cs" then ConfiguredSystem
when "xx" then
case nodes.second
when "fr" then ManageIQ::Providers::ConfigurationManager
when "csf" then ConfiguredSystem
end
else
nodes.include?("unassigned") ? ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem : ManageIQ::Providers::ConfigurationManager
nodes.include?("unassigned") ? ConfiguredSystem : ManageIQ::Providers::ConfigurationManager
end
end

Expand Down Expand Up @@ -332,7 +332,7 @@ def default_node
@show_list ? process_show_list(options) : options.merge!(update_options)
@right_cell_text = _("All Configuration Management Providers")
elsif x_active_tree == :configuration_manager_cs_filter_tree
options = {:model => "ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem"}
options = {:model => "ConfiguredSystem"}
@show_list ? process_show_list(options) : options.merge!(update_options)
@right_cell_text = _("All Configured Systems")
end
Expand Down
6 changes: 3 additions & 3 deletions app/presenters/tree_builder_configuration_manager.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class TreeBuilderConfigurationManager < TreeBuilder
has_kids_for ManageIQ::Providers::Foreman::ConfigurationManager, [:x_get_tree_cmf_kids]
has_kids_for ManageIQ::Providers::ConfigurationManager, [:x_get_tree_cmf_kids]
has_kids_for ConfigurationProfile, [:x_get_tree_cpf_kids]

private
Expand All @@ -17,7 +17,7 @@ def root_options

# Get root nodes count/array for explorer tree
def x_get_tree_roots
count_only_or_objects_filtered(false, ManageIQ::Providers::Foreman::ConfigurationManager, "name", :match_via_descendants => ConfiguredSystem)
count_only_or_objects_filtered(false, ManageIQ::Providers::ConfigurationManager, "name")
end

def node_by_tree_id(id)
Expand All @@ -29,7 +29,7 @@ def x_get_tree_cmf_kids(object, count_only)
assigned_configuration_profile_objs =
count_only_or_objects_filtered(count_only,
ConfigurationProfile.where(:manager_id => object[:id]),
"name", :match_via_descendants => ConfiguredSystem)
"name")
unassigned_configuration_profile_objs =
fetch_unassigned_configuration_profile_objects(count_only, object[:id])

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class TreeBuilderConfigurationManagerConfiguredSystems < TreeBuilderConfiguredSystems
def initialize(*args)
@root_class = 'ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem'
@root_class = 'ConfiguredSystem'
super(*args)
end

Expand Down
7 changes: 3 additions & 4 deletions spec/controllers/provider_foreman_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,7 @@
allow(controller).to receive(:x_active_accord).and_return(:configuration_manager_cs_filter)
allow(controller).to receive(:build_listnav_search_list)
controller.params = {:id => "configuration_manager_cs_filter_accord"}
expect(controller).to receive(:get_view).with("ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem",
:gtl_dbname => :cm_configured_systems, :dbname => :cm_configured_systems).and_call_original
expect(controller).to receive(:get_view).with("ConfiguredSystem", :gtl_dbname => :cm_configured_systems, :dbname => :cm_configured_systems).and_call_original
allow(controller).to receive(:build_listnav_search_list)
controller.send(:accordion_select)
end
Expand Down Expand Up @@ -504,8 +503,8 @@
allow_any_instance_of(User).to receive(:get_filters).and_return(user_filters)
Classification.seed
quota_2gb_tag = Classification.where("description" => "2GB").first
Classification.bulk_reassignment(:model => "ConfiguredSystem",
:object_ids => @configured_system.id,
Classification.bulk_reassignment(:model => "ManageIQ::Providers::Foreman::ConfigurationManager",
:object_ids => @config_mgr.id,
:add_ids => quota_2gb_tag.id,
:delete_ids => [])
tree = TreeBuilderConfigurationManager.new(:configuration_manager_providers_tree, controller.instance_variable_get(:@sb))
Expand Down

0 comments on commit 9e5201a

Please sign in to comment.