diff --git a/src/pages/dar_application/DataAccessRequestApplication.js b/src/pages/dar_application/DataAccessRequestApplication.js index 326664f0e..ebc23ed65 100644 --- a/src/pages/dar_application/DataAccessRequestApplication.js +++ b/src/pages/dar_application/DataAccessRequestApplication.js @@ -124,9 +124,6 @@ const DataAccessRequestApplication = (props) => { const [isLoading, setIsLoading] = useState(true); const [isAttested, setIsAttested] = useState(false); - if (!props.readOnlyMode) { - ApplicationTabs.push({ name: 'Data Use Agreement' }); - } const [applicationTabs, setApplicationTabs] = useState(ApplicationTabs); //helper function to coordinate local state changes as well as updates to form data on the parent @@ -190,7 +187,11 @@ const DataAccessRequestApplication = (props) => { fetchAllDatasets(formData.datasetIds).then((datasets) => { setDatasets(datasets); }); - }, [formData.datasetIds]); + if (!props.readOnlyMode) { + ApplicationTabs.push({ name: 'Data Use Agreement' }); + setApplicationTabs(ApplicationTabs) + } + }, [formData.datasetIds, props.readOnlyMode]); useEffect(() => { translateDataUseRestrictionsFromDataUseArray(datasets.map((ds) => ds.dataUse)).then((translations) => { @@ -607,4 +608,4 @@ const DataAccessRequestApplication = (props) => { ); }; -export default DataAccessRequestApplication; \ No newline at end of file +export default DataAccessRequestApplication; diff --git a/src/pages/dar_application/ResearcherInfo.js b/src/pages/dar_application/ResearcherInfo.js index 16a42ce4e..522edef0f 100644 --- a/src/pages/dar_application/ResearcherInfo.js +++ b/src/pages/dar_application/ResearcherInfo.js @@ -87,8 +87,8 @@ export default function ResearcherInfo(props) { div({className: 'dar-application-row'}, [ h3('1.2 Researcher Identification' + (formData.checkCollaborator ? ' (optional)' : '')), span({ className: `${showNihValidationError ? 'errored' : 'default-color'}`, isRendered: formData.checkCollaborator !== true }, [ - includeInstructions ? ('Please authenticate with ', - a({ target: '_blank', href: 'https://era.nih.gov/reg-accounts/register-commons.htm' }, ['eRA Commons']), ' in order to proceed.') : '' + includeInstructions ? ['Please authenticate with ', + a({ target: '_blank', href: 'https://era.nih.gov/reg-accounts/register-commons.htm' }, ['eRA Commons']), ' in order to proceed.'] : '' ]), div({ className: 'flex-row', style: { justifyContent: 'flex-start', alignItems: 'flex-start' } }, [ h4({ style: { marginRight: 30, marginTop: 30 } }, '1.2.1'),