Skip to content

Commit eaf376e

Browse files
committed
Wizard: Make partitions a FileSystemTable prop
Move partitions outside of FileSystemTable and pass them as a prop.
1 parent 198d644 commit eaf376e

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/Components/CreateImageWizard/steps/FileSystem/components/FileSystemConfiguration.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import {
2525
import UsrSubDirectoriesDisabled from '../../../UsrSubDirectoriesDisabled';
2626

2727
const FileSystemConfiguration = () => {
28-
const partitions = useAppSelector(selectFilesystemPartitions);
2928
const environments = useAppSelector(selectImageTypes);
29+
const filesystemPartitions = useAppSelector(selectFilesystemPartitions);
3030

3131
const dispatch = useAppDispatch();
3232

@@ -58,7 +58,7 @@ const FileSystemConfiguration = () => {
5858
<Content>
5959
<Content component={ContentVariants.h3}>Configure partitions</Content>
6060
</Content>
61-
{partitions.find((partition) =>
61+
{filesystemPartitions.find((partition) =>
6262
partition.mountpoint.includes('/usr'),
6363
) && <UsrSubDirectoriesDisabled />}
6464
<Content>
@@ -94,7 +94,7 @@ const FileSystemConfiguration = () => {
9494
)} images`}
9595
/>
9696
)}
97-
<FileSystemTable />
97+
<FileSystemTable partitions={filesystemPartitions} />
9898
<Content>
9999
<Button
100100
className='pf-v6-u-text-align-left'

src/Components/CreateImageWizard/steps/FileSystem/components/FileSystemTable.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ import {
1414
import MinimumSizePopover from './MinimumSizePopover';
1515
import Row from './Row';
1616

17-
import { useAppDispatch, useAppSelector } from '../../../../../store/hooks';
18-
import {
19-
changePartitionOrder,
20-
selectFilesystemPartitions,
21-
} from '../../../../../store/wizardSlice';
17+
import { useAppDispatch } from '../../../../../store/hooks';
18+
import { changePartitionOrder } from '../../../../../store/wizardSlice';
19+
import { FilesystemPartition } from '../fscTypes';
20+
21+
type FileSystemTableTypes = {
22+
partitions: FilesystemPartition[];
23+
};
2224

23-
const FileSystemTable = () => {
25+
const FileSystemTable = ({ partitions }: FileSystemTableTypes) => {
2426
const [draggedItemId, setDraggedItemId] = useState<string | null>(null);
2527
const [draggingToItemIndex, setDraggingToItemIndex] = useState<number | null>(
2628
null,
@@ -29,7 +31,6 @@ const FileSystemTable = () => {
2931
const [tempItemOrder, setTempItemOrder] = useState<string[]>([]);
3032

3133
const bodyRef = useRef<HTMLTableSectionElement>(null);
32-
const partitions = useAppSelector(selectFilesystemPartitions);
3334
const itemOrder = partitions.map((partition) => partition.id);
3435
const dispatch = useAppDispatch();
3536
const isValidDrop = (

0 commit comments

Comments
 (0)