diff --git a/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/VirtualMachines/Plan/PlanVirtualMachinesList.tsx b/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/VirtualMachines/Plan/PlanVirtualMachinesList.tsx index 5b5484955..9c94b0912 100644 --- a/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/VirtualMachines/Plan/PlanVirtualMachinesList.tsx +++ b/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/VirtualMachines/Plan/PlanVirtualMachinesList.tsx @@ -75,7 +75,8 @@ export const PlanVirtualMachinesList: FC<{ obj: PlanData }> = ({ obj }) => { const extendedProps = { ...props, toId: (item: VMData) => item?.specVM?.id, - canSelect: (item: VMData) => item?.statusVM?.started === undefined, + canSelect: (item: VMData) => + item?.statusVM?.started === undefined || item?.statusVM?.error !== undefined, onSelect: setSelectedIds, selectedIds: selectedIds, GlobalActionToolbarItems: actions, diff --git a/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/VirtualMachines/PlanVirtualMachines.tsx b/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/VirtualMachines/PlanVirtualMachines.tsx index 3aaa5b039..c0d8ccf6c 100644 --- a/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/VirtualMachines/PlanVirtualMachines.tsx +++ b/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/VirtualMachines/PlanVirtualMachines.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { RouteComponentProps } from 'react-router-dom'; +import { isPlanExecuting } from 'src/modules/Plans/utils'; import { useGetDeleteAndEditAccessReview } from 'src/modules/Providers/hooks'; import { ModalHOC } from 'src/modules/Providers/modals'; @@ -21,12 +22,12 @@ export interface PlanVirtualMachinesProps extends RouteComponentProps { } const PlanVirtualMachines_: React.FC = (props) => { - const migration = props?.obj?.plan?.status?.migration.vms; + const plan = props?.obj.plan; - if (migration === undefined) { - return ; - } else { + if (isPlanExecuting(plan)) { return ; + } else { + return ; } };