V2Wizard: change the default of file system table when user choose manual cunfiguration
this commit change the default table when user choose manual configuration at file system step
This commit is contained in:
parent
9020392969
commit
0b6cf44bbc
2 changed files with 20 additions and 8 deletions
|
|
@ -1,16 +1,19 @@
|
|||
import React from 'react';
|
||||
|
||||
import { FormGroup, Label, Radio } from '@patternfly/react-core';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { useAppDispatch, useAppSelector } from '../../../../store/hooks';
|
||||
import {
|
||||
changeFileSystemConfiguration,
|
||||
changeFileSystemPartitionMode,
|
||||
selectFileSystemPartitionMode,
|
||||
} from '../../../../store/wizardSlice';
|
||||
|
||||
const FileSystemPartition = () => {
|
||||
const id = uuidv4();
|
||||
const dispatch = useAppDispatch();
|
||||
const fileSystemPartition = useAppSelector((state) =>
|
||||
const fileSystemPartitionMode = useAppSelector((state) =>
|
||||
selectFileSystemPartitionMode(state)
|
||||
);
|
||||
return (
|
||||
|
|
@ -27,9 +30,10 @@ const FileSystemPartition = () => {
|
|||
}
|
||||
name="sc-radio-automatic"
|
||||
description="Automatically partition your image to what is best, depending on the target environment(s)"
|
||||
isChecked={fileSystemPartition === 'automatic'}
|
||||
isChecked={fileSystemPartitionMode === 'automatic'}
|
||||
onChange={() => {
|
||||
dispatch(changeFileSystemPartitionMode('automatic'));
|
||||
dispatch(changeFileSystemConfiguration([]));
|
||||
}}
|
||||
/>
|
||||
<Radio
|
||||
|
|
@ -37,9 +41,14 @@ const FileSystemPartition = () => {
|
|||
label="Manually configure partitions"
|
||||
name="fsc-radio-manual"
|
||||
description="Manually configure the file system of your image by adding, removing, and editing partitions"
|
||||
isChecked={fileSystemPartition === 'manual'}
|
||||
isChecked={fileSystemPartitionMode === 'manual'}
|
||||
onChange={() => {
|
||||
dispatch(changeFileSystemPartitionMode('manual'));
|
||||
dispatch(
|
||||
changeFileSystemConfiguration([
|
||||
{ id: id, mountpoint: '/', min_size: '500' },
|
||||
])
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue