|
@@ -205,9 +205,14 @@ const ProjectClientDetails: React.FC<Props> = ({ |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
if (mainProject !== undefined) { |
|
|
if (mainProject !== undefined) { |
|
|
|
|
|
|
|
|
|
|
|
const teamLeadIds = teamLeads.map((teamLead) => teamLead.id) |
|
|
setValue("projectName", mainProject.projectName); |
|
|
setValue("projectName", mainProject.projectName); |
|
|
setValue("projectCategoryId", mainProject.projectCategoryId); |
|
|
setValue("projectCategoryId", mainProject.projectCategoryId); |
|
|
setValue("projectLeadId", mainProject.projectLeadId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// set project lead id to the first team lead id if the main project lead id is not in the team lead list |
|
|
|
|
|
setValue("projectLeadId", teamLeadIds.find((id) => id === mainProject.projectLeadId) ? mainProject.projectLeadId : teamLeadIds[0] ?? mainProject.projectLeadId); |
|
|
|
|
|
|
|
|
setValue("serviceTypeId", mainProject.serviceTypeId); |
|
|
setValue("serviceTypeId", mainProject.serviceTypeId); |
|
|
setValue("fundingTypeId", mainProject.fundingTypeId); |
|
|
setValue("fundingTypeId", mainProject.fundingTypeId); |
|
|
setValue("contractTypeId", mainProject.contractTypeId); |
|
|
setValue("contractTypeId", mainProject.contractTypeId); |
|
@@ -269,7 +274,7 @@ const ProjectClientDetails: React.FC<Props> = ({ |
|
|
<TextField |
|
|
<TextField |
|
|
label={t("Project Code")} |
|
|
label={t("Project Code")} |
|
|
fullWidth |
|
|
fullWidth |
|
|
disabled={isSubProject && mainProjects !== undefined} |
|
|
|
|
|
|
|
|
// disabled={isSubProject && mainProjects !== undefined} |
|
|
{...register("projectCode", { |
|
|
{...register("projectCode", { |
|
|
required: |
|
|
required: |
|
|
!(isSubProject && mainProjects !== undefined) && |
|
|
!(isSubProject && mainProjects !== undefined) && |
|
|