Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix storage_controller to show custom buttons #3629

Merged
merged 1 commit into from
Mar 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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