Skip to content

Commit

Permalink
Allow to remove faile vms from plan
Browse files Browse the repository at this point in the history
Signed-off-by: yzamir <[email protected]>
  • Loading branch information
yaacov committed Apr 2, 2024
1 parent e4b0076 commit 429f2e0
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 429f2e0

Please sign in to comment.