From cc285f51d4a1bbefdc5499d31a9cb4ddad3012ee Mon Sep 17 00:00:00 2001 From: Nicholas Lee Date: Tue, 15 Oct 2024 16:24:36 -0400 Subject: [PATCH] feat: update with feedback --- .../src/components/NeurosynthBreadcrumbs.tsx | 4 +- .../src/pages/Extraction/ExtractionPage.tsx | 20 +---- .../Extraction/components/ExtractionTable.tsx | 55 ++++++++++--- .../components/ExtractionTableAuthor.tsx | 11 ++- .../components/ProjectExtractionStepCard.tsx | 2 +- .../src/pages/Study/EditStudyPage.tsx | 77 ++++++++++--------- .../DisplayExtractionTableState.tsx | 18 +++-- .../EditStudyAnalysisPointsHotTable.tsx | 2 +- .../components/EditStudyCompleteButton.tsx | 3 +- .../components/EditStudySwapVersionButton.tsx | 22 ++++-- .../src/pages/Study/hooks/useSaveStudy.tsx | 2 +- .../pages/Study/store/StudyStore.helpers.ts | 2 +- 12 files changed, 132 insertions(+), 86 deletions(-) diff --git a/compose/neurosynth-frontend/src/components/NeurosynthBreadcrumbs.tsx b/compose/neurosynth-frontend/src/components/NeurosynthBreadcrumbs.tsx index ecc7d5f3..caf292ec 100644 --- a/compose/neurosynth-frontend/src/components/NeurosynthBreadcrumbs.tsx +++ b/compose/neurosynth-frontend/src/components/NeurosynthBreadcrumbs.tsx @@ -60,7 +60,7 @@ const NeurosynthBreadcrumbs: React.FC<{ breadcrumbItems: INeurosynthBreadcrumbs[ color="secondary" variant="h6" sx={{ - maxWidth: '300px', + maxWidth: '200px', textOverflow: 'ellipsis', display: 'block', overflow: 'hidden', @@ -81,7 +81,7 @@ const NeurosynthBreadcrumbs: React.FC<{ breadcrumbItems: INeurosynthBreadcrumbs[ sx={{ fontSize: '1.25rem', cursor: 'pointer', - maxWidth: '300px', + maxWidth: '200px', textOverflow: 'ellipsis', display: 'block', overflow: 'hidden', diff --git a/compose/neurosynth-frontend/src/pages/Extraction/ExtractionPage.tsx b/compose/neurosynth-frontend/src/pages/Extraction/ExtractionPage.tsx index 0b487b33..71782251 100644 --- a/compose/neurosynth-frontend/src/pages/Extraction/ExtractionPage.tsx +++ b/compose/neurosynth-frontend/src/pages/Extraction/ExtractionPage.tsx @@ -15,7 +15,6 @@ import { useInitProjectStoreIfRequired, useProjectCurationColumns, useProjectExtractionStudysetId, - useProjectMetaAnalysisCanEdit, useProjectName, useProjectUser, } from 'pages/Project/store/ProjectStore'; @@ -40,7 +39,6 @@ const ExtractionPage: React.FC = (props) => { const columns = useProjectCurationColumns(); const loading = useGetProjectIsLoading(); const extractionSummary = useGetExtractionSummary(projectId || ''); - const canEditMetaAnalyses = useProjectMetaAnalysisCanEdit(); const projectUser = useProjectUser(); const canEdit = useUserCanEdit(projectUser || undefined); @@ -140,31 +138,19 @@ const ExtractionPage: React.FC = (props) => { - + {table.getHeaderGroups().map((headerGroup) => ( diff --git a/compose/neurosynth-frontend/src/pages/Extraction/components/ExtractionTableAuthor.tsx b/compose/neurosynth-frontend/src/pages/Extraction/components/ExtractionTableAuthor.tsx index 0636a61c..57dd1e2c 100644 --- a/compose/neurosynth-frontend/src/pages/Extraction/components/ExtractionTableAuthor.tsx +++ b/compose/neurosynth-frontend/src/pages/Extraction/components/ExtractionTableAuthor.tsx @@ -8,7 +8,16 @@ export const ExtractionTableAuthorCell: React.FC { const value = props.getValue(); - return {value}; + let shortName = value; + const authorsList = (value || '').split(','); + if (authorsList.length > 1) { + shortName = `${authorsList[0]}., et al.`; + } + return ( + {value} : null}> + {shortName} + + ); }; export const ExtractionTableAuthorHeader: React.FC< diff --git a/compose/neurosynth-frontend/src/pages/Project/components/ProjectExtractionStepCard.tsx b/compose/neurosynth-frontend/src/pages/Project/components/ProjectExtractionStepCard.tsx index 5acb968e..a27442e6 100644 --- a/compose/neurosynth-frontend/src/pages/Project/components/ProjectExtractionStepCard.tsx +++ b/compose/neurosynth-frontend/src/pages/Project/components/ProjectExtractionStepCard.tsx @@ -141,7 +141,7 @@ const ProjectExtractionStepCard: React.FC<{ disabled: boolean }> = ({ disabled } display: allStudiesAreComplete ? 'none' : 'block', }} onClick={() => setMarkAllAsCompleteConfirmationDialogIsOpen(true)} - color="info" + color="success" disabled={disabled} > Mark all as complete diff --git a/compose/neurosynth-frontend/src/pages/Study/EditStudyPage.tsx b/compose/neurosynth-frontend/src/pages/Study/EditStudyPage.tsx index 7509af29..2aa0eb87 100644 --- a/compose/neurosynth-frontend/src/pages/Study/EditStudyPage.tsx +++ b/compose/neurosynth-frontend/src/pages/Study/EditStudyPage.tsx @@ -87,44 +87,47 @@ const EditStudyPage: React.FC = (props) => { !studyStoreId || !annotationStoreId || getStudyIsLoading || getAnnotationIsLoading } > - - - - - - - - - - - + + + + + + + - - - - - + + + + + + + + + + + diff --git a/compose/neurosynth-frontend/src/pages/Study/components/DisplayExtractionTableState.tsx b/compose/neurosynth-frontend/src/pages/Study/components/DisplayExtractionTableState.tsx index 9774614a..982bfa91 100644 --- a/compose/neurosynth-frontend/src/pages/Study/components/DisplayExtractionTableState.tsx +++ b/compose/neurosynth-frontend/src/pages/Study/components/DisplayExtractionTableState.tsx @@ -135,8 +135,9 @@ const DisplayExtractionTableState: React.FC = (props) => { { ) : ( - + )} { alignItems: 'center', }} > - + {thisStudyIndex + 1} of {(extractionTableState?.studies || []).length} ({data?.studies?.length || 0} total) - + {(extractionTableState?.columnFilters || []).length > 0 && ( <>{(extractionTableState?.columnFilters || []).length} filters )} @@ -211,8 +212,9 @@ const DisplayExtractionTableState: React.FC = (props) => { { ) : ( - + )} ); diff --git a/compose/neurosynth-frontend/src/pages/Study/components/EditStudyAnalysisPointsHotTable.tsx b/compose/neurosynth-frontend/src/pages/Study/components/EditStudyAnalysisPointsHotTable.tsx index 83aa450d..70200821 100644 --- a/compose/neurosynth-frontend/src/pages/Study/components/EditStudyAnalysisPointsHotTable.tsx +++ b/compose/neurosynth-frontend/src/pages/Study/components/EditStudyAnalysisPointsHotTable.tsx @@ -243,7 +243,7 @@ const EditStudyAnalysisPointsHotTable: React.FC<{ analysisId?: string; readOnly? onDeleteRows={handleDeleteRows} /> - + { return ( { const updateStudyListStatusWithNewStudyId = useProjectExtractionReplaceStudyListStatusId(); const studysetId = useProjectExtractionStudysetId(); const { data: studyset } = useGetStudysetById(studysetId, false); + const updateStudyByField = useUpdateStudyDetails(); const navigate = useNavigate(); const { enqueueSnackbar } = useSnackbar(); @@ -109,6 +114,8 @@ const EditStudySwapVersionButton: React.FC = (props) => { }, }); updateStudyListStatusWithNewStudyId(studyId, versionToSwapTo); + updateStudyByField('id', versionToSwapTo); + unsetUnloadHandler('study'); updateExtractionTableStateInStorage(projectId, studyId, versionToSwapTo); await setAnalysesInAnnotationAsIncluded(annotationId); @@ -230,24 +237,27 @@ const EditStudySwapVersionButton: React.FC = (props) => {