Skip to content

Commit

Permalink
More changes to get tree_select and gtl links working
Browse files Browse the repository at this point in the history
- renamed more methods and occurrences of foreman related class name checks.
- changes to get tree_select transaction working and gtl links working to load correct data in the right cell
  • Loading branch information
h-kataria committed Mar 12, 2020
1 parent 261e6ba commit cacc376
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def report_data
@view.table = filter_parent_name_tenant(@view.table)
end

# Foreman has some unassigned rows which needs to be added after view is fetched
# Configuration Manager has some unassigned rows which needs to be added after view is fetched
if options && options[:unassigned_profile_row] && options[:unassigned_configuration_profile]
options[:unassigned_profile_row][:id] ||= options[:unassigned_profile_row]['manager_id']
@view.table.data.push(options[:unassigned_profile_row])
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/application_controller/miq_request_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def dialog_partial_for_workflow
workflow = @edit.try(:[], :wf) && !@edit[:stamp_typ] ? @edit[:wf] : @options[:wf]
case workflow
when MiqProvisionVirtWorkflow then "shared/views/prov_dialog"
when ManageIQ::Providers::Foreman::ConfigurationManager::ProvisionWorkflow then "prov_configured_system_foreman_dialog"
when ManageIQ::Providers::ConfigurationManager::ProvisionWorkflow then "prov_configured_system_foreman_dialog"
when VmMigrateWorkflow then "prov_vm_migrate_dialog"
when PhysicalServerProvisionWorkflow then "prov_physical_server_dialog"
end
Expand Down Expand Up @@ -887,7 +887,7 @@ def prov_set_form_vars(req = nil)
@edit[:new] = @edit[:new].merge(pre_prov_values.reject { |k| @edit[:new].key?(k) })
end

if @edit[:wf].kind_of?(ManageIQ::Providers::Foreman::ConfigurationManager::ProvisionWorkflow) ||
if @edit[:wf].kind_of?(ManageIQ::Providers::ConfigurationManager::ProvisionWorkflow) ||
@edit[:wf].kind_of?(PhysicalServerProvisionWorkflow)
# BD TODO
else
Expand Down Expand Up @@ -984,7 +984,7 @@ def workflow_instance_from_vars(req)
elsif @edit[:org_controller] == "configured_system"
@edit[:prov_type] = "ConfiguredSystem"
@edit[:new][:src_configured_system_ids] = params[:prov_id].kind_of?(Array) ? params[:prov_id] : [params[:prov_id]]
wf_type = ManageIQ::Providers::Foreman::ConfigurationManager::ProvisionWorkflow
wf_type = ManageIQ::Providers::ConfigurationManager::ProvisionWorkflow
elsif @edit[:org_controller] == "physical_server"
@edit[:prov_type] = "PhysicalServer"
@edit[:new][:src_configured_system_ids] = params[:prov_id].kind_of?(Array) ? params[:prov_id] : [params[:prov_id]]
Expand Down
20 changes: 10 additions & 10 deletions app/controllers/configuration_manager_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def self.table_name
end

def self.model_to_name(provmodel)
if provmodel.include?("ManageIQ::Providers::Foreman")
Dictionary.gettext('foreman', :type => :ui_title, :translate => false)
if provmodel.include?("ManageIQ::Providers::ConfigurationManager")
Dictionary.gettext('ConfigurationManager', :type => :ui_title, :translate => false)
end
end

Expand Down Expand Up @@ -220,7 +220,7 @@ def textual_group_list
helper_method :textual_group_list

def provider_class
ManageIQ::Providers::Foreman::Provider
ManageIQ::Providers::ConfigurationManager
end

def features
Expand Down Expand Up @@ -252,11 +252,11 @@ def get_node_info(treenodeid, show_list = true)
end

options = case model
when "ManageIQ::Providers::Foreman::ConfigurationManager"
when "ManageIQ::Providers::ConfigurationManager"
provider_list(id, model)
when "ConfigurationProfile"
configuration_profile_node(id, model)
when "ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem", "ConfiguredSystem"
when "ManageIQ::Providers::ConfigurationManager::ConfiguredSystem", "ConfiguredSystem"
configured_system_list(id, model)
when "MiqSearch"
miq_search_node
Expand Down Expand Up @@ -285,8 +285,8 @@ def provider_node(id, model)
else
@no_checkboxes = true
case @record.type
when "ManageIQ::Providers::Foreman::ConfigurationManager"
options = {:model => "ConfigurationProfile", :match_via_descendants => 'ConfiguredSystem', :named_scope => [[:with_manager, provider.id]]}
when "ManageIQ::Providers::Foreman::ConfigurationManager", "ManageIQ::Providers::CloudAutomationManager::ConfigurationManager"
options = {:model => "ConfigurationProfile", :named_scope => [[:with_manager, provider.id]]}
@show_list ? process_show_list(options) : options.merge!(update_options)
unassigned_profiles = add_unassigned_configuration_profile_record(provider.id)
options.merge!(unassigned_profiles) unless unassigned_profiles.nil?
Expand Down Expand Up @@ -355,14 +355,14 @@ def configuration_profile_record?(node = x_node)
type && %w[ConfigurationProfile].include?(TreeBuilder.get_model_for_prefix(type))
end

