Skip to content

Commit

Permalink
Addressed rubocop warnings
Browse files Browse the repository at this point in the history
Also deleted leftover routes for provider_foreman controller
  • Loading branch information
h-kataria committed Apr 1, 2020
1 parent 81a3fa9 commit f8d41fc
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 81 deletions.
2 changes: 1 addition & 1 deletion app/controllers/configuration_manager_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def button

private

def self.model_to_name(provmodel)
def self.model_to_name(_provmodel)
Dictionary.gettext('configuration_manager', :type => :ui_title, :translate => false)
end

Expand Down
1 change: 1 addition & 0 deletions app/views/automation_manager/_form.html.haml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
= render :partial => 'configuration_manager/shared_form', :locals => {:url => "/automation_manager", :model => "automationManagerModel"}

1 change: 1 addition & 0 deletions app/views/configuration_manager/_shared_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@
ManageIQ.angular.app.value('url', '#{url}');
ManageIQ.angular.app.value('modelName', '#{model}');
miq_bootstrap('#form_div');
1 change: 1 addition & 0 deletions app/views/configuration_manager/edit.html.haml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
= render :partial => 'configuration_manager/shared_form', :locals => {:url => "/configuration_manager", :model => "configurationManagerModel"}

1 change: 1 addition & 0 deletions app/views/configuration_manager/new.html.haml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
= render :partial => 'configuration_manager/shared_form', :locals => {:url => "/configuration_manager", :model => "configurationManagerModel"}

10 changes: 5 additions & 5 deletions app/views/configuration_manager/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
- if %w(configuration_profiles configured_systems).include?(@display)
- if %w[configuration_profiles configured_systems].include?(@display)
= render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"}
- elsif @showtype == "main"
= render :partial => "layouts/flash_msg"
.row
.col-md-12.col-lg-6
= react 'GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Properties'), textual_group_properties), @record)
= react 'GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Relationships'), textual_group_relationships), @record)
= react('GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Properties'), textual_group_properties), @record))
= react('GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Relationships'), textual_group_relationships), @record))
.col-md-12.col-lg-6
= react 'GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Status'), textual_group_status), @record)
= react 'GenericGroupWrapper', expand_generic_group(TextualTags.new(_('Smart Management'), textual_group_tags), @record)
= react('GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Status'), textual_group_status), @record))
= react('GenericGroupWrapper', expand_generic_group(TextualTags.new(_('Smart Management'), textual_group_tags), @record))
1 change: 1 addition & 0 deletions app/views/configuration_manager/show_list.html.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#main_div
= render :partial => 'layouts/gtl'

12 changes: 6 additions & 6 deletions app/views/configuration_profile/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
- if %w(configured_systems).include?(@display)
- if %w[configured_systems].include?(@display)
= render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"}
- elsif @showtype == "main"
= render :partial => "layouts/flash_msg"
.row
.col-md-12.col-lg-6
= react 'GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Properties'), textual_configuration_profile_group_properties), @record)
= react 'GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Relationships'), textual_configuration_profile_group_relationships), @record)
= react 'GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Environment'), textual_configuration_profile_group_environment), @record)
= react('GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Properties'), textual_configuration_profile_group_properties), @record))
= react('GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Relationships'), textual_configuration_profile_group_relationships), @record))
= react('GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Environment'), textual_configuration_profile_group_environment), @record))
.col-md-12.col-lg-6
= react 'GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Operating System'), textual_configuration_profile_group_os), @record)
= react 'GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Tenancy'), textual_configuration_profile_group_tenancy), @record)
= react('GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Operating System'), textual_configuration_profile_group_os), @record))
= react('GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Tenancy'), textual_configuration_profile_group_tenancy), @record))

12 changes: 6 additions & 6 deletions app/views/layouts/_searchbar.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
.form-group
%button.btn.btn-default{:type => "submit"}
%span.fa.fa-search
%button{"type" => "button",
:class => "btn btn-default",
"data-toggle" => "modal",
"data-target" => "#advsearchModal",
:id => "adv_search",
:title => _("Advanced Search")}
%button{"type" => "button",
:class => "btn btn-default",
"data-toggle" => "modal",
"data-target" => "#advsearchModal",
:id => "adv_search",
:title => _("Advanced Search")}
%span.fa.fa-angle-double-down

:javascript
Expand Down
16 changes: 8 additions & 8 deletions app/views/layouts/listnav/_configuration_manager.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
%ul.nav.nav-pills.nav-stacked
- if role_allows?(:feature => "configuration_profile_show_list")
= li_link(:count => @record.number_of(:configuration_profiles),
:record_id => @record.id,
:tables => 'configuration_profiles',
:display => 'configuration_profiles',
:action => 'show')
:record_id => @record.id,
:tables => 'configuration_profiles',
:display => 'configuration_profiles',
:action => 'show')
- if role_allows?(:feature => "configured_system_show_list")
= li_link(:count => @record.number_of(:configured_systems),
:record_id => @record.id,
:tables => 'configured_systems',
:display => 'configured_systems',
:action => 'show')
:record_id => @record.id,
:tables => 'configured_systems',
:display => 'configured_systems',
:action => 'show')
65 changes: 12 additions & 53 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2659,7 +2659,7 @@
},

:configuration_manager => {
:get => %w(
:get => %w[
button
download_data
download_summary_pdf
Expand All @@ -2669,8 +2669,8 @@
show
show_list
tagging_edit
),
:post => %w(
],
:post => %w[
authentication_validate
button
change_tab
Expand All @@ -2687,37 +2687,37 @@
tagging_edit
tag_edit_form_field_changed
wait_for_task
) +
] +
adv_search_post +
exp_post +
save_post
},

:configuration_profile => {
:get => %w(
:get => %w[
download_data
download_summary_pdf
show
show_list
),
:post => %w(
],
:post => %w[
button
quick_search
reload
show
show_list
)
]
},

:configured_system => {
:get => %w(
:get => %w[
download_data
download_summary_pdf
show
show_list
tagging_edit
),
:post => %w(
],
:post => %w[
button
new
provision
Expand All @@ -2729,54 +2729,13 @@
tagging_edit
tag_edit_form_field_changed
wait_for_task
) +
] +
adv_search_post +
dialog_runner_post +
exp_post +
save_post
},

:provider_foreman => {
:get => %w(
download_data
download_summary_pdf
explorer
form_fields
show
show_list
tagging_edit
),
:post => %w(
accordion_select
authentication_validate
button
change_tab
delete
edit
explorer
form_field_changed
new
provision
quick_search
refresh
reload
show
show_list
tagging
tagging_edit
tag_edit_form_field_changed
tree_autoload
tree_select
cs_form_field_changed
users
wait_for_task
x_button
) +
adv_search_post +
exp_post +
x_post
},

:pxe => {
:get => %w(
explorer
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/application_helper/toolbar_chooser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
end

it "configuration_manager list screen" do
@view = true
@view = true
@lastaction = "show_list"
expect(_toolbar_chooser.send(:center_toolbar_filename_classic)).to eq("configuration_managers_center_tb")
end
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/application_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@
subject { helper.display_adv_search? }

context 'Advanced search is visible for list views' do
%w(cloud_volume_snapshot cloud_volume_backup configuration_manager).each do |layout|
%w[cloud_volume_snapshot cloud_volume_backup configuration_manager].each do |layout|
let(:layout) { layout }
it 'returns true' do
expect(subject).to be(true)
Expand Down

0 comments on commit f8d41fc

Please sign in to comment.