V2Wizard: fix remove partition funtionallity (HMS-3753)
this commit add the remove partition functionlity to file system step
This commit is contained in:
parent
918d02707f
commit
0d2735fe0f
2 changed files with 17 additions and 2 deletions
|
|
@ -26,6 +26,7 @@ import {
|
|||
changePartitionMinSize,
|
||||
changePartitionMountpoint,
|
||||
selectImageTypes,
|
||||
removePartition,
|
||||
selectPartitions,
|
||||
} from '../../../../store/wizardSlice';
|
||||
import UsrSubDirectoriesDisabled from '../../UsrSubDirectoriesDisabled';
|
||||
|
|
@ -163,6 +164,11 @@ const getSuffix = (mountpoint: string) => {
|
|||
|
||||
const Row = ({ partition }: RowPropTypes) => {
|
||||
const [units, setUnits] = useState<Units>('MiB');
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const handleRemovePartition = (id: string) => {
|
||||
dispatch(removePartition(id));
|
||||
};
|
||||
|
||||
return (
|
||||
<Tr>
|
||||
|
|
@ -184,9 +190,9 @@ const Row = ({ partition }: RowPropTypes) => {
|
|||
<Button
|
||||
variant="link"
|
||||
icon={<MinusCircleIcon />}
|
||||
onClick={() => {}}
|
||||
onClick={() => handleRemovePartition(partition.id)}
|
||||
data-testid="remove-mount-point"
|
||||
isDisabled={true}
|
||||
isDisabled={partition.mountpoint === '/'}
|
||||
/>
|
||||
</Td>
|
||||
</Tr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue