Skip to content

Commit

Permalink
feat: handle reject build meta-analyses
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoalee committed May 27, 2024
1 parent e4132ac commit 0173512
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,20 @@ const SleuthImportWizardCreateMetaAnalysesBase: React.FC<{
const navigate = useNavigate();
const [currView, setCurrView] = useState<'CONFIG' | 'CREATE'>('CONFIG');

const handleCreateMetaAnalyses = () => {
// if (shouldCreateMetaAnalyses === false) {
// navigate(`/projects/${projectId}/meta-analyses`);
// } else {
// setCurrView('CREATE');
// }
const handleCreateMetaAnalysisDetails = (selectedAlgorithm: IAlgorithmSelection | null) => {
if (selectedAlgorithm === null) {
navigate(`/projects/${projectId}/meta-analyses`);
} else {
setCurrView('CREATE');
}
};

return (
<StateHandlerComponent isLoading={isLoading} isError={isError}>
{currView === 'CONFIG' ? (
<SleuthImportWizardCreateMetaAnalysesDetails onNext={() => {}} />
<SleuthImportWizardCreateMetaAnalysesDetails
onNext={handleCreateMetaAnalysisDetails}
/>
) : (
<SleuthImportWizardCreateMetaAnalysesCreate />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function SleuthImportWizardCreateMetaAnalysesDetails({
}: {
onNext: (selectedAlgorithm: IAlgorithmSelection | null) => void;
}) {
const [shouldCreateMetaAnalyses, setCreateMetaAnalyses] = useState<boolean>();
const [shouldCreateMetaAnalyses, setShouldCreateMetaAnalyses] = useState<boolean>();
const [selectedMetaAnalysisAlgorithm, setSelectedMetaAnalysisAlgorithm] =
useState<IAlgorithmSelection>({
estimator: null,
Expand All @@ -48,7 +48,9 @@ function SleuthImportWizardCreateMetaAnalysesDetails({
return metaAnalyticAlgorithms.filter((x) => x.label === 'MKDADensity' || x.label === 'ALE');
}, []);

const handleNext = () => {};
const handleNext = () => {
onNext(shouldCreateMetaAnalyses ? selectedMetaAnalysisAlgorithm : null);
};

return (
<Box>
Expand All @@ -64,7 +66,7 @@ function SleuthImportWizardCreateMetaAnalysesDetails({
value={shouldCreateMetaAnalyses}
exclusive
onChange={(e, value) => {
setCreateMetaAnalyses(value);
setShouldCreateMetaAnalyses(value);
if (!value) {
return setSelectedMetaAnalysisAlgorithm({
estimator: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SleuthImportWizardUpload from 'components/SleuthImportWizard/SleuthImport
import { useState } from 'react';

const ImportSleuthPage: React.FC = (props) => {
const [activeStep, setActiveStep] = useState(3);
const [activeStep, setActiveStep] = useState(0);
const [uploadedSleuthFiles, setUploadedSleuthFiles] = useState<ISleuthFileUploadStubs[]>([]);
const [projectId, setProjectId] = useState('');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,26 @@ const ProjectsPage: React.FC = (props) => {
pageOfResults={(projectsResponse?.results || []).length === 0 ? 1 : pageOfResults}
>
<StateHandlerComponent isLoading={isLoading} isError={isError}>
{(projectsResponse?.results || []).map((project) => (
<Box
key={project?.id || ''}
sx={{
':nth-of-type(2n)': {
backgroundColor: '#f7f7f7',
borderRadius: '4px',
},
}}
>
<ProjectsPageCard {...(project as INeurosynthProjectReturn)} />
</Box>
))}
{(projectsResponse?.results || []).length > 0 ? (
(projectsResponse?.results || []).map((project) => (
<Box
key={project?.id || ''}
sx={{
':nth-of-type(2n)': {
backgroundColor: '#f7f7f7',
borderRadius: '4px',
},
}}
>
<ProjectsPageCard {...(project as INeurosynthProjectReturn)} />
</Box>
))
) : (
<Typography sx={{ margin: '0 10px' }} color="warning.dark">
You have not created a project yet. Click the "NEW PROJECT" button above
to create a new project.
</Typography>
)}
</StateHandlerComponent>
</SearchContainer>
</StateHandlerComponent>
Expand Down
1 change: 1 addition & 0 deletions store/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ http {

#include /etc/nginx/sites-enabled/*;
server {
listen 80;
server_name _;

location /api {
Expand Down

0 comments on commit 0173512

Please sign in to comment.