Skip to content

Commit

Permalink
[DUOS-2964][risk=no] DAR Form Cloud Use Validation Fixes (#2474)
Browse files Browse the repository at this point in the history
  • Loading branch information
rushtong authored Feb 29, 2024
1 parent 9dd45b1 commit d0c67a0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/pages/dar_application/DataAccessRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
<div datacy={'data-access-request'}>
<div className={'dar-step-card'}>
<FormField
Expand Down Expand Up @@ -196,7 +196,7 @@ export default function DataAccessRequest(props) {
description={
<>
<p>
A RUS is a brief description of the applicant&quote;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&apos;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.
<span>
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.
</span>
Expand Down
26 changes: 13 additions & 13 deletions src/utils/darFormUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit d0c67a0

Please sign in to comment.