diff --git a/src/Analysis/GWASApp/Components/Covariates/ContinuousCovariates.stories.jsx b/src/Analysis/GWASApp/Components/Covariates/ContinuousCovariates.stories.jsx index 30fccdc05d..168db209d7 100644 --- a/src/Analysis/GWASApp/Components/Covariates/ContinuousCovariates.stories.jsx +++ b/src/Analysis/GWASApp/Components/Covariates/ContinuousCovariates.stories.jsx @@ -3,6 +3,7 @@ import { QueryClient, QueryClientProvider } from 'react-query'; import { rest } from 'msw'; import ContinuousCovariates from './ContinuousCovariates'; import { SourceContextProvider } from '../../Utils/Source'; +import '../../GWASApp.css'; export default { title: 'Tests3/GWASApp/ContinuousCovariates', @@ -10,30 +11,35 @@ export default { }; // useful examples: https://github.com/mswjs/msw-storybook-addon/tree/main/packages/docs/src/demos/react-query - const mockedQueryClient = new QueryClient(); const Template = () => { return ( -
- { - console.log('close'); - }} - handleSelect={(chosenCovariate) => { - console.log('chosen covariate:', chosenCovariate); - }} - dispatch={(payload) => { - console.log('payload:', payload); - }} - submitButtonLabel={'Add'} - /> +
+
+
+
+ { + console.log('close'); + }} + handleSelect={(chosenCovariate) => { + console.log('chosen covariate:', chosenCovariate); + }} + dispatch={(payload) => { + console.log('payload:', payload); + }} + submitButtonLabel={'Add'} + /> +
+
+
diff --git a/src/Analysis/GWASApp/Components/Covariates/CustomDichotomousCovariates.jsx b/src/Analysis/GWASApp/Components/Covariates/CustomDichotomousCovariates.jsx index 16d5c07ce8..256125a90d 100644 --- a/src/Analysis/GWASApp/Components/Covariates/CustomDichotomousCovariates.jsx +++ b/src/Analysis/GWASApp/Components/Covariates/CustomDichotomousCovariates.jsx @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; import SelectCohortDropDown from '../SelectCohort/SelectCohortDropDown'; import CohortsOverlapDiagram from '../Diagrams/CohortsOverlapDiagram/CohortsOverlapDiagram'; import './Covariates.css'; -import '../../GWASApp.css'; const CustomDichotomousCovariates = ({ dispatch, diff --git a/src/Analysis/GWASApp/Components/Covariates/CustomDichotomousCovariates.stories.jsx b/src/Analysis/GWASApp/Components/Covariates/CustomDichotomousCovariates.stories.jsx index 81979e0aa0..51a0d4a263 100644 --- a/src/Analysis/GWASApp/Components/Covariates/CustomDichotomousCovariates.stories.jsx +++ b/src/Analysis/GWASApp/Components/Covariates/CustomDichotomousCovariates.stories.jsx @@ -3,6 +3,7 @@ import { QueryClient, QueryClientProvider } from 'react-query'; import { rest } from 'msw'; import CustomDichotomousCovariates from './CustomDichotomousCovariates'; import { SourceContextProvider } from '../../Utils/Source'; +import '../../GWASApp.css'; export default { title: 'Tests3/GWASApp/CustomDichotomousCovariates', @@ -14,7 +15,15 @@ const mockedQueryClient = new QueryClient(); const Template = (args) => ( - +
+
+
+
+ +
+
+
+
); diff --git a/src/Analysis/GWASApp/Components/SelectCohort/Utils/CohortDefinitions.jsx b/src/Analysis/GWASApp/Components/SelectCohort/Utils/CohortDefinitions.jsx index b809bfa92d..9c453dc6b5 100644 --- a/src/Analysis/GWASApp/Components/SelectCohort/Utils/CohortDefinitions.jsx +++ b/src/Analysis/GWASApp/Components/SelectCohort/Utils/CohortDefinitions.jsx @@ -14,10 +14,12 @@ const CohortDefinitions = ({ selectedTeamProject, }) => { const { source } = useSourceContext(); + const cohorts = useQuery( ['cohortdefinitions', source, selectedTeamProject], () => fetchCohortDefinitions(source, selectedTeamProject), - queryConfig, + // only call this once the source is not undefined + { enabled: source !== undefined, ...queryConfig }, ); const fetchedCohorts = useFetch(cohorts, 'cohort_definitions_and_stats'); const displayedCohorts = useFilter(fetchedCohorts, searchTerm, 'cohort_name'); diff --git a/src/Analysis/GWASApp/GWASApp.css b/src/Analysis/GWASApp/GWASApp.css index 6171b45207..608d20c9a3 100644 --- a/src/Analysis/GWASApp/GWASApp.css +++ b/src/Analysis/GWASApp/GWASApp.css @@ -203,6 +203,7 @@ width: 988px; background: #fff; text-align: center; + border: 1px solid #e2e2e3; } .GWASApp .GWASUI-selectionUI button { @@ -262,3 +263,30 @@ overflow-y: auto; overflow-x: hidden; } + +/* Shared select container styles */ +.GWASApp .select-container { + padding: 20px; + background: #fff; + height: 519px; +} + +.GWASApp .select-container .ant-table-content { + max-height: 390px; + overflow-y: auto; +} + +.GWASApp .select-container .GWASUI-emptyTable { + border: 2px solid #e9eef2; + min-height: 450px; +} + +.GWASApp .select-container .GWASUI-flexRow { + width: 100%; +} + +.GWASApp .select-container .custom-dichotomous-covariates .GWASUI-spinnerContainer, +.GWASApp .select-container .custom-dichotomous-covariates .GWASUI-emptyTable { + min-height: inherit; + height: inherit; +} diff --git a/src/Analysis/GWASApp/Steps/SelectOutcome/SelectOutcome.css b/src/Analysis/GWASApp/Steps/SelectOutcome/SelectOutcome.css deleted file mode 100644 index f5e3608339..0000000000 --- a/src/Analysis/GWASApp/Steps/SelectOutcome/SelectOutcome.css +++ /dev/null @@ -1,23 +0,0 @@ -.GWASUI-selectionUI { - border: 1px solid #e2e2e3; -} - -.GWASApp .select-container { - padding: 20px; - background: #fff; - height: 519px; -} - -.GWASApp .select-container .ant-table-content { - max-height: 390px; - overflow-y: auto; -} - -.GWASApp .select-container .GWASUI-emptyTable { - border: 2px solid #e9eef2; - min-height: 450px; -} - -.GWASApp .select-container .GWASUI-flexRow { - width: 100%; -} diff --git a/src/Analysis/GWASApp/Steps/SelectOutcome/SelectOutcome.jsx b/src/Analysis/GWASApp/Steps/SelectOutcome/SelectOutcome.jsx index 9354f506d2..1368bf1183 100644 --- a/src/Analysis/GWASApp/Steps/SelectOutcome/SelectOutcome.jsx +++ b/src/Analysis/GWASApp/Steps/SelectOutcome/SelectOutcome.jsx @@ -4,8 +4,6 @@ import ContinuousCovariates from '../../Components/Covariates/ContinuousCovariat import CovariatesCardsList from '../../Components/Covariates/CovariatesCardsList'; import CustomDichotomousCovariates from '../../Components/Covariates/CustomDichotomousCovariates'; import ACTIONS from '../../Utils/StateManagement/Actions'; -import './SelectOutcome.css'; -import '../../GWASApp.css'; const SelectOutcome = ({ dispatch, diff --git a/src/Analysis/GWASApp/Steps/SelectStudyPopulation/SelectStudyPopulation.jsx b/src/Analysis/GWASApp/Steps/SelectStudyPopulation/SelectStudyPopulation.jsx index 83f80f2e8e..a8f8684388 100644 --- a/src/Analysis/GWASApp/Steps/SelectStudyPopulation/SelectStudyPopulation.jsx +++ b/src/Analysis/GWASApp/Steps/SelectStudyPopulation/SelectStudyPopulation.jsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import ACTIONS from '../../Utils/StateManagement/Actions'; -import CohortSelect from '../../Components/SelectCohort/SelectCohort'; +import SelectCohort from '../../Components/SelectCohort/SelectCohort'; const SelectStudyPopulation = ({ selectedCohort, dispatch, selectedTeamProject }) => { const handleStudyPopulationSelect = (selectedRow) => { @@ -13,7 +13,7 @@ const SelectStudyPopulation = ({ selectedCohort, dispatch, selectedTeamProject } return (
-