Wizard: Add validation for kernel step
This adds validation for the Kernel step.
This commit is contained in:
parent
2d011c52e1
commit
bfef28999d
5 changed files with 64 additions and 1 deletions
|
|
@ -4,6 +4,8 @@ import { FormGroup } from '@patternfly/react-core';
|
|||
import {
|
||||
Alert,
|
||||
Button,
|
||||
HelperText,
|
||||
HelperTextItem,
|
||||
MenuToggle,
|
||||
MenuToggleElement,
|
||||
Select,
|
||||
|
|
@ -20,6 +22,7 @@ import {
|
|||
changeKernelName,
|
||||
selectKernel,
|
||||
} from '../../../../../store/wizardSlice';
|
||||
import { useKernelValidation } from '../../../utilities/useValidation';
|
||||
|
||||
const initialOptions = ['kernel', 'kernel-debug'];
|
||||
let kernelOptions = initialOptions;
|
||||
|
|
@ -28,6 +31,8 @@ const KernelName = () => {
|
|||
const dispatch = useAppDispatch();
|
||||
const kernel = useAppSelector(selectKernel).name;
|
||||
|
||||
const stepValidation = useKernelValidation();
|
||||
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [inputValue, setInputValue] = useState<string>('');
|
||||
const [filterValue, setFilterValue] = useState<string>('');
|
||||
|
|
@ -166,6 +171,13 @@ const KernelName = () => {
|
|||
))}
|
||||
</SelectList>
|
||||
</Select>
|
||||
{stepValidation.errors.kernel && (
|
||||
<HelperText>
|
||||
<HelperTextItem variant={'error'}>
|
||||
{stepValidation.errors.kernel}
|
||||
</HelperTextItem>
|
||||
</HelperText>
|
||||
)}
|
||||
</FormGroup>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue