From 86c46b049f37985babd8067ccd41223969db74ab Mon Sep 17 00:00:00 2001
From: Aarohi Nadkarni <68303030+aarohinadkarni@users.noreply.github.com>
Date: Thu, 23 May 2024 12:06:25 -0400
Subject: [PATCH] [DCJ-58] Update DAR application to indicate all required DAAs
(#2579)
---
.../dar_application/DataAccessAgreements.jsx | 88 +++++++++++++++++++
.../DataAccessRequestApplication.jsx | 28 ++++--
.../dar_application/DataUseAgreements.jsx | 2 +-
src/pages/dar_application/RequiredDAAs.jsx | 38 ++++++++
4 files changed, 147 insertions(+), 9 deletions(-)
create mode 100644 src/pages/dar_application/DataAccessAgreements.jsx
create mode 100644 src/pages/dar_application/RequiredDAAs.jsx
diff --git a/src/pages/dar_application/DataAccessAgreements.jsx b/src/pages/dar_application/DataAccessAgreements.jsx
new file mode 100644
index 000000000..6f16c11d8
--- /dev/null
+++ b/src/pages/dar_application/DataAccessAgreements.jsx
@@ -0,0 +1,88 @@
+import React, { useEffect, useState } from 'react';
+import {isNil} from 'lodash/fp';
+import { Notifications } from '../../libs/utils';
+import { DAA } from '../../libs/ajax/DAA';
+import RequiredDAAs from './RequiredDAAs';
+
+import './dar_application.css';
+
+export default function DataAccessAgreements(props) {
+
+ const {
+ save,
+ attest,
+ darCode,
+ isAttested,
+ cancelAttest,
+ datasets
+ } = props;
+ const [daas, setDaas] = useState([]);
+
+ useEffect(() => {
+ const init = async () => {
+ try {
+ const daaList = await DAA.getDaas();
+ setDaas(daaList);
+ } catch (error) {
+ Notifications.showError({
+ text: 'Error: Unable to retrieve DAAs from server',
+ });
+ }
+ };
+ init();
+ }, []);
+
+ const DAADownload = (id, fileName) => {
+ return (
+
+ );
+ };
+
+ return (
+
+
Data Access Agreements (DAA)
+
+
+
DUOS Code of Conduct
+
+
+ Failure to abide by any term within this Code of Conduct may result in revocation of approved access to datasets obtained through these repositories. Investigators who are approved to access data agree to:
+
+
+
+ - Use datasets solely in connection with the research project described in the approved Data Access Request for each dataset;
+ - Make no attempt to identify or contact individual participants or groups from whom data were collected, or generate information that could allow participants’ identities to be readily ascertained, without appropriate approvals from the submitting institution;
+ - Maintain the confidentiality of the data and not distribute them to any entity or individual beyond those specified in the approved Data Access Request;
+ - Adhere to the security best practices for controlled-access data subject to the genomic data sharing policy/policies listed below and ensure that only approved users can gain access to data files;
+ - Acknowledge the Intellectual property terms as specified in the Data Access Agreements and data use certification;
+ - Provide appropriate acknowledgement in any dissemination of research findings including the investigator(s) who generated the data, the funding source, accession numbers of the dataset, and the data repository from which the data were accessed; and,
+ - Report any inadvertent data release, break of data security, or other data management incidents in accordance with the terms specified in the Data Use Agreements below and data use certification.
+
+
+
+
+
+
+
+ {isNil(darCode) && isAttested &&
+ Cancel
+ }
+
+
+ );
+}
diff --git a/src/pages/dar_application/DataAccessRequestApplication.jsx b/src/pages/dar_application/DataAccessRequestApplication.jsx
index 5b3f9a1dc..fc4d65cbd 100644
--- a/src/pages/dar_application/DataAccessRequestApplication.jsx
+++ b/src/pages/dar_application/DataAccessRequestApplication.jsx
@@ -1,6 +1,7 @@
import React from 'react';
import { useEffect, useState, useCallback } from 'react';
import ResearcherInfo from './ResearcherInfo';
+import DataAccessAgreements from './DataAccessAgreements';
import DataUseAgreements from './DataUseAgreements';
import DataAccessRequest from './DataAccessRequest';
import ResearchPurposeStatement from './ResearchPurposeStatement';
@@ -22,6 +23,7 @@ import { assign, cloneDeep, get, head, isEmpty, isNil, isString, keys, map } fro
import './DataAccessRequestApplication.css';
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
+import { checkEnv, envGroups } from '../../utils/EnvironmentUtils';
import {
validateDARFormData
@@ -193,7 +195,7 @@ const DataAccessRequestApplication = (props) => {
setDatasets(datasets);
});
if (!props.readOnlyMode) {
- const updatedTabs = [...ApplicationTabs, { name: 'Data Use Agreement' }];
+ const updatedTabs = checkEnv(envGroups.DEV) ? [...ApplicationTabs, { name: 'Data Access Agreements (DAA)' }] : [...ApplicationTabs, { name: 'Data Use Agreement' }];
setApplicationTabs(updatedTabs);
}
}, [formData.datasetIds, props.readOnlyMode]);
@@ -606,13 +608,23 @@ const DataAccessRequestApplication = (props) => {
{!props.readOnlyMode ?
- setIsAttested(false)}
- isAttested={isAttested}
- attest={attemptSubmit}
- save={() => setShowDialogSave(true)}
- />
+ {checkEnv(envGroups.DEV) ?
+ setIsAttested(false)}
+ isAttested={isAttested}
+ attest={attemptSubmit}
+ save={() => setShowDialogSave(true)}
+ /> :
+ setIsAttested(false)}
+ isAttested={isAttested}
+ attest={attemptSubmit}
+ save={() => setShowDialogSave(true)}
+ />
+ }
: }
{isAttested &&
diff --git a/src/pages/dar_application/DataUseAgreements.jsx b/src/pages/dar_application/DataUseAgreements.jsx
index f28317743..a102049f6 100644
--- a/src/pages/dar_application/DataUseAgreements.jsx
+++ b/src/pages/dar_application/DataUseAgreements.jsx
@@ -72,4 +72,4 @@ export default function DataUseAgreements(props) {
);
-}
+}
\ No newline at end of file
diff --git a/src/pages/dar_application/RequiredDAAs.jsx b/src/pages/dar_application/RequiredDAAs.jsx
new file mode 100644
index 000000000..d208be0f0
--- /dev/null
+++ b/src/pages/dar_application/RequiredDAAs.jsx
@@ -0,0 +1,38 @@
+import React from 'react';
+
+export default function RequiredDAAs(props) {
+ const { datasets, daas, daaDownload } = props;
+ const fileNames = new Set();
+ const daaDivs = datasets.map((dataset) => {
+ const datasetDacId = dataset.dacId;
+ if (!datasetDacId) {
+ return ;
+ }
+ const daa = daas.find((daa) => daa.dacs.some((d) => d.dacId === datasetDacId));
+ const id = daa.daaId;
+ const fileName = daa.file.fileName.split('.')[0];
+ if (fileNames.has(fileName)) {
+ return ;
+ }
+ fileNames.add(fileName);
+ return (
+
+ {daaDownload(id, fileName)}
+
+ );
+ });
+ if (fileNames.size === 0) {
+ return (
+
+ );
+ } else {
+ return (
+
+
By submitting this data access request and in accordance with your Institution’s issuance of Library Cards to you for the agreement(s) below.
+
+ {daaDivs}
+
+
+ );
+ }
+}
\ No newline at end of file