Skip to content

Commit

Permalink
Merge pull request #1051 from yaacov/allow-to-cancel-failed-vms
Browse files Browse the repository at this point in the history
Allow to remove faile vms from plan
  • Loading branch information
yaacov authored Apr 2, 2024
2 parents e4b0076 + 429f2e0 commit 113a183
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -21,12 +22,12 @@ export interface PlanVirtualMachinesProps extends RouteComponentProps {
}

const PlanVirtualMachines_: React.FC<PlanVirtualMachinesProps> = (props) => {
const migration = props?.obj?.plan?.status?.migration.vms;
const plan = props?.obj.plan;

if (migration === undefined) {
return <PlanVirtualMachinesList {...props} />;
} else {
if (isPlanExecuting(plan)) {
return <MigrationVirtualMachinesList {...props} />;
} else {
return <PlanVirtualMachinesList {...props} />;
}
};

Expand Down

0 comments on commit 113a183

Please sign in to comment.