Skip to content

Commit

Permalink
Spec for url_for_record for Automation Manager Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalis committed Apr 6, 2017
1 parent 3070d4c commit ea99233
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions app/controllers/automation_manager_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def concrete_model
end

def managed_group_kls
ManageIQ::Providers::AutomationManager::InventoryGroup
ManageIQ::Providers::ExternalAutomationManager::InventoryGroup
end

def manager_prefix
Expand Down Expand Up @@ -106,7 +106,7 @@ def automation_manager_providers_tree_rec
nodes = x_node.split('-')
case nodes.first
when "root" then find_record(ManageIQ::Providers::AnsibleTower::AutomationManager, params[:id])
when "at" then find_record(ManageIQ::Providers::AutomationManager::InventoryGroup, params[:id])
when "at" then find_record(ManageIQ::Providers::ExternalAutomationManager::InventoryGroup, params[:id])
when "f" then find_record(ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem, params[:id])
when "xx" then
case nodes.second
Expand Down Expand Up @@ -254,10 +254,10 @@ def provider_node(id, model)
cs_provider_node(provider)
else
@no_checkboxes = true
options = {:model => "ManageIQ::Providers::AutomationManager::InventoryGroup",
options = {:model => "ManageIQ::Providers::AutomationManager::InventoryRootGroup",
:match_via_descendants => ConfiguredSystem,
:where_clause => ["ems_id IN (?)", provider.id],
:gtl_dbname => "automation_manager_groups"}
:gtl_dbname => "automation_manager_providers"}
process_show_list(options)
record_model = ui_lookup(:model => self.class.model_to_name(model || TreeBuilder.get_model_for_prefix(@nodetype)))
@right_cell_text = _("%{model} \"%{name}\"") % {:name => provider.name,
Expand All @@ -276,7 +276,7 @@ def cs_provider_node(provider)
end

def inventory_group_node(id, model)
@record = @inventory_group_record = find_record(ManageIQ::Providers::AutomationManager::InventoryGroup, id) if model
@record = @inventory_group_record = find_record(ManageIQ::Providers::ExternalAutomationManager::InventoryGroup, id) if model

if @inventory_group_record.nil?
self.x_node = "root"
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/show_pdf.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
= render_quadicon(@record, :mode => :icon, :size => 72)
- if @record.kind_of?(ConfigurationProfile)
= render :partial => "#{controller}/main_configuration_profile"
- elsif @record.kind_of?(ManageIQ::Providers::AutomationManager::InventoryGroup)
- elsif @record.kind_of?(ManageIQ::Providers::ExternalAutomationManager::InventoryGroup)
= render :partial => "#{controller}/main_inventory_group"
- else
= render :partial => "layouts/textual_groups_generic"

0 comments on commit ea99233

Please sign in to comment.