From d0c67a0abe3ec4eb122dae2ce6565c6a7ce5860d Mon Sep 17 00:00:00 2001 From: Gregory Rushton Date: Thu, 29 Feb 2024 10:00:30 -0500 Subject: [PATCH] [DUOS-2964][risk=no] DAR Form Cloud Use Validation Fixes (#2474) --- .../dar_application/DataAccessRequest.js | 4 +-- src/utils/darFormUtils.js | 26 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/pages/dar_application/DataAccessRequest.js b/src/pages/dar_application/DataAccessRequest.js index 7b8bbb8ef..2ebc396f4 100644 --- a/src/pages/dar_application/DataAccessRequest.js +++ b/src/pages/dar_application/DataAccessRequest.js @@ -133,7 +133,7 @@ export default function DataAccessRequest(props) { }; return ( - // eslint-disable-next-line react/no-unknown-property + // eslint-disable-next-line react/no-unknown-property

- A RUS is a brief description of the applicant"e;s proposed use of the dataset(s). The RUS will be reviewed by all parties responsible for data covered by this Data Access Request. Please note that if access is approved, you agree that the RUS, along with your name and institution, will be included on this website to describe your research project to the public. + A RUS is a brief description of the applicant's proposed use of the dataset(s). The RUS will be reviewed by all parties responsible for data covered by this Data Access Request. Please note that if access is approved, you agree that the RUS, along with your name and institution, will be included on this website to describe your research project to the public. Please enter your RUS in the area below. The RUS should be one or two paragraphs in length and include research objectives, the study design, and an analysis plan (including the phenotypic characteristics that will be tested for association with genetic variants). If you are requesting multiple datasets, please describe how you will use them. diff --git a/src/utils/darFormUtils.js b/src/utils/darFormUtils.js index 669c7b5ff..04a60cb85 100644 --- a/src/utils/darFormUtils.js +++ b/src/utils/darFormUtils.js @@ -130,23 +130,23 @@ const calcResearcherInfoErrors = (formData, labCollaboratorsCompleted, internalC } - - - if(isNil(formData.anvilUse)) { + if (isNil(formData.anvilUse)) { errors.anvilUse = requiredError; } else { - if(!formData.anvilUse && !formData.localUse && !formData.cloudUse) { + if (!formData.anvilUse && !formData.localUse && !formData.cloudUse) { errors.dataStorageAndAnalysis = requiredError; // one of them must be selected, this makes the whole section red until selected. } - - if(formData.cloudUse && (isStringEmpty(formData.cloudProvider))){ - errors.cloudProvider = requiredError; - } - if(formData.cloudUse && (isStringEmpty(formData.cloudProviderType))){ - errors.cloudProviderType = requiredError; - } - if(formData.cloudUse && (isStringEmpty(formData.cloudProviderDescription))){ - errors.cloudProviderDescription = requiredError; + // Cloud use sub-conditions only apply when Cloud Use Statement (section 1.8) selection is "No" + if (!formData.anvilUse) { + if (formData.cloudUse && (isStringEmpty(formData.cloudProvider))) { + errors.cloudProvider = requiredError; + } + if (formData.cloudUse && (isStringEmpty(formData.cloudProviderType))) { + errors.cloudProviderType = requiredError; + } + if (formData.cloudUse && (isStringEmpty(formData.cloudProviderDescription))) { + errors.cloudProviderDescription = requiredError; + } } }