Skip to content

Commit

Permalink
Fix storage_controller to show custom buttons
Browse files Browse the repository at this point in the history
Closes #996

It cannot rely on @lastaction == 'show_list' because it's always 'explorer'. Introduced in ManageIQ/manageiq#11793
  • Loading branch information
ZitaNemeckova committed Mar 15, 2018
1 parent 166dd42 commit a7281e1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/controllers/storage_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,9 @@ def rebuild_toolbars(record_showing, presenter)
c_tb = build_toolbar(center_toolbar_filename) unless @in_a_form
h_tb = build_toolbar('x_history_tb')
v_tb = build_toolbar('x_gtl_view_tb') unless record_showing || (x_active_tree == :storage_pod_tree && x_node == 'root') || @in_a_form
cb_tb = build_toolbar(custom_toolbar_explorer)

presenter.reload_toolbars(:history => h_tb, :center => c_tb, :view => v_tb)
presenter.reload_toolbars(:history => h_tb, :center => c_tb, :view => v_tb, :custom => cb_tb)
presenter.set_visibility(h_tb.present? || c_tb.present? || v_tb.present?, :toolbar)
presenter[:record_id] = @record.try(:id)

Expand Down Expand Up @@ -524,6 +525,10 @@ def textual_group_list
end
helper_method :textual_group_list

def custom_toolbar_explorer
@record.present? ? Mixins::CustomButtons::Result.new(:single) : Mixins::CustomButtons::Result.new(:list)
end

menu_section :inf
has_custom_buttons
end

0 comments on commit a7281e1

Please sign in to comment.