diff --git a/src/components/Project/ProjectBasics/ProjectForm/ProjectFinancialSection.tsx b/src/components/Project/ProjectBasics/ProjectForm/ProjectFinancialSection.tsx index e6b5dea2..7bae5a53 100644 --- a/src/components/Project/ProjectBasics/ProjectForm/ProjectFinancialSection.tsx +++ b/src/components/Project/ProjectBasics/ProjectForm/ProjectFinancialSection.tsx @@ -55,13 +55,15 @@ const ProjectFinancialSection: FC = ({ options: IOption[], size: 'full' | 'lg' | undefined, shouldTranslate: boolean, + shouldNotBeDisabled?: boolean, ) => ( + ); @@ -93,14 +95,14 @@ const ProjectFinancialSection: FC = ({
{renderNumberField('projectCostForecast', 'keur', true)}
- {renderSelectField('projectQualityLevel', projectQualityLevels, undefined, true)} + {renderSelectField('projectQualityLevel', projectQualityLevels, undefined, true, true)}
{renderNumberField('projectWorkQuantity', 'm2', false)}
{renderNumberField('planningCostForecast', 'keur', true)}
- {renderSelectField('planningPhase', planningPhases, undefined, true)} + {renderSelectField('planningPhase', planningPhases, undefined, true, true)}
{renderNumberField('planningWorkQuantity', 'm2', false)}
@@ -109,7 +111,7 @@ const ProjectFinancialSection: FC = ({ {renderNumberField('constructionCostForecast', 'keur', true)}
- {renderSelectField('constructionPhase', constructionPhases, undefined, true)} + {renderSelectField('constructionPhase', constructionPhases, undefined, true, true)}
{renderNumberField('constructionWorkQuantity', 'm2', false)} @@ -151,7 +153,7 @@ const ProjectFinancialSection: FC = ({ cancelEdit={isSaving} /> - + { } return null; }, [project?.currentYearsSapValues]); - + const isOnlyViewer = isUserOnlyViewer(user); const [newProjectId, setNewProjectId] = useState(''); @@ -305,10 +305,10 @@ const ProjectForm = () => { if (data?.projectClass && project.projectGroup) { - const projectGroup = groups.find(({id}) => id === project.projectGroup); - if (data.projectClass !== projectGroup?.classRelation) { - data = {...data, "projectGroup": null} - } + const projectGroup = groups.find(({ id }) => id === project.projectGroup); + if (data.projectClass !== projectGroup?.classRelation) { + data = { ...data, "projectGroup": null } + } } /* If project is under a district and user changes the class, the district has to be removed or the @@ -520,7 +520,11 @@ const ProjectForm = () => { {/* SECTION 7 - PROJECT PROGRAM */} {/* BANNER */} - {!isOnlyViewer && } + {!isOnlyViewer && + } ); }; diff --git a/src/components/Project/ProjectBasics/ProjectForm/ProjectFormBanner.tsx b/src/components/Project/ProjectBasics/ProjectForm/ProjectFormBanner.tsx index bc87e7e8..347764c0 100644 --- a/src/components/Project/ProjectBasics/ProjectForm/ProjectFormBanner.tsx +++ b/src/components/Project/ProjectBasics/ProjectForm/ProjectFormBanner.tsx @@ -13,9 +13,10 @@ interface IProjectFormbannerProps { | ((e?: BaseSyntheticEvent | undefined) => Promise) | undefined; isDirty: boolean; + isInputDisabled: boolean; } -const ProjectFormBanner: FC = ({ onSubmit, isDirty }) => { +const ProjectFormBanner: FC = ({ onSubmit, isDirty, isInputDisabled }) => { const dispatch = useAppDispatch(); const startYear = useAppSelector(selectStartYear); const { t } = useTranslation(); @@ -61,7 +62,7 @@ const ProjectFormBanner: FC = ({ onSubmit, isDirty }) = {/** Add logic for disabling button later based on user type */}
{editing && (