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/minespace-web/src/components/dashboard/mine/projects/ProjectStagesTable.tsx b/services/minespace-web/src/components/dashboard/mine/projects/ProjectStagesTable.tsx index 75b3476989..5c7e778132 100644 --- a/services/minespace-web/src/components/dashboard/mine/projects/ProjectStagesTable.tsx +++ b/services/minespace-web/src/components/dashboard/mine/projects/ProjectStagesTable.tsx @@ -93,10 +93,10 @@ export const ProjectStagesTable: FC = ({ projectStages } if (record.project_stage === "IRT") { let buttonLabel: string; - let disableButton = Boolean(record.stage_status); + let enableButton = true; if (!record.stage_status) { buttonLabel = "Start"; - disableButton = !isProjectSummarySubmitted; + enableButton = isProjectSummarySubmitted; } else if (record.stage_status === "APV") { buttonLabel = "View"; } else { @@ -107,7 +107,7 @@ export const ProjectStagesTable: FC = ({ projectStages @@ -115,10 +115,10 @@ export const ProjectStagesTable: FC = ({ projectStages } if (record.project_stage === "Application") { let buttonLabel: string; - let disableButton = Boolean(record.stage_status); + let enableButton = true; if (!record.stage_status) { buttonLabel = "Start"; - disableButton = !isProjectSummarySubmitted; + enableButton = isProjectSummarySubmitted; } else if (["SUB", "UNR", "APV"].includes(record.stage_status)) { buttonLabel = "View"; } else { @@ -129,7 +129,7 @@ export const ProjectStagesTable: FC = ({ projectStages diff --git a/services/minespace-web/src/components/pages/Project/ProjectPage.tsx b/services/minespace-web/src/components/pages/Project/ProjectPage.tsx index 5c54817562..a121419b88 100644 --- a/services/minespace-web/src/components/pages/Project/ProjectPage.tsx +++ b/services/minespace-web/src/components/pages/Project/ProjectPage.tsx @@ -57,6 +57,7 @@ const ProjectPage: FC = () => { mrc_review_required, } = project; + const isProjectSummarySubmitted = Boolean(projectSummary?.submission_date); const hasInformationRequirementsTable = Boolean(information_requirements_table?.irt_guid); const hasFinalAplication = Boolean(major_mine_application?.major_mine_application_guid); @@ -238,7 +239,7 @@ const ProjectPage: FC = () => { { label: "IRT", key: "irt-entry", - disabled: !hasInformationRequirementsTable, + disabled: !hasInformationRequirementsTable && !isProjectSummarySubmitted, children: (
{ { label: "Application", key: "major-mine-application", - disabled: !hasFinalAplication, + disabled: !hasFinalAplication && !isProjectSummarySubmitted, children:
{majorMineApplicationTabContent}
, }, { diff --git a/services/minespace-web/src/tests/components/project/projectOverviewTab/__snapshots__/ProjectOverviewTab.spec.tsx.snap b/services/minespace-web/src/tests/components/project/projectOverviewTab/__snapshots__/ProjectOverviewTab.spec.tsx.snap index a3f04e0d9c..c5139f0c55 100644 --- a/services/minespace-web/src/tests/components/project/projectOverviewTab/__snapshots__/ProjectOverviewTab.spec.tsx.snap +++ b/services/minespace-web/src/tests/components/project/projectOverviewTab/__snapshots__/ProjectOverviewTab.spec.tsx.snap @@ -338,7 +338,6 @@ exports[`ProjectOverviewTab renders properly 1`] = ` >