Skip to content

Commit

Permalink
Merge pull request #2784 from hstastna/Cannot_retire_VM
Browse files Browse the repository at this point in the history
Make /report_data protect @lastaction. Fix "No items were selected for XXXXX"
(cherry picked from commit e55eea0)

https://bugzilla.redhat.com/show_bug.cgi?id=1517842
  • Loading branch information
Martin Povolny authored and simaishi committed Nov 27, 2017
1 parent 8875886 commit 65fdeaa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Expand Up @@ -17,7 +17,8 @@ class ApplicationController
:listicon,
:embedded,
:showlinks,
:policy_sim
:policy_sim,
:lastaction
) do
def self.from_options(options)
additional_options = new
Expand All @@ -38,6 +39,7 @@ def with_quadicon_options(options)
self.embedded = options[:embedded]
self.showlinks = options[:showlinks]
self.policy_sim = options[:policy_sim]
self.lastaction = options[:lastaction]
end

def with_row_button(row_button)
Expand Down
3 changes: 2 additions & 1 deletion app/helpers/application_helper.rb
Expand Up @@ -1636,7 +1636,8 @@ def process_show_list_options(options, curr_model = nil)
:listicon => @listicon,
:embedded => @embedded,
:showlinks => @showlinks,
:policy_sim => @policy_sim
:policy_sim => @policy_sim,
:lastaction => @lastaction
)
@report_data_additional_options.with_row_button(@row_button) if @row_button
@report_data_additional_options.with_menu_click(params[:menu_click]) if params[:menu_click]
Expand Down
8 changes: 8 additions & 0 deletions spec/controllers/vm_infra_controller_spec.rb
Expand Up @@ -19,6 +19,14 @@
render_views

it 'can render the explorer' do
expect_any_instance_of(GtlHelper).to receive(:render_gtl).with match_gtl_options(
:model_name => 'VmOrTemplate',
:report_data_additional_options => {
:model => "VmOrTemplate",
:lastaction => 'show_list'
}
)

get :explorer
expect(response.status).to eq(200)
expect(response.body).to_not be_empty
Expand Down

0 comments on commit 65fdeaa

Please sign in to comment.