diff --git a/cypress/component/Home/home.spec.jsx b/cypress/component/Home/home.spec.jsx
new file mode 100644
index 000000000..b019921e1
--- /dev/null
+++ b/cypress/component/Home/home.spec.jsx
@@ -0,0 +1,115 @@
+/* eslint-disable no-undef */
+import React from 'react';
+import { mount } from 'cypress/react';
+import { MemoryRouter } from 'react-router-dom';
+import Home from '../../../src/pages/Home';
+
+describe('Home Page - Tests', function() {
+ describe('When user is not logged in', function() {
+ beforeEach(() => {
+ mount(
+
+
+
+ );
+ });
+
+ it('renders the page header correctly', function() {
+ cy.contains('Data Use Oversight System').should('be.visible');
+ cy.contains('Expediting compliant data sharing').should('be.visible');
+ });
+
+ it('renders the Data Libraries section with consistent message', function() {
+ cy.contains('Data Libraries in DUOS').should('be.visible');
+ cy.contains('Click the images below to view curated Data Libraries').should('be.visible');
+ });
+
+ it('displays tooltips with login required message for data libraries', function() {
+ cy.get('[data-for="anvil"]').find('span[title="Please login to access AnVIL Data Library"]').should('exist');
+ cy.get('[data-for="broad"]').find('span[title="Please login to access Broad Institute Data Library"]').should('exist');
+ cy.get('[data-for="hca"]').find('span[title="Please login to access Human Cell Atlas Data Library"]').should('exist');
+ });
+
+ it('interacts with library card links when not logged in', function() {
+ cy.get('.logo-card').should('have.length', 3);
+ cy.get('.logo-card').each($card => {
+ cy.wrap($card).find('a').should('exist');
+ });
+
+ // Create a spy on replaceState to check if URL parameters are updated
+ cy.window().then((win) => {
+ cy.spy(win.history, 'replaceState').as('replaceState');
+ });
+
+ // Stub document.querySelectorAll to simulate no sign-in button found (fallback case)
+ cy.window().then((win) => {
+ cy.stub(win.document, 'querySelectorAll').returns([]);
+ });
+
+ // Also stub scrollTo for the fallback behavior
+ cy.window().then((win) => {
+ cy.stub(win, 'scrollTo').as('scrollTo');
+ });
+
+ cy.get('.logo-card').first().find('a').click({ force: true });
+
+ cy.get('@replaceState').should('be.called');
+ cy.get('@scrollTo').should('be.called');
+
+ // URL should contain the redirectTo parameter
+ cy.location('search').should('include', 'redirectTo=%2Fdatalibrary%2Fanvil');
+ });
+ });
+
+ describe('When user is logged in', function() {
+ beforeEach(() => {
+ mount(
+
+
+
+ );
+ });
+
+ it('renders the page header correctly', function() {
+ cy.contains('Data Use Oversight System').should('be.visible');
+ cy.contains('Expediting compliant data sharing').should('be.visible');
+ });
+
+ it('renders the Data Libraries section with clickable message', function() {
+ cy.contains('Data Libraries in DUOS').should('be.visible');
+ cy.contains('Click the images below to view curated Data Libraries').should('be.visible');
+ });
+
+ it('displays tooltips with correct text for data libraries', function() {
+ cy.get('[data-for="anvil"]').find('span[title="AnVIL"]').should('exist');
+ cy.get('[data-for="broad"]').find('span[title="Broad Institute"]').should('exist');
+ cy.get('[data-for="hca"]').find('span[title="Human Cell Atlas"]').should('exist');
+ });
+
+ it('has direct navigation links when logged in', function() {
+ cy.get('a[href="/datalibrary/anvil"]').should('exist');
+ cy.get('a[href="/datalibrary/broad"]').should('exist');
+ cy.get('a[href="/datalibrary/HCA"]').should('exist');
+ });
+
+ it('navigates directly without calling handleSignIn when logged in', function() {
+ cy.window().then((win) => {
+ cy.spy(win.history, 'replaceState').as('replaceState');
+ });
+ cy.get('a[href="/datalibrary/anvil"]').click({ force: true });
+ cy.get('@replaceState').should('not.be.called');
+ });
+
+ it('displays logos horizontally on desktop', function() {
+ cy.viewport(1200, 800);
+ cy.get('.logo-grid').should('have.css', 'flex-direction', 'row');
+ cy.get('.logo-card').should('have.length', 3);
+ });
+
+ it('displays logos vertically on mobile', function() {
+ cy.viewport(600, 800);
+ cy.get('.logo-grid').should('have.css', 'flex-direction', 'column');
+ cy.get('.logo-card').should('have.length', 3);
+ });
+ });
+});
\ No newline at end of file
diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx
index 069858b3b..43fd80f35 100644
--- a/src/pages/Home.jsx
+++ b/src/pages/Home.jsx
@@ -1,11 +1,15 @@
import React from 'react';
-import { ReadMore } from '../components/ReadMore';
import homeHeaderBackground from '../images/home_header_background.png';
import duosLogoImg from '../images/duos_logo.svg';
import duosDiagram from '../images/DUOS_Homepage_diagram.svg';
+import broadLogo from '../images/broad_logo_allwhite.png';
+import anvilLogo from '../images/anvil-logo.svg';
+import hcaLogo from '../images/human-cell-atlas-logo.png';
+import { OverflowTooltip } from '../components/Tooltips';
import { Link } from 'react-router-dom';
const Home = (props) => {
+ const { isLogged } = props;
const homeTitle = {
color: '#FFFFFF',
@@ -61,24 +65,60 @@ const Home = (props) => {
padding: '10px 1rem',
};
- const paragraph = {
- color: '#1F3B50',
- padding: '0 5rem 2rem 5rem',
- fontFamily: 'Montserrat',
- fontSize: '14px',
- textAlign: 'justify',
- textIndent: '10px'
+ const logoGrid = {
+ display: 'flex',
+ gap: '3rem',
+ justifyContent: 'center',
+ alignItems: 'center',
+ flexWrap: 'nowrap',
+ width: '100%',
};
- const readMoreStyle = {
- fontFamily: 'Montserrat',
- fontSize: '14px',
- fontWeight: 500,
- textAlign: 'center',
- display: 'block'
+ const baseCard = {
+ width: 'clamp(240px, 26vw, 320px)',
+ aspectRatio: '2 / 1',
+ borderRadius: '6px',
+ boxShadow: '0 1px 4px rgba(0,0,0,0.06)',
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
+ position: 'relative',
+ };
+
+ const logoImg = {
+ width: '100%',
+ height: '100%',
+ objectFit: 'contain',
+ display: 'block',
+ };
+
+ const handleSignIn = (redirectPath) => {
+ // Set the redirectTo parameter without forcing a page reload
+ const currentUrl = new URL(window.location.href);
+ currentUrl.searchParams.set('redirectTo', redirectPath);
+ window.history.replaceState({}, '', currentUrl);
+
+ // Find the existing sign-in button in the header and programmatically click it
+ // This will trigger the existing authentication flow with all proper session handling
+ const signInButtons = document.querySelectorAll('button');
+ const signInButton = Array.from(signInButtons).find(button =>
+ button.textContent && button.textContent.trim() === 'Sign In'
+ );
+ if (signInButton) {
+ signInButton.click();
+ } else {
+ // Fallback - scroll to top where the sign-in button is located
+ window.scrollTo({ top: 0, behavior: 'smooth' });
+ }
};
return (
+ <>
+
@@ -125,37 +165,71 @@ const Home = (props) => {
-
-
-
-
Overview of DUOS
-
- Increasingly, a major challenge to data sharing is navigating the complex web of restrictions on secondary data use. Human subjects datasets often have complex and/or ambiguous restrictions on future use deduced from the original consent form, which must be respected when utilizing data. Previously, such data use restrictions were uniquely drafted across institutions, creating vast inconsistencies and requiring the investment of significant human effort to determine if researchers should be permitted to use the data. With support from DUOS team members, the Global Alliance for Genomics and Health (GA4GH) published a solution for this ambiguous and inconsistent data sharing language in the form of their
- {' '}
- Machine Readable Consent Guidance.
- {' '}
- For help determining your data's permitted uses, try our
- {' '}
- Data Sharing Language Tool, which follows GA4GH guidelines.
-
- ]}
- moreContent={[
-
-
As part of our efforts to enhance collaborative research, the Broad Institute developed the “Data Use Oversight System” (DUOS) to semi-automate and efficiently manage compliant sharing of human subjects data. DUOS' objective is two-fold, to enhance data access committee's confidence that data use restrictions are respected while efficiently enabling appropriate data access.
-
To better enable the use of existing human subjects datasets in future projects, DUOS mimics, in a semi-automated fashion, the data access request review processes common to DACs globally, like those in dbGaP. To this end, the system includes interfaces to capture and structure data use restrictions and data access requests as machine-readable data use terms based on the GA4GH's Data Use Ontology. With these machine-readable terms for dataset's use limitations and data access requests established, DUOS is able to trigger a matching algorithm to reason if data access should be granted given the research purpose and the data restrictions, serving as a decision support tool for DACs using DUOS.
-
To evaluate the feasibility of using machine readable data use terms to interpret data use restrictions and access requests, we are piloting a trial of DUOS overseen by Partners’ Healthcare IRB. During the pilot, DACs comprised of governmental and non-governmental data custodians will pilot the use of DUOS, its ability to structure use limitations and access requests, and the accuracy of the DUOS algorithm. This aids us in improving the DUOS algorithm and providing feedback on the GA4GH Data Use Ontology based on experts’ feedback.
-
- ]}
- />
+
+
+
+
Data Libraries in DUOS
+
+ Click the images below to view curated Data Libraries, and search and request access to data.
+