Skip to content

Commit

Permalink
passed in researcher profile for read only dar
Browse files Browse the repository at this point in the history
  • Loading branch information
hams7504 committed Oct 2, 2023
1 parent 6d9efa9 commit 7c5d308
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pages/dar_application/DataAccessRequestApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ const DataAccessRequestApplication = (props) => {

const [formValidation, setFormValidation] = useState({ researcherInfoErrors: {}, darErrors: {}, rusErrors: {} });

const [researcherProfile, setResearcherProfile] = useState({});

const [nihValid, setNihValid] = useState(true);
const [showNihValidationError, setShowNihValidationError] = useState(false);

Expand Down Expand Up @@ -189,7 +191,7 @@ const DataAccessRequestApplication = (props) => {
});
if (!props.readOnlyMode) {
ApplicationTabs.push({ name: 'Data Use Agreement' });
setApplicationTabs(ApplicationTabs)
setApplicationTabs(ApplicationTabs);
}
}, [formData.datasetIds, props.readOnlyMode]);

Expand Down Expand Up @@ -229,6 +231,9 @@ const DataAccessRequestApplication = (props) => {

const init = useCallback(async () => {
const { dataRequestId, collectionId } = props.match.params;
const collection = await Collections.getCollectionById(collectionId);
const researcherProfile = await User.getById(collection.createUserId);
setResearcherProfile(researcherProfile);
let formData = {};
const researcher = await User.getMe();
const signingOfficials = await User.getSOsForCurrentUser();
Expand Down Expand Up @@ -533,7 +538,7 @@ const DataAccessRequestApplication = (props) => {
<ResearcherInfo
completed={!isNil(get('institutionId', researcher))}
readOnlyMode={props.readOnlyMode || isAttested}
researcherProfile={props.researcherProfile}
researcherProfile={props.readOnlyMode ? researcherProfile : researcher}
includeInstructions={!props.readOnlyMode}
darCode={formData.darCode}
formData={formData}
Expand Down

0 comments on commit 7c5d308

Please sign in to comment.