Skip to content

Commit

Permalink
Merge pull request #1475 from chalettu/openstack-revert-snap
Browse files Browse the repository at this point in the history
BZ#1630119 - Hide revert snapshot button for openstack vm's
  • Loading branch information
AllenBW authored Sep 19, 2018
2 parents cd784ea + c4047ab commit 41213c6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client/app/services/vms/snapshots.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ function ComponentController (VmsService, sprintf, EventNotifications, ListView,
resolveVm: resolveVm,
// Config
listConfig: getListConfig(),
menuActions: getMenuActions(),
menuActions: [],
listActions: getListActions(),
toolbarConfig: getToolbarConfig()
})
resolveSnapshots()
resolveVm()
resolveVm().then(() => {
vm.menuActions = getMenuActions()
})
}

function getToolbarConfig () {
Expand All @@ -63,12 +65,13 @@ function ComponentController (VmsService, sprintf, EventNotifications, ListView,
}

function getMenuActions () {
const revertUnsupported = (['openstack'].includes(vm.vm.vendor))
const menuActions = [{
name: __('Revert'),
actionName: 'revert',
title: __('Revert Snapshot'),
actionFn: revertSnapshot,
permissions: vm.permissions.revert
permissions: vm.permissions.revert && !revertUnsupported
}, {
name: __('Delete'),
actionName: 'delete',
Expand Down

0 comments on commit 41213c6

Please sign in to comment.