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

Toolbar buttons converted to use generic class with disable #10366

Merged
Show file tree
Hide file tree
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
15 changes: 0 additions & 15 deletions app/helpers/application_helper/button/vm_reset.rb

This file was deleted.

15 changes: 0 additions & 15 deletions app/helpers/application_helper/button/vm_stop.rb

This file was deleted.

15 changes: 0 additions & 15 deletions app/helpers/application_helper/button/vm_suspend.rb

This file was deleted.

9 changes: 6 additions & 3 deletions app/helpers/application_helper/toolbar/x_vm_center.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,23 +196,26 @@ class ApplicationHelper::Toolbar::XVmCenter < ApplicationHelper::Toolbar::Basic
N_('Power Off'),
:image => "power_off",
:confirm => N_("Power Off this VM?"),
:klass => ApplicationHelper::Button::VmStop),
:klass => ApplicationHelper::Button::GenericFeatureButtonWithDisable,
:options => {:feature => :stop}),
button(
:vm_suspend,
nil,
N_('Suspend this VM'),
N_('Suspend'),
:image => "power_suspend",
:confirm => N_("Suspend this VM?"),
:klass => ApplicationHelper::Button::VmSuspend),
:klass => ApplicationHelper::Button::GenericFeatureButtonWithDisable,
:options => {:feature => :suspend}),
button(
:vm_reset,
nil,
N_('Reset this VM'),
N_('Reset'),
:image => "power_reset",
:confirm => N_("Reset this VM?"),
:klass => ApplicationHelper::Button::VmReset),
:klass => ApplicationHelper::Button::GenericFeatureButtonWithDisable,
:options => {:feature => :reset}),
]
),
button(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe ApplicationHelper::Button::GenericFeatureButtonWithDisable do
[:start].each do |feature|
[:start, :stop, :suspend, :reset].each do |feature|
describe '#skip?' do
context "when vm supports feature #{feature}" do
before do
Expand Down
37 changes: 0 additions & 37 deletions spec/helpers/application_helper/buttons/vm_reset_spec.rb

This file was deleted.

46 changes: 0 additions & 46 deletions spec/helpers/application_helper/buttons/vm_stop_spec.rb

This file was deleted.

46 changes: 0 additions & 46 deletions spec/helpers/application_helper/buttons/vm_suspend_spec.rb

This file was deleted.