Skip to content

Commit

Permalink
fix missing hmb form field
Browse files Browse the repository at this point in the history
fix h4 titles
make object values consistent in form field props
  • Loading branch information
rushtong committed Feb 3, 2024
1 parent 4f1740c commit 0fb9ee5
Showing 1 changed file with 57 additions and 44 deletions.
101 changes: 57 additions & 44 deletions src/pages/dar_application/DataAccessRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ export default function DataAccessRequest(props) {

return (
// eslint-disable-next-line react/no-unknown-property
<div datacy='data-access-request'>
<div className='dar-step-card'>
<div datacy={'data-access-request'}>
<div className={'dar-step-card'}>
<FormField
id={'datasetIds'}
key={'datasetIds'}
type={FormFieldTypes.SELECT}
id='datasetIds'
disabled={readOnlyMode}
isAsync={true}
isMulti={true}
title='2.1 Select Dataset(s)'
title={'2.1 Select Dataset(s)'}
validators={[FormValidators.REQUIRED]}
validation={validation.datasetIds}
onValidationChange={onValidationChange}
Expand All @@ -139,7 +139,7 @@ export default function DataAccessRequest(props) {
getOptionLabel: (opt) => opt.displayText,
}}
loadOptions={(query, callback) => searchDatasets(query, callback, datasets)}
placeholder='Dataset Name, Sample Collection ID, or PI'
placeholder={'Dataset Name, Sample Collection ID, or PI'}
onChange={async ({key, value}) => {
const datasets = value.map((val) => val.dataset);
const datasetIds = datasets?.map((ds) => ds.id || ds.dataSetId);
Expand All @@ -150,34 +150,34 @@ export default function DataAccessRequest(props) {
/>

<FormField
id={'projectTitle'}
key={'projectTitle'}
id='projectTitle'
title='2.2 Descriptive Title of Project'
title={'2.2 Descriptive Title of Project'}
disabled={readOnlyMode}
validators={[FormValidators.REQUIRED]}
validation={validation.projectTitle}
description={includeInstructions ? 'Please note that coordinated requests by External Collaborators should each use the same title.' : ''}
placeholder='Project Title'
placeholder={'Project Title'}
defaultValue={formData.projectTitle}
onChange={onChange}
onValidationChange={onValidationChange}
/>

<div className='dar-form-notice-card'>
<div className={'dar-form-notice-card'}>
<span>
In sections 2.3, 2.4, and 2.5, you are attesting that your proposed research will remain with the scope of the items selected below, and will be liable for any deviations. Further, it is to your benefit to be as specific as possible in your selections, as it will maximize the data available to you.
</span>
</div>

<FormField
id={'rus'}
key={'rus'}
id='rus'
disabled={readOnlyMode}
type={FormFieldTypes.TEXTAREA}
title='2.3 Research Use Statement (RUS)'
title={'2.3 Research Use Statement (RUS)'}
validators={[FormValidators.REQUIRED]}
description={includeInstructions ? '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. Examples of RUS can be found at' : ''}
placeholder='Please limit your RUS to 2200 characters.'
placeholder={'Please limit your RUS to 2200 characters.'}
rows={6}
maxLength={2200}
ariaLevel={ariaLevel + 3}
Expand All @@ -188,12 +188,12 @@ export default function DataAccessRequest(props) {
/>

<FormField
id={'diseases'}
key={'diseases'}
id='diseases'
title='Is the primary purpose of this research to investigate a specific disease(s)?'
title={<h4>Is the primary purpose of this research to investigate a specific disease(s)?</h4>}
disabled={readOnlyMode}
type={FormFieldTypes.YESNORADIOGROUP}
orientation='horizontal'
orientation={'horizontal'}
defaultValue={formData.diseases}
validation={validation.diseases}
onValidationChange={onValidationChange}
Expand All @@ -206,6 +206,7 @@ export default function DataAccessRequest(props) {

{formData.diseases === false &&
<FormField
id={'ontologies'}
key={'ontologies'}
type={FormFieldTypes.SELECT}
disabled={readOnlyMode}
Expand All @@ -214,23 +215,35 @@ export default function DataAccessRequest(props) {
isAsync={true}
optionsAreString={false}
loadOptions={autocompleteOntologies}
id='ontologies'
validators={[FormValidators.REQUIRED]}
placeholder='Please enter one or more diseases'
placeholder={'Please enter one or more diseases'}
defaultValue={formData.ontologies.map(formatOntologyForSelect)}
validation={validation.ontologies}
onValidationChange={onValidationChange}
onChange={({key, value}) => onChange({key, value: value.map(formatOntologyForFormData)})}
/>}

{formData.diseases === false &&
<FormField
id={'hmb'}
key={'hmb'}
type={FormFieldTypes.YESNORADIOGROUP}
disabled={readOnlyMode}
title={<h4>Is the primary purpose health/medical/biomedical research in nature?</h4>}
orientation={'horizontal'}
defaultValue={formData.hmb}
validation={validation.hmb}
onValidationChange={onValidationChange}
onChange={primaryChange}
/>}
{formData.hmb === false &&
<FormField
id={'poa'}
key={'poa'}
type={FormFieldTypes.YESNORADIOGROUP}
disabled={readOnlyMode}
title='Is the primary purpose of this research regarding population origins or ancestry?'
id='poa'
key='poa'
orientation='horizontal'
title={<h4>Is the primary purpose of this research regarding population origins or ancestry?</h4>}
orientation={'horizontal'}
defaultValue={formData.poa}
validation={validation.poa}
onValidationChange={onValidationChange}
Expand All @@ -239,12 +252,12 @@ export default function DataAccessRequest(props) {

{formData.poa === false &&
<FormField
id={'methods'}
key={'methods'}
type={FormFieldTypes.YESNORADIOGROUP}
disabled={readOnlyMode}
title='Is the primary purpose of this research to develop or validate new methods for analyzing/interpreting data?'
id='methods'
key='methods'
orientation='horizontal'
title={<h4>Is the primary purpose of this research to develop or validate new methods for analyzing/interpreting data?</h4>}
orientation={'horizontal'}
defaultValue={formData.methods}
validation={validation.methods}
onValidationChange={onValidationChange}
Expand All @@ -254,27 +267,27 @@ export default function DataAccessRequest(props) {

{formData.methods === false &&
<FormField
id={'otherText'}
key={'otherText'}
disabled={readOnlyMode}
title='If none of the above, please describe the primary purpose of your research:'
id='otherText'
orientation='horizontal'
placeholder='Please specify...'
title={<h4>If none of the above, please describe the primary purpose of your research:</h4>}
orientation={'horizontal'}
placeholder={'Please specify...'}
defaultValue={formData.other}
validation={validation.other}
onValidationChange={onValidationChange}
onChange={primaryChange}/>
}

<FormField
id={'nonTechRus'}
key={'nonTechRus'}
id='nonTechRus'
disabled={readOnlyMode}
type={FormFieldTypes.TEXTAREA}
title='2.4 Non-Technical Summary'
title={'2.4 Non-Technical Summary'}
validators={[FormValidators.REQUIRED]}
description={includeInstructions ? 'Please enter below a non-technical summary of your RUS suitable for understanding by the general public (written at a high school reading level or below).' : ''}
placeholder='Please limit your your non-technical summary to 1100 characters'
placeholder={'Please limit your your non-technical summary to 1100 characters'}
rows={6}
maxLength={1100}
ariaLevel={ariaLevel + 3}
Expand All @@ -285,45 +298,46 @@ export default function DataAccessRequest(props) {
/>

<FormFieldTitle
id={'dataUseAcknowledgements'}
key={'dataUseAcknowledgements'}
title='2.5 Data Use Acknowledgements'
title={'2.5 Data Use Acknowledgements'}
description={includeInstructions ? 'Please confirm listed acknowledgements and/or document requirements below:' : ''}
isRendered={needsGsoAcknowledgement(datasets) || needsDsAcknowledgement(dataUseTranslations) || needsPubAcknowledgement(datasets)}
/>

<FormField
id={'gsoAcknowledgement'}
key={'gsoAcknowledgement'}
id='gsoAcknowledgement'
disabled={readOnlyMode}
type={FormFieldTypes.CHECKBOX}
isRendered={needsGsoAcknowledgement(datasets)}
toggleText='I acknowledge that I have selected a dataset limited to use on genetic studies only (GSO). I attest that I will respect this data use condition.'
toggleText={'I acknowledge that I have selected a dataset limited to use on genetic studies only (GSO). I attest that I will respect this data use condition.'}
defaultValue={formData.gsoAcknowledgement}
onChange={onChange}
validation={validation.gsoAcknowledgement}
onValidationChange={onValidationChange}
/>

<FormField
id={'pubAcknowledgement'}
key={'pubAcknowledgement'}
id='pubAcknowledgement'
disabled={readOnlyMode}
isRendered={needsPubAcknowledgement(datasets)}
type={FormFieldTypes.CHECKBOX}
toggleText='I acknowledge that I have selected a dataset which requires results of studies using the data to be made available to the larger scientific community (PUB). I attest that I will respect this data use condition.'
toggleText={'I acknowledge that I have selected a dataset which requires results of studies using the data to be made available to the larger scientific community (PUB). I attest that I will respect this data use condition.'}
defaultValue={formData.pubAcknowledgement}
validation={validation.pubAcknowledgement}
onValidationChange={onValidationChange}
onChange={onChange}
/>

<FormField
id={'dsAcknowledgement'}
key={'dsAcknowledgement'}
id='dsAcknowledgement'
disabled={readOnlyMode}
isRendered={needsDsAcknowledgement(dataUseTranslations)}
type={FormFieldTypes.CHECKBOX}
toggleText='I acknowledge that the dataset can only be used in research consistent with the Data Use Limitations (DULs) and cannot be combined with other datasets of other phenotypes. Research uses inconsistent with DUL are considered a violation of the Data Use Certification agreement and any additional terms descried in the addendum'
toggleText={'I acknowledge that the dataset can only be used in research consistent with the Data Use Limitations (DULs) and cannot be combined with other datasets of other phenotypes. Research uses inconsistent with DUL are considered a violation of the Data Use Certification agreement and any additional terms descried in the addendum'}
defaultValue={formData.dsAcknowledgement}
validation={validation.dsAcknowledgement}
onValidationChange={onValidationChange}
Expand All @@ -333,7 +347,6 @@ export default function DataAccessRequest(props) {
{needsIrbApprovalDocument(datasets) &&
<FormFieldTitle
key={'irbApprovalDocument'}
title='2.6 IRB Approval Document'
description={includeInstructions ? 'One or more of the datasets you selected requires local IRB approval for use. Please upload your local IRB approval(s) here as a single document. When IRB approval is required and Expedited of Full Review is required, it must be completed annually. Determinations of Not Human Subjects Research (NHSR) by IRBs will not be accepted as IRB approval.' : ''}
/>
}
Expand All @@ -343,7 +356,7 @@ export default function DataAccessRequest(props) {
key={'irbDocument'}
type={FormFieldTypes.FILE}
disabled={readOnlyMode}
id='irbDocument'
id={'irbDocument'}
defaultValue={uploadedIrbDocument || {
name: formData.irbDocumentName,
}}
Expand All @@ -354,7 +367,7 @@ export default function DataAccessRequest(props) {
<FormField
key={'irbProtocolExpiration'}
readOnly={true}
id='irbProtocolExpiration'
id={'irbProtocolExpiration'}
defaultValue={`IRB Expires on ${irbProtocolExpiration}`}
/>
</div>
Expand All @@ -367,10 +380,10 @@ export default function DataAccessRequest(props) {
defaultValue={uploadedCollaborationLetter || {
name: formData.collaborationLetterName,
}}
id='collaborationLetter'
id={'collaborationLetter'}
validation={validation.collaborationLetter}
onValidationChange={onValidationChange}
description='One or more of the datasets you selected requires collaboration (COL) with the primary study investigators(s) for use. Please upload documentation of your collaboration here.'
description={'One or more of the datasets you selected requires collaboration (COL) with the primary study investigators(s) for use. Please upload documentation of your collaboration here.'}
onChange={({value}) => updateCollaborationLetter(value)}
/>
}
Expand Down

0 comments on commit 0fb9ee5

Please sign in to comment.