Procházet zdrojové kódy

Enable user to input sub project code

tags/Baseline_180220205_Frontend
cyril.tsui před 9 měsíci
rodič
revize
0b4860640f
1 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. +7
    -2
      src/components/CreateProject/ProjectClientDetails.tsx

+ 7
- 2
src/components/CreateProject/ProjectClientDetails.tsx Zobrazit soubor

@@ -205,9 +205,14 @@ const ProjectClientDetails: React.FC<Props> = ({
);

if (mainProject !== undefined) {

const teamLeadIds = teamLeads.map((teamLead) => teamLead.id)
setValue("projectName", mainProject.projectName);
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("fundingTypeId", mainProject.fundingTypeId);
setValue("contractTypeId", mainProject.contractTypeId);
@@ -269,7 +274,7 @@ const ProjectClientDetails: React.FC<Props> = ({
<TextField
label={t("Project Code")}
fullWidth
disabled={isSubProject && mainProjects !== undefined}
// disabled={isSubProject && mainProjects !== undefined}
{...register("projectCode", {
required:
!(isSubProject && mainProjects !== undefined) &&


Načítá se…
Zrušit
Uložit