Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
CloneDialog: support non-admin users
Browse files Browse the repository at this point in the history
  • Loading branch information
suomiy authored and mareklibra committed Jul 22, 2019
1 parent ec9ce63 commit 3749a27
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions frontend/public/kubevirt/components/vm/menu-actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
BasicMigrationDialog,
isMigrating,
isVmRunning,
CloneDialog,
CloneVMModalFirehose,
getResource,
findVMIMigration,
getVmStatus,
Expand All @@ -12,15 +12,11 @@ import {
} from 'kubevirt-web-ui-components';
import { isEmpty } from 'lodash-es';

import { Kebab, LoadingInline } from '../utils/okdutils';
import { Kebab, LoadingInline, Firehose } from '../utils/okdutils';
import { k8sCreate, k8sPatch } from '../../module/okdk8s';
import {
VirtualMachineInstanceModel,
VirtualMachineInstanceMigrationModel,
NamespaceModel,
PersistentVolumeClaimModel,
VirtualMachineModel,
DataVolumeModel,
PodModel,
} from '../../models/index';
import { startStopVmModal } from '../modals/start-stop-vm-modal';
Expand All @@ -31,6 +27,7 @@ import {
} from '../utils/resources';
import { modalResourceLauncher } from '../utils/modalResourceLauncher';
import { showError } from '../utils/showErrors';
import { createModalLauncher } from '../../../components/factory';

const getStatusForVm = (vm, actionArgs) => {
if (!actionArgs) {
Expand Down Expand Up @@ -90,24 +87,7 @@ const menuActionClone = (kind, vm, actionArgs) => {
hidden: isImporting(vm, actionArgs),
label: 'Clone Virtual Machine',
callback: () => {
return modalResourceLauncher(CloneDialog, {
namespaces: {
resource: getResource(NamespaceModel),
required: true,
},
persistentVolumeClaims: {
resource: getResource(PersistentVolumeClaimModel),
required: true,
},
virtualMachines: {
resource: getResource(VirtualMachineModel),
required: true,
},
dataVolumes: {
resource: getResource(DataVolumeModel),
required: true,
},
})({vm, k8sCreate, k8sPatch, LoadingComponent: LoadingInline});
return createModalLauncher(CloneVMModalFirehose)({vm, Firehose, k8sCreate, k8sPatch, LoadingComponent: LoadingInline});
},
};
};
Expand Down

0 comments on commit 3749a27

Please sign in to comment.