瀏覽代碼

Enable user to input sub project code

tags/Baseline_180220205_Frontend
cyril.tsui 9 月之前
父節點
當前提交
0b4860640f
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. +7
    -2
      src/components/CreateProject/ProjectClientDetails.tsx

+ 7
- 2
src/components/CreateProject/ProjectClientDetails.tsx 查看文件

@@ -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) &&


Loading…
取消
儲存