Skip to content

Commit

Permalink
Renaming of provider_foreman files, code to configuration_manager
Browse files Browse the repository at this point in the history
- Renamed views, controllers and other files to not be specific to provider_foreman
- Renamed methods and actions, routes etc to use `configuration_manager`
- Changed any links to point to `configuration_manager` instead of `provider_foreman`

follow up PR for #6730
  • Loading branch information
h-kataria committed Mar 11, 2020
1 parent d28afd5 commit 261e6ba
Show file tree
Hide file tree
Showing 27 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1987,7 +1987,7 @@ def controller_for_common_methods
"vm"
when 'automation_manager'
"automation_manager_provider"
when 'provider_foreman'
when 'configuration_manager'
"configuration_manager_provider"
when "generic_object_definition" # tagging for nested list on the generic object class
"generic_object"
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller/ci_processing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def manager_button_operation(method, display_name)
def process_managers(managers, task)
controller_class = request.parameters[:controller]
provider_class = case controller_class
when 'provider_foreman' then ManageIQ::Providers::ConfigurationManager
when 'configuration_manager' then ManageIQ::Providers::ConfigurationManager
when 'automation_manager' then ManageIQ::Providers::AutomationManager
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ProviderForemanController < ApplicationController
class ConfigurationManagerController < ApplicationController
before_action :check_privileges
before_action :get_session_data

Expand All @@ -17,7 +17,7 @@ def self.model
end

def self.table_name
@table_name ||= "provider_foreman"
@table_name ||= "configuration_manager"
end

def self.model_to_name(provmodel)
Expand All @@ -39,11 +39,11 @@ def manager_prefix
end

def privilege_prefix
'provider_foreman'
'configuration_manager'
end

def provision
assert_privileges("provider_foreman_configured_system_provision") if x_active_accord == :configuration_manager_providers
assert_privileges("configuration_manager_configured_system_provision") if x_active_accord == :configuration_manager_providers
assert_privileges("configured_system_provision") if x_active_accord == :configuration_manager_cs_filter
provisioning_ids = find_records_with_rbac(ConfiguredSystem, checked_or_params).ids

Expand Down Expand Up @@ -206,11 +206,11 @@ def provider_active_tree?

private

def provider_foreman_pause
def configuration_manager_pause
pause_or_resume_emss(:pause => true)
end

