CreateImageWizard: target env validation

Validation is not enforced on the image output step
when selecting and then deselecting an image type. This
is because the only validation which is set is `Required`.
However, after deselecting an image type the input becomes
a key-value object with all the values set to false. This
commit adds a custom validator to check that at least one
value in the object is set to true. Fixes #575
This commit is contained in:
Gianluca Zuccarelli 2022-03-24 15:43:21 +00:00 committed by jkozol
parent 787e1ba5ce
commit 78123bff0e
5 changed files with 40 additions and 1 deletions

View file

@ -24,6 +24,7 @@ import {
import {
fileSystemConfigurationValidator,
targetEnvironmentValidator,
} from './validators';
const handleKeyDown = (e, handleClose) => {
@ -433,7 +434,7 @@ const CreateImageWizard = () => {
});
} }
defaultArch="x86_64"
customValidatorMapper={ { fileSystemConfigurationValidator, } }
customValidatorMapper={ { fileSystemConfigurationValidator, targetEnvironmentValidator } }
schema={ {
fields: [
{