diff --git a/src/components/common/modal/StudyCreationModal.tsx b/src/components/common/modal/StudyCreationModal.tsx index f428e4b..37137a8 100644 --- a/src/components/common/modal/StudyCreationModal.tsx +++ b/src/components/common/modal/StudyCreationModal.tsx @@ -18,13 +18,19 @@ interface StudyCreationModalProps { onClose: () => void; study?: StudyDTO | null; setReloadStudies: React.Dispatch>; + projectInfoName?: string; } -const StudyCreationModal: React.FC = ({ onClose, study, setReloadStudies }) => { +const StudyCreationModal: React.FC = ({ + onClose, + study, + setReloadStudies, + projectInfoName, +}) => { const { t } = useTranslation(); const [studyName, setStudyName] = useState(''); const [horizon, setHorizon] = useState(''); - const [projectName, setProjectName] = useState(study?.project || ''); + const [projectName, setProjectName] = useState(study?.project || projectInfoName || ''); const [keywords, setKeywords] = useState(study?.keywords || []); const [trajectoryIds] = useState(study?.trajectoryIds || []); const [isFormValid, setIsFormValid] = useState(false); @@ -107,9 +113,11 @@ const StudyCreationModal: React.FC = ({ onClose, study, minNbCharacters={3} /> -
- -
+ {study && ( +
+ +
+ )} diff --git a/src/pages/pegase/home/components/StudyTableDisplay.tsx b/src/pages/pegase/home/components/StudyTableDisplay.tsx index a7579e0..0235190 100644 --- a/src/pages/pegase/home/components/StudyTableDisplay.tsx +++ b/src/pages/pegase/home/components/StudyTableDisplay.tsx @@ -23,9 +23,10 @@ import StudyCreationModal from '@common/modal/StudyCreationModal'; interface StudyTableDisplayProps { searchStudy: string | undefined; projectId?: string; + projectInfoName?: string; } -const StudyTableDisplay = ({ searchStudy, projectId }: StudyTableDisplayProps) => { +const StudyTableDisplay = ({ searchStudy, projectId, projectInfoName }: StudyTableDisplayProps) => { const { t } = useTranslation(); const [rowSelection, setRowSelection] = useState({}); const [isHeaderHovered, setIsHeaderHovered] = useState(false); @@ -135,6 +136,7 @@ const StudyTableDisplay = ({ searchStudy, projectId }: StudyTableDisplayProps) = onClose={toggleModal} study={selectedStudy} setReloadStudies={setReloadStudies} + projectInfoName={projectInfoName} /> )} diff --git a/src/pages/pegase/projects/projectDetails/ProjectDetails.tsx b/src/pages/pegase/projects/projectDetails/ProjectDetails.tsx index 5b4d4c3..9db8661 100644 --- a/src/pages/pegase/projects/projectDetails/ProjectDetails.tsx +++ b/src/pages/pegase/projects/projectDetails/ProjectDetails.tsx @@ -92,7 +92,7 @@ const ProjectDetails = () => { status={activeChip ? 'secondary' : 'primary'} /> - + ); };