Skip to content

Commit

Permalink
updated validation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanfazakas committed Oct 13, 2023
1 parent 903faa2 commit 363e304
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.

This file was deleted.

15 changes: 9 additions & 6 deletions src/components/Publish/_validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ const validationMetadata = {
tags: Yup.array<string[]>().nullable(),
dockerImage: Yup.string().when('type', {
is: 'algorithm',
then: Yup.array()
.of(Yup.object().shape(validationAlgorithmContianerParameters))
.required('Required'),
otherwise: Yup.array()
.nullable()
.transform((value) => value || null)
then: Yup.string().required('Required')
}),
dockerImageCustomChecksum: Yup.string().when('type', {
is: 'algorithm',
then: Yup.string().required('Required')
}),
dockerImageCustomEntrypoint: Yup.string().when('type', {
is: 'algorithm',
then: Yup.string().required('Required')
}),
termsAndConditions: Yup.boolean()
.required('Required')
Expand Down

0 comments on commit 363e304

Please sign in to comment.