def provider_foreman_resume
def configuration_manager_resume
pause_or_resume_emss(:resume => true)
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/restful_redirect_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def index
record = ExtManagementSystem.find_by(:id => params[:id])
if record
if %w[ManageIQ::Providers::ConfigurationManager].include?(record.type) || record.type.starts_with?('ManageIQ::Providers::Foreman')
redirect_to(:controller => 'provider_foreman', :action => 'show', :id => params[:id])
redirect_to(:controller => 'configuration_manager', :action => 'show', :id => params[:id])
elsif %w[ManageIQ::Providers::AnsibleTower::AutomationManager].include?(record.type)
redirect_to(:controller => 'automation_manager', :action => 'show', :id => params[:id])
elsif %w[ManageIQ::Providers::EmbeddedAnsible::AutomationManager].include?(record.type)
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def url_for_db(db, action = "show", item = nil)
elsif @host && %w[Patch GuestApplication].include?(db)
return url_for_only_path(:controller => "host", :action => @lastaction, :id => @host, :show => @id)
elsif %w[ConfiguredSystem ConfigurationProfile].include?(db)
return url_for_only_path(:controller => "provider_foreman", :action => @lastaction, :id => @record, :show => @id)
return url_for_only_path(:controller => "configuration_manager", :action => @lastaction, :id => @record, :show => @id)
else
controller, action = db_to_controller(db, action)
return url_for_only_path(:controller => controller, :action => action, :id => @id)
Expand Down Expand Up @@ -282,12 +282,12 @@ def view_to_url(view, parent = nil)
# this is to handle link to a vm in vm explorer from service explorer
return url_for_only_path(:controller => "vm_or_template", :action => "show") + "/"
elsif %w[ConfigurationProfile].include?(view.db) &&
request.parameters[:controller] == "provider_foreman"
request.parameters[:controller] == "configuration_manager"
return url_for_only_path(:action => action, :id => nil) + "/"
elsif %w[ManageIQ::Providers::AutomationManager::InventoryRootGroup EmsFolder].include?(view.db) &&
request.parameters[:controller] == "automation_manager"
return url_for_only_path(:action => action, :id => nil) + "/"
elsif %w[ConfiguredSystem].include?(view.db) && (request.parameters[:controller] == "provider_foreman" || request.parameters[:controller] == "automation_manager")
elsif %w[ConfiguredSystem].include?(view.db) && (request.parameters[:controller] == "configuration_manager" || request.parameters[:controller] == "automation_manager")
return url_for_only_path(:action => action, :id => nil) + "/"
elsif %w[MiqWidget
ConfigurationScript
Expand Down Expand Up @@ -791,7 +791,7 @@ def display_adv_search?
orchestration_stack
persistent_volume
physical_server
provider_foreman
configuration_manager
resource_pool
retired
security_group
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper/page_layouts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def show_adv_search?
orchestration_stack
persistent_volume
physical_server
provider_foreman
configuration_manager
resource_pool
retired
security_group
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper/title.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def title_from_layout(layout)
_("Reports")
when "ops"
_("Configuration")
when "provider_foreman"
when "configuration_manager"
_("Configuration Management")
when "pxe"
_("PXE")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ApplicationHelper::Toolbar::ConfigurationManagerProviderCenter < Applicati
:enabled => true,
:items => [
button(
:provider_foreman_refresh_provider,
:configuration_manager_refresh_provider,
'fa fa-refresh fa-lg',
N_('Refresh relationships for all items related to this Provider'),
N_('Refresh Relationships and Power states'),
Expand All @@ -17,13 +17,13 @@ class ApplicationHelper::Toolbar::ConfigurationManagerProviderCenter < Applicati
:klass => ApplicationHelper::Button::EmsRefresh),
separator,
button(
:provider_foreman_edit_provider,
:configuration_manager_edit_provider,
'pficon pficon-edit fa-lg',
t = N_('Edit this Provider'),
t,
:url => "edit"),
button(
:provider_foreman_delete_provider,
:configuration_manager_delete_provider,
'pficon pficon-delete fa-lg',
t = N_('Remove this Provider from Inventory'),
t,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ApplicationHelper::Toolbar::ConfigurationManagerProvidersCenter < Applicat
:enabled => true,
:items => [
button(
:provider_foreman_refresh_provider,
:configuration_manager_refresh_provider,
'fa fa-refresh fa-lg',
N_('Refresh relationships for all items related to the selected items'),
N_('Refresh Relationships and Power states'),
Expand All @@ -20,14 +20,14 @@ class ApplicationHelper::Toolbar::ConfigurationManagerProvidersCenter < Applicat
:onwhen => "1+"),
separator,
button(
:provider_foreman_add_provider,
:configuration_manager_add_provider,
'pficon pficon-add-circle-o fa-lg',
t = N_('Add a new Provider'),
t,
:enabled => true,
:url => "new"),
button(
:provider_foreman_edit_provider,
:configuration_manager_edit_provider,
'pficon pficon-edit fa-lg',
N_('Select a single item to edit'),
N_('Edit Selected item'),
Expand All @@ -37,7 +37,7 @@ class ApplicationHelper::Toolbar::ConfigurationManagerProvidersCenter < Applicat
:enabled => false,
:onwhen => "1"),
button(
:provider_foreman_delete_provider,
:configuration_manager_delete_provider,
'pficon pficon-delete fa-lg',
t = N_('Remove selected items from Inventory'),
t,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module ApplicationHelper::Toolbar::ConfigurationScripts::PolicyMixin
def self.included(included_class)
included_class.button_group('provider_foreman_policy',
[included_class.select(:provider_foreman_policy_choice,
included_class.button_group('configuration_manager_policy',
[included_class.select(:configuration_manager_policy_choice,
nil,
t = N_('Policy'),
t,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::LifecycleMixin
def self.included(included_class)
included_class.button_group('provider_foreman_lifecycle', [
included_class.button_group('configuration_manager_lifecycle', [
included_class.select(
:provider_foreman_lifecycle_choice,
:configuration_manager_lifecycle_choice,
nil,
N_('Lifecycle'),
:enabled => true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::PolicyMixin
def self.included(included_class)
included_class.button_group('provider_foreman_policy', [
included_class.button_group('configuration_manager_policy', [
included_class.select(
:provider_foreman_policy_choice,
:configuration_manager_policy_choice,
nil,
N_('Policy'),
:items => [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
class ApplicationHelper::Toolbar::XProviderForemanForemanConfiguredSystemCenter < ApplicationHelper::Toolbar::Basic
class ApplicationHelper::Toolbar::XConfigurationManagerConfiguredSystemCenter < ApplicationHelper::Toolbar::Basic
button_group('record_summary', [
select(
:provider_foreman_lifecycle_choice,
:configuration_manager_lifecycle_choice,
nil,
t = N_('Lifecycle'),
t,
:enabled => true,
:items => [
button(
:provider_foreman_configured_system_provision,
:configuration_manager_configured_system_provision,
'pficon pficon-add-circle-o fa-lg',
t = N_('Provision Configured System'),
t,
Expand All @@ -19,7 +19,7 @@ class ApplicationHelper::Toolbar::XProviderForemanForemanConfiguredSystemCenter
]
),
select(
:provider_foreman_policy_choice,
:configuration_manager_policy_choice,
nil,
t = N_('Policy'),
t,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
class ApplicationHelper::Toolbar::XForemanConfiguredSystemCenter < ApplicationHelper::Toolbar::Basic
button_group('record_summary', [
select(
:provider_foreman_lifecycle_choice,
:configuration_manager_lifecycle_choice,
nil,
t = N_('Lifecycle'),
t,
:enabled => true,
:items => [
button(
:provider_foreman_configured_system_provision,
:configuration_manager_configured_system_provision,
'pficon pficon-add-circle-o fa-lg',
t = N_('Provision Configured System'),
t,
Expand All @@ -19,7 +19,7 @@ class ApplicationHelper::Toolbar::XForemanConfiguredSystemCenter < ApplicationHe
]
),
select(
:provider_foreman_policy_choice,
:configuration_manager_policy_choice,
nil,
t = N_('Policy'),
t,
Expand Down
6 changes: 3 additions & 3 deletions app/helpers/application_helper/toolbar_chooser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def x_view_toolbar_filename
nil
elsif @layout == 'report'
@report ? "report_view_tb" : nil
elsif @layout == 'provider_foreman'
elsif @layout == 'configuration_manager'
@showtype == 'main' ? "x_summary_view_tb" : "x_gtl_view_tb"
elsif %w[vm_infra vm_cloud].include?(@layout)
@showtype == 'main' ? 'x_summary_view_tb' : nil
Expand Down Expand Up @@ -90,7 +90,7 @@ def center_toolbar_name_vm_or_template
def center_toolbar_filename_explorer
if %w[vm_cloud vm_infra vm_or_template].include?(@layout)
center_toolbar_name_vm_or_template
elsif @layout == "provider_foreman" && %i[configuration_manager_providers_tree configuration_manager_cs_filter_tree].include?(x_active_tree)
elsif @layout == "configuration_manager" && %i[configuration_manager_providers_tree configuration_manager_cs_filter_tree].include?(x_active_tree)
center_toolbar_filename_configuration_manager_providers
elsif @layout == "automation_manager"
center_toolbar_filename_automation_manager
Expand Down Expand Up @@ -634,7 +634,7 @@ def unassigned_configuration_profile_node(nodes)
miq_policy
miq_policy_rsop
ops
provider_foreman
configuration_manager
pxe
report].to_set.freeze

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module ProviderForemanHelper
module ConfigurationManagerHelper
include TextualMixins::TextualGroupTags

def textual_group_properties
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/menu/default_menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def compute_menu_section

def configuration_menu_section
Menu::Section.new(:conf, N_("Configuration"), 'fa fa-cog', [
Menu::Item.new('provider_foreman', N_('Management'), 'provider_foreman_explorer', {:feature => 'provider_foreman_explorer', :any => true}, '/provider_foreman/explorer'),
Menu::Item.new('configuration_manager', N_('Management'), 'configuration_manager_explorer', {:feature => 'configuration_manager_explorer', :any => true}, '/configuration_manager/explorer'),
])
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
= render :partial => "main_configuration_profile"

:javascript
miq_tabs_init('#configuration_profile_form_tabs', '/provider_foreman/change_tab');
miq_tabs_init('#configuration_profile_form_tabs', '/configuration_manager/change_tab');
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

:javascript
ManageIQ.angular.app.value('configurationManagerFormId', '#{@provider_manager.id || "new"}');
ManageIQ.angular.app.value('url', '/provider_foreman');
ManageIQ.angular.app.value('url', '/configuration_manager');
ManageIQ.angular.app.value('modelName', 'providerForemanModel');
miq_bootstrap('#form_div');
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
= render :partial => "main_inventory_group"

:javascript
miq_tabs_init('#inventory_group_form_tabs', '/provider_foreman/change_tab');
miq_tabs_init('#inventory_group_form_tabs', '/configuration_manager/change_tab');
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
- if @configuration_profile_record
#main_div
- @pages = nil if @sb[:active_tab] == 'summary'
= render(:partial => 'provider_foreman/configuration_profile')
= render(:partial => 'configuration_manager/configuration_profile')
- elsif @inventory_group_record
#main_div
- @pages = nil if @sb[:active_tab] == 'summary'
= render(:partial => 'provider_foreman/inventory_group')
= render(:partial => 'configuration_manager/inventory_group')

- elsif @configured_system_record
#main_div
= render :partial => "layouts/textual_groups_generic"
- elsif @configuration_script_record
#main_div
= render(:partial => 'provider_foreman/configuration_script', :locals => {:controller => "provider_foreman"})
= render(:partial => 'configuration_manager/configuration_script', :locals => {:controller => "configuration_manager"})
- else
#main_div
- if ManageIQ::Providers::ConfigurationManager.none? && provider_active_tree?
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2658,7 +2658,7 @@
dialog_runner_post
},

:provider_foreman => {
:configuration_manager => {
:get => %w(
download_data
download_summary_pdf
Expand Down

0 comments on commit 261e6ba

Please sign in to comment.