Skip to content

Commit

Permalink
Show VMs in migration plan creation wizard
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Wels <[email protected]>
  • Loading branch information
awels committed Jun 14, 2024
1 parent 67e4ee3 commit 589805a
Show file tree
Hide file tree
Showing 4 changed files with 1,210 additions and 1,698 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"jest": "^26.0.1",
"json-merge-patch": "^0.2.3",
"mini-css-extract-plugin": "^1.5.0",
"node-sass": "^7.0.0",
"nodemon": "^2.0.4",
"prettier": "^2.2.1",
"redux-mock-store": "^1.5.4",
Expand Down Expand Up @@ -129,6 +128,5 @@
"optionator": "^0.9.3",
"semver": "7.5.2",
"tough-cookie": "4.1.3"

}
}
55 changes: 29 additions & 26 deletions src/app/home/pages/PlansPage/components/Wizard/NamespacesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
import React, { useEffect } from 'react';
import { useFormikContext } from 'formik';
import { IFormValues } from './WizardContainer';
import {
Button,
DropdownDirection,
Flex,
FlexItem,
FormGroup,
GridItem,
Text,
TextContent,
TextVariants,
Level,
LevelItem,
Pagination,
PaginationVariant,
DropdownDirection,
TextInput,
FlexItem,
Flex,
Popover,
PopoverPosition,
FormGroup,
Button,
Text,
TextContent,
TextInput,
TextVariants,
} from '@patternfly/react-core';
import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons';
import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon';
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
import {
IRowData,
sortable,
TableComposable,
Tbody,
Td,
Th,
Thead,
Tr,
sortable,
} from '@patternfly/react-table';
import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
import { useFilterState, useSortState } from '../../../../../common/duck/hooks';
import { useFormikContext } from 'formik';
import React, { useEffect } from 'react';
import { useSelector } from 'react-redux';
import { DefaultRootState } from '../../../../../../configureStore';
import {
FilterToolbar,
FilterCategory,
FilterToolbar,
FilterType,
} from '../../../../../common/components/FilterToolbar';
import TableEmptyState from '../../../../../common/components/TableEmptyState';
import { useFilterState, useSortState } from '../../../../../common/duck/hooks';
import { usePaginationState } from '../../../../../common/duck/hooks/usePaginationState';
import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon';
import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons';
import { useDelayValidation, validatedState } from '../../../../../common/helpers';
import { ISourceClusterNamespace } from '../../../../../plan/duck/types';
import { useSelector } from 'react-redux';
import { planSelectors } from '../../../../../plan/duck';
import { DefaultRootState } from '../../../../../../configureStore';
import { ISourceClusterNamespace } from '../../../../../plan/duck/types';
import { IFormValues } from './WizardContainer';
const styles = require('./NamespacesTable.module').default;

const NamespacesTable: React.FunctionComponent = () => {
Expand All @@ -68,6 +68,7 @@ const NamespacesTable: React.FunctionComponent = () => {
{ title: 'Pods', transforms: [sortable] },
{ title: 'PV claims', transforms: [sortable] },
{ title: 'Services', transforms: [sortable] },
{ title: 'Virtual Machines', transforms: [sortable] },
values.migrationType.value !== 'scc' && { title: 'Target name', transforms: [sortable] },
];
const getSortValues = (namespace: any) => [
Expand Down Expand Up @@ -122,6 +123,7 @@ const NamespacesTable: React.FunctionComponent = () => {
namespace.podCount,
namespace.pvcCount,
namespace.serviceCount,
namespace.vmCount,
values.migrationType.value !== 'scc' && targetNamespaceName,
],
selected: values.selectedNamespaces.includes(namespace.name),
Expand Down Expand Up @@ -229,10 +231,11 @@ const NamespacesTable: React.FunctionComponent = () => {
<Th width={10}>{columns[1].title}</Th>
<Th width={10}>{columns[2].title}</Th>
<Th width={10}>{columns[3].title}</Th>
<Th width={20}>{columns[4].title}</Th>
{values.migrationType.value !== 'scc' && (
<>
<Th width={30}>
{columns[4].title}
{columns[5].title}
<Popover
position={PopoverPosition.right}
bodyContent={
Expand Down Expand Up @@ -424,12 +427,12 @@ const NamespacesTable: React.FunctionComponent = () => {
onClick={() => {
setEditableRow(rowIndex);
handleDelayedValidation(
typeof row.cells[4] === 'string' ? row.cells[4] : '',
typeof row.cells[5] === 'string' ? row.cells[5] : '',
row,
rowIndex
);
setFieldValue(currentTargetNamespaceNameKey, {
name: row.cells[4],
name: row.cells[5],
srcName: row.cells[0],
});
}}
Expand Down
2 changes: 1 addition & 1 deletion src/app/plan/duck/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
MigrationStepsType,
MigrationType,
} from '../../home/pages/PlansPage/types';
import { ICurrentPlanStatus } from './reducers';

export type PvCopyMethod = 'filesystem' | 'snapshot';

Expand Down Expand Up @@ -200,6 +199,7 @@ export interface ISourceClusterNamespace {
podCount: number;
pvcCount: number;
serviceCount: number;
vmCount: number;
id: string | number;
}

Expand Down
Loading

0 comments on commit 589805a

Please sign in to comment.