Skip to content

Commit

Permalink
Validate dependencies are selected, if required.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmfalke committed Nov 1, 2024
1 parent a7c4869 commit ccb7524
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/libs/user-datasets/src/lib/Components/UploadForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,16 @@ function validateForm<T extends string = string>(
const { name, summary, description, dataUploadSelection, dependencies } =
formContent;

if (
datasetUploadType.formConfig.dependencies?.required &&
dependencies == null
) {
return {
valid: false,
errors: [`Required: ${datasetUploadType.formConfig.dependencies.label}`],
};
}

if (!isCompleteDataUploadSelection(dataUploadSelection)) {
return {
valid: false,
Expand Down

0 comments on commit ccb7524

Please sign in to comment.