def foreman_provider_record?(node = x_node)
def configuration_manager_record?(node = x_node)
node = node.split("-").last if node.split("-").first == 'xx'
type, _id = node.split("-")
type && ["ManageIQ::Providers::Foreman::ConfigurationManager"].include?(TreeBuilder.get_model_for_prefix(type))
type && ["ManageIQ::Providers::ConfigurationManager"].include?(TreeBuilder.get_model_for_prefix(type))
end

def provider_record?(node = x_node)
foreman_provider_record?(node)
configuration_manager_record?(node)
end

def search_text_type(node)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/mixins/manager_controller_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def construct_edit_for_audit
end

def breadcrumb_name(_model)
"#{ui_lookup(:ui_title => 'foreman')} #{_('Provider')}"
"#{ui_lookup(:ui_title => 'ConfigurationManager')} #{_('Provider')}"
end

def tagging_explorer_controller?
Expand Down
6 changes: 3 additions & 3 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -912,9 +912,9 @@ def model_from_active_tree(tree)
when :automation_manager_cs_filter_tree
"ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem"
when :configuration_manager_cs_filter_tree
"ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem"
"ManageIQ::Providers::ConfigurationManager::ConfiguredSystem"
when :configuration_manager_providers_tree
"ManageIQ::Providers::Foreman::ConfigurationManager" if x_node.include?("fr")
"ManageIQ::Providers::ConfigurationManager" if x_node.include?("fr")
"ManageIQ::Providers::ConfigurationManager" if x_node == "root"
when :instances_filter_tree
"ManageIQ::Providers::CloudManager::Vm"
Expand All @@ -938,7 +938,7 @@ def configuration_manager_scripts_tree(tree)
when :automation_manager_cs_filter_tree, :automation_manager_providers_tree
"ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem"
when :configuration_manager_cs_filter_tree
"ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem"
"ManageIQ::Providers::ConfigurationManager::ConfiguredSystem"
when :configuration_scripts_tree
"ConfigurationScript"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ApplicationHelper::Toolbar::ConfigurationManagerProvidersCenter < Applicat
button(
:configuration_manager_provider_tag,
'pficon pficon-edit fa-lg',
N_('Edit Tags for this Foreman Provider'),
N_('Edit Tags for this Configuration Manager Provider'),
N_('Edit Tags'),
:url_parms => "main_div",
:send_checked => true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::LifecycleMixin
module ApplicationHelper::Toolbar::ConfiguredSystem::ConfigurationManager::LifecycleMixin
def self.included(included_class)
included_class.button_group('configuration_manager_lifecycle', [
included_class.select(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::PolicyMixin
module ApplicationHelper::Toolbar::ConfiguredSystem::ConfigurationManager::PolicyMixin
def self.included(included_class)
included_class.button_group('configuration_manager_policy', [
included_class.select(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationHelper::Toolbar::ConfiguredSystemsCenter < ApplicationHelper::Toolbar::Basic
include ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::LifecycleMixin
include ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::PolicyMixin
include ApplicationHelper::Toolbar::ConfiguredSystem::LifecycleMixin
include ApplicationHelper::Toolbar::ConfiguredSystem::PolicyMixin
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationHelper::Toolbar::UnassignedProfilesGroupCenter < ApplicationHelper::Toolbar::Basic
include ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::LifecycleMixin
include ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::PolicyMixin
include ApplicationHelper::Toolbar::ConfiguredSystem::ConfigurationManager::LifecycleMixin
include ApplicationHelper::Toolbar::ConfiguredSystem::ConfigurationManager::PolicyMixin
end
4 changes: 2 additions & 2 deletions app/presenters/tree_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,10 @@ def prefixed_title(prefix, title)
"e" => "ExtManagementSystem",
"ev" => "MiqEventDefinition",
"c" => "EmsCluster",
"csf" => "ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem",
"csf" => "ManageIQ::Providers::ConfigurationManager::ConfiguredSystem",
"csa" => "ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem",
"f" => "EmsFolder",
"fr" => "ManageIQ::Providers::Foreman::ConfigurationManager",
"fr" => "ManageIQ::Providers::ConfigurationManager",
"g" => "MiqGroup",
"gd" => "GuestDevice",
"god" => "GenericObjectDefinition",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def root_options
def configured_systems
{
:id => "csf",
:text => t = _("%{name} Configured Systems") % {:name => ui_lookup(:ui_title => 'foreman')},
:text => t = _("%{name} Configured Systems") % {:name => ui_lookup(:ui_title => 'ConfigurationManager')},
:icon => "pficon pficon-folder-close",
:tip => t
}
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/tree_node/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def key
else
base_class = @object.class.base_model.name # i.e. Vm or MiqTemplate
base_class = "Datacenter" if base_class == "EmsFolder" && @object.kind_of?(::Datacenter)
base_class = "ManageIQ::Providers::Foreman::ConfigurationManager" if @object.kind_of?(ManageIQ::Providers::Foreman::ConfigurationManager)
base_class = "ManageIQ::Providers::ConfigurationManager" if @object.kind_of?(ManageIQ::Providers::ConfigurationManager)
base_class = "ManageIQ::Providers::AnsibleTower::AutomationManager" if @object.kind_of?(ManageIQ::Providers::AnsibleTower::AutomationManager)
prefix = TreeBuilder.get_prefix_for_model(base_class)
cid = @object.id
Expand Down

0 comments on commit cacc376

Please sign in to comment.