diff --git a/cypress/component/QueryForm.cy.tsx b/cypress/component/QueryForm.cy.tsx index eba1f0d5..77e4039d 100644 --- a/cypress/component/QueryForm.cy.tsx +++ b/cypress/component/QueryForm.cy.tsx @@ -96,6 +96,37 @@ describe('QueryForm', () => { cy.get('[data-cy="Pipeline name-categorical-field"]').should('be.visible'); cy.get('[data-cy="Pipeline version-categorical-field"]').should('be.visible'); cy.get('[data-cy="submit-query-button"]').should('be.visible'); + cy.get('[data-cy="how-to-get-data-dialog-button"]').should('be.visible'); + }); + it('Clicking the how to get data dialog button should open the dialog', () => { + cy.mount( + + ); + cy.get('[data-cy="get-data-dialog"]').should('not.exist'); + cy.get('[data-cy="how-to-get-data-dialog-button"]').click(); + cy.get('[data-cy="get-data-dialog"]').should('be.visible'); }); it('Fires updateCategoricalQueryParams event handler with the appropriate payload when a categorical field is selected', () => { const updateCategoricalQueryParamsSpy = cy.spy().as('updateCategoricalQueryParamsSpy'); diff --git a/cypress/component/ResultContainer.cy.tsx b/cypress/component/ResultContainer.cy.tsx index 47a1fc69..fcb0b849 100644 --- a/cypress/component/ResultContainer.cy.tsx +++ b/cypress/component/ResultContainer.cy.tsx @@ -13,7 +13,6 @@ describe('ResultContainer', () => { .should('be.visible') .should('contain', 'Summary stats: 2 datasets, 4 subjects'); cy.get('[data-cy="download-results-button"]').should('be.visible').should('be.disabled'); - cy.get('[data-cy="how-to-get-data-dialog-button"]').should('be.visible'); }); it('Selecting a dataset should enable the download result button', () => { cy.mount( @@ -41,14 +40,6 @@ describe('ResultContainer', () => { 'not.be.checked' ); }); - it('Clicking the how to get data dialog button should open the dialog', () => { - cy.mount( - - ); - cy.get('[data-cy="get-data-dialog"]').should('not.exist'); - cy.get('[data-cy="how-to-get-data-dialog-button"]').click(); - cy.get('[data-cy="get-data-dialog"]').should('be.visible'); - }); it('Shows no result view when result is empty', () => { cy.mount( void } - Results file for data access or programmatic use + Download matching source data results using Datalad - Download the query results file with URIs to use as input to scripts for downloading the - data of matching subjects to your local filesystem. This file contains URIs instead of - descriptive labels making it ideal for integration with other tools for linked or - structured data. We have a helper tool to automatically download matching subjects from - datasets available through DataLad. To do so: + We have a helper tool to automatically download matching subjects from datasets available + through DataLad. To do so:
  1. Select at least one dataset
  2. -
  3. Download the results file with URIs using the dropdown download button
  4. +
  5. + Download one of the query results files using the ”Download selected query + results” dropdown +
  6. Change directory to the location of the downloaded TSV
  7. Copy and run the command below
@@ -94,7 +94,7 @@ function GetDataDialog({ open, onClose }: { open: boolean; onClose: () => void }
⚠️ The above command currently only gets data for DataLad datasets. To download a cohort from other remote filesystems you have access to, you may need to write your own script - that uses the paths from the results file downloadable above. + that uses the paths from a results file.
diff --git a/src/components/QueryForm.tsx b/src/components/QueryForm.tsx index 8c6cfd10..c5c25785 100644 --- a/src/components/QueryForm.tsx +++ b/src/components/QueryForm.tsx @@ -1,3 +1,4 @@ +import { useState } from 'react'; import { Button, FormControlLabel, @@ -18,6 +19,7 @@ import { } from '../utils/types'; import CategoricalField from './CategoricalField'; import ContinuousField from './ContinuousField'; +import GetDataDialog from './GetDataDialog'; function QueryForm({ availableNodes, @@ -64,6 +66,8 @@ function QueryForm({ loading: boolean; onSubmitQuery: () => void; }) { + const [openDialog, setOpenDialog] = useState(false); + function validateContinuousValue(value: number | null) { if (value === null) { // Value is default, user has not entered anything yet @@ -235,7 +239,7 @@ function QueryForm({ )} -
+
+ + setOpenDialog(false)} />
); diff --git a/src/components/ResultContainer.tsx b/src/components/ResultContainer.tsx index 5b83bb8d..63afaa63 100644 --- a/src/components/ResultContainer.tsx +++ b/src/components/ResultContainer.tsx @@ -1,9 +1,8 @@ import { useState, useEffect, useCallback } from 'react'; -import { Button, FormControlLabel, Checkbox, Typography } from '@mui/material'; +import { FormControlLabel, Checkbox, Typography } from '@mui/material'; import ResultCard from './ResultCard'; import { QueryResponse, Pipelines, AttributeOption } from '../utils/types'; import DownloadResultButton from './DownloadResultButton'; -import GetDataDialog from './GetDataDialog'; import { sexes, modalities } from '../utils/constants'; function ResultContainer({ @@ -16,7 +15,6 @@ function ResultContainer({ response: QueryResponse | null; }) { const [download, setDownload] = useState([]); - const [openDialog, setOpenDialog] = useState(false); const selectAll: boolean = response ? response.responses.length === download.length && response.responses.every((r) => download.includes(r.dataset_uuid)) @@ -313,7 +311,7 @@ function ResultContainer({ -
+
{response.responses.map((item) => ( ))}
-
-
- - setOpenDialog(false)} /> -
-
- downloadResults(index)} - /> -
+
+ downloadResults(index)} + />
);