mirror of https://github.com/portainer/portainer
update validation for storage classes (#10940)
parent
0e6a175bf6
commit
cf88570c39
|
@ -23,14 +23,15 @@ const storageClassFormValuesSchema = array()
|
|||
})
|
||||
)
|
||||
.test(
|
||||
// invalid if any storage class is not selected or if it's selected and at least one access mode is selected
|
||||
// invalid if any storage class is not selected or
|
||||
// if it's selected and at least one access mode is selected
|
||||
'accessModes',
|
||||
'Shared access policy configuration required.',
|
||||
(storageClasses) => {
|
||||
const isValid = storageClasses?.every(
|
||||
(value) =>
|
||||
!value.selected ||
|
||||
value.AccessModes?.some((accessMode) => accessMode.selected)
|
||||
(value.AccessModes && value.AccessModes?.length > 0)
|
||||
);
|
||||
return isValid || false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue