V2Wizard: Remove manual partitioning for ISO only images

This hides the "Manually configure partitions" option from the FSC step for blueprints which have only ISO selected as a target.

There is already an alert in place for cases when ISO is combined with another target.
This commit is contained in:
regexowl 2024-04-29 09:50:53 +02:00 committed by Lucas Garfield
parent e76b0578e5
commit a4eeab7156
2 changed files with 12 additions and 1 deletions

View file

@ -8,10 +8,12 @@ import FileSystemPartition from './FileSystemPartition';
import { useAppSelector } from '../../../../store/hooks';
import { selectFileSystemPartitionMode } from '../../../../store/wizardSlice';
import { useHasIsoTargetOnly } from '../../utilities/hasIsoTargetOnly';
export type FileSystemPartitionMode = 'automatic' | 'manual';
const FileSystemStep = () => {
const fileSystemPartitionMode = useAppSelector(selectFileSystemPartitionMode);
const hasIsoTargetOnly = useHasIsoTargetOnly();
return (
<Form>
@ -19,7 +21,9 @@ const FileSystemStep = () => {
File system configuration
</Title>
<Text>Define the partitioning of the image</Text>
{fileSystemPartitionMode === 'automatic' ? (
{hasIsoTargetOnly ? (
<FileSystemAutomaticPartition />
) : fileSystemPartitionMode === 'automatic' ? (
<>
<FileSystemPartition />
<FileSystemAutomaticPartition />

View file

@ -0,0 +1,7 @@
import { useAppSelector } from '../../../store/hooks';
import { selectImageTypes } from '../../../store/wizardSlice';
export const useHasIsoTargetOnly = () => {
const environments = useAppSelector(selectImageTypes);
return environments.length === 1 && environments.includes('image-installer');
};