Skip to content

Commit

Permalink
Remove the instance_ prefixed buttons from #hide_button? and #disable…
Browse files Browse the repository at this point in the history
…_button

(transferred from be8a8f5)
  • Loading branch information
Attila Vecerek committed Dec 20, 2016
1 parent 6d79212 commit d513a3b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions app/helpers/application_helper/toolbar_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,6 @@ def hide_button?(id)
return false if id.start_with?('history_')
return true if id == "blank_button" # Always hide the blank button placeholder

# hide compliance check and comparison buttons rendered for orchestration stack instances
return true if @record.kind_of?(OrchestrationStack) && @display == "instances" &&
%w(instance_check_compliance instance_compare).include?(id)

# need to hide add buttons when on sub-list view screen of a CI.
return true if id.ends_with?("_new", "_discover") &&
@lastaction == "show" && !["main", "vms"].include?(@display)
Expand Down Expand Up @@ -692,8 +688,7 @@ def disable_button(id)
case id
when "instance_perf", "vm_perf", "container_perf"
return N_("No Capacity & Utilization data has been collected for this VM") unless @record.has_perf_data?
when "instance_check_compliance", "vm_check_compliance"
model = model_for_vm(@record).to_s
when "vm_check_compliance"
unless @record.has_compliance_policies?
return N_("No Compliance Policies assigned to this virtual machine")
end
Expand All @@ -718,8 +713,6 @@ def disable_button(id)
if @record.current_state != "on"
return N_("The web-based VNC console is not available because the VM is not powered on")
end
when "instance_retire", "instance_retire_now"
return N_("Instance is already retired") if @record.retired
when "vm_timeline"
unless @record.has_events? || @record.has_events?(:policy_events)
return N_("No Timeline data has been collected for this VM")
Expand Down

0 comments on commit d513a3b

Please sign in to comment.