chore(xo-web/copyVm): remove unused code (#3888)

This commit is contained in:
badrAZ 2019-01-21 16:25:05 +01:00 committed by Pierre Donias
parent bbf5e82c5d
commit eb4f9f0b18
2 changed files with 14 additions and 21 deletions

View File

@ -1625,7 +1625,6 @@ const messages = {
// ----- Copy VM ----- // ----- Copy VM -----
copyVm: 'Copy VM', copyVm: 'Copy VM',
copyVmConfirm: 'Are you sure you want to copy this VM to {SR}?',
copyVmName: 'Name', copyVmName: 'Name',
copyVmNamePattern: 'Name pattern', copyVmNamePattern: 'Name pattern',
copyVmNamePlaceholder: 'If empty: name of the copied VM', copyVmNamePlaceholder: 'If empty: name of the copied VM',

View File

@ -1003,26 +1003,20 @@ const _copyVm = ({ vm, sr, name, compress }) =>
}) })
import CopyVmModalBody from './copy-vm-modal' // eslint-disable-line import/first import CopyVmModalBody from './copy-vm-modal' // eslint-disable-line import/first
export const copyVm = (vm, sr, name, compress) => { export const copyVm = vm =>
return sr !== undefined confirm({
? confirm({ title: _('copyVm'),
title: _('copyVm'), body: <CopyVmModalBody vm={vm} />,
body: _('copyVmConfirm', { SR: sr.name_label }), }).then(params => {
}).then(() => _copyVm({ vm, sr: sr.id, name, compress })) if (params.copyMode === 'fullCopy') {
: confirm({ if (!params.sr) {
title: _('copyVm'), error(_('copyVmsNoTargetSr'), _('copyVmsNoTargetSrMessage'))
body: <CopyVmModalBody vm={vm} />, return
}).then(params => { }
if (params.copyMode === 'fullCopy') { return _copyVm({ vm, ...params })
if (!params.sr) { }
error(_('copyVmsNoTargetSr'), _('copyVmsNoTargetSrMessage')) return cloneVm({ id: vm.id, name_label: params.name })
return }, noop)
}
return _copyVm({ vm, ...params })
}
return cloneVm({ id: vm.id, name_label: params.name })
}, noop)
}
import CopyVmsModalBody from './copy-vms-modal' // eslint-disable-line import/first import CopyVmsModalBody from './copy-vms-modal' // eslint-disable-line import/first
export const copyVms = vms => { export const copyVms = vms => {