From 1bebd18d08e7cae9335db4d6c4a77610125d680b Mon Sep 17 00:00:00 2001 From: Tara Epp <102187683+taraepp@users.noreply.github.com> Date: Fri, 25 Oct 2024 18:49:19 +0000 Subject: [PATCH] don't disable the tab when the project summary is submitted but there's no irt/final app --- .../mine/Projects/InformationRequirementsTableTab.tsx | 2 +- services/core-web/src/components/mine/Projects/Project.tsx | 7 ++++--- .../src/components/pages/Project/ProjectPage.tsx | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/services/core-web/src/components/mine/Projects/InformationRequirementsTableTab.tsx b/services/core-web/src/components/mine/Projects/InformationRequirementsTableTab.tsx index 6ea8529d95..b0a119d6f7 100644 --- a/services/core-web/src/components/mine/Projects/InformationRequirementsTableTab.tsx +++ b/services/core-web/src/components/mine/Projects/InformationRequirementsTableTab.tsx @@ -93,7 +93,7 @@ const InformationRequirementsTableTab = () => { r1.map(({ requirement_guid, sub_requirements, ...rest }) => ({ requirement_guid, ...rest, - ...r2.find((i) => i.requirement_guid === requirement_guid), + ...r2?.find((i) => i.requirement_guid === requirement_guid), sub_requirements: deepMergeById(sub_requirements, r2), })); diff --git a/services/core-web/src/components/mine/Projects/Project.tsx b/services/core-web/src/components/mine/Projects/Project.tsx index 2cfdda3ec5..5216383f30 100644 --- a/services/core-web/src/components/mine/Projects/Project.tsx +++ b/services/core-web/src/components/mine/Projects/Project.tsx @@ -29,8 +29,9 @@ const Project: FC = () => { const [isValid, setIsValid] = useState(true); const [activeTab, setActiveTab] = useState("overview"); - const { information_requirements_table, major_mine_application } = project; + const { information_requirements_table, major_mine_application, project_summary } = project; + const isProjectSummarySubmitted = Boolean(project_summary?.submission_date); const hasInformationRequirementsTable = Boolean(information_requirements_table?.irt_guid); const hasFinalAplication = Boolean(major_mine_application?.major_mine_application_guid); @@ -131,7 +132,7 @@ const Project: FC = () => { { key: "information-requirements-table", label: "IRT", - disabled: !hasInformationRequirementsTable, + disabled: !hasInformationRequirementsTable && !isProjectSummarySubmitted, children: (