From ccb752491c242237e83b3787073699d77bc5293c Mon Sep 17 00:00:00 2001 From: Dave Falke Date: Fri, 1 Nov 2024 08:41:09 -0400 Subject: [PATCH] Validate dependencies are selected, if required. --- .../user-datasets/src/lib/Components/UploadForm.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/libs/user-datasets/src/lib/Components/UploadForm.tsx b/packages/libs/user-datasets/src/lib/Components/UploadForm.tsx index 96408be449..396702394f 100644 --- a/packages/libs/user-datasets/src/lib/Components/UploadForm.tsx +++ b/packages/libs/user-datasets/src/lib/Components/UploadForm.tsx @@ -603,6 +603,16 @@ function validateForm( 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,