From 56b4c1785ce3397b3aa52b71d6416b598735f2cf Mon Sep 17 00:00:00 2001 From: asinn134 <127789479+asinn134@users.noreply.github.com> Date: Thu, 19 Sep 2024 09:59:07 -0700 Subject: [PATCH] [MDS-6132] Fixing bugs around Project Description Overview (#3250) fixing bugs found for 6132 --- .../src/components/mine/Projects/Project.tsx | 2 +- .../mine/Projects/ProjectOverviewTab.js | 8 +++- .../mine/projects/ProjectStagesTable.js | 39 +++++++++++-------- .../pages/Project/ProjectOverviewTab.js | 1 + .../components/pages/Project/ProjectPage.tsx | 11 +++++- .../ProjectOverviewTab.spec.js.snap | 1 + 6 files changed, 42 insertions(+), 20 deletions(-) diff --git a/services/core-web/src/components/mine/Projects/Project.tsx b/services/core-web/src/components/mine/Projects/Project.tsx index 092606011f..cd2d5bd1d1 100644 --- a/services/core-web/src/components/mine/Projects/Project.tsx +++ b/services/core-web/src/components/mine/Projects/Project.tsx @@ -120,7 +120,7 @@ const Project: FC = () => { ), }, isFeatureEnabled(Feature.AMS_AGENT) && - project_summary?.status_code === "SUB" && { + project_summary?.submission_date && { key: "project-description", label: "Project Description", children: ( diff --git a/services/core-web/src/components/mine/Projects/ProjectOverviewTab.js b/services/core-web/src/components/mine/Projects/ProjectOverviewTab.js index a68235ecb1..121ca70be4 100644 --- a/services/core-web/src/components/mine/Projects/ProjectOverviewTab.js +++ b/services/core-web/src/components/mine/Projects/ProjectOverviewTab.js @@ -138,10 +138,14 @@ export class ProjectOverviewTab extends Component { link: ( ), diff --git a/services/minespace-web/src/components/dashboard/mine/projects/ProjectStagesTable.js b/services/minespace-web/src/components/dashboard/mine/projects/ProjectStagesTable.js index 1b2aa7dd4f..eb51784a30 100644 --- a/services/minespace-web/src/components/dashboard/mine/projects/ProjectStagesTable.js +++ b/services/minespace-web/src/components/dashboard/mine/projects/ProjectStagesTable.js @@ -63,24 +63,31 @@ export class ProjectStagesTable extends Component { render: (text, record) => { let link; if (record.project_stage === "Project description") { - let buttonLabel; - if (record.stage_status === "SUB") { - buttonLabel = "View"; + let payload = record.stage?.payload; + if (payload?.submission_date) { + link = ( + + ); } else { - buttonLabel = "Resume"; + link = ( + + + + ); } - link = ( - - - - ); } if (record.project_stage === "IRT") { let buttonLabel; diff --git a/services/minespace-web/src/components/pages/Project/ProjectOverviewTab.js b/services/minespace-web/src/components/pages/Project/ProjectOverviewTab.js index b283b896c9..8815a385e6 100644 --- a/services/minespace-web/src/components/pages/Project/ProjectOverviewTab.js +++ b/services/minespace-web/src/components/pages/Project/ProjectOverviewTab.js @@ -86,6 +86,7 @@ export class ProjectOverviewTab extends Component { payload: this.props.projectSummary, statusHash: this.props.projectSummaryStatusCodesHash, required: true, + navigateForward: () => this.props.navigateForward("DES"), }, { title: "IRT", diff --git a/services/minespace-web/src/components/pages/Project/ProjectPage.tsx b/services/minespace-web/src/components/pages/Project/ProjectPage.tsx index 6d1598b1aa..d42a922798 100644 --- a/services/minespace-web/src/components/pages/Project/ProjectPage.tsx +++ b/services/minespace-web/src/components/pages/Project/ProjectPage.tsx @@ -73,6 +73,15 @@ const ProjectPage: FC = () => { const navigateFromProjectStagesTable = (source, status) => { switch (source) { + case "DES": { + const projectDescriptionTab = document.querySelector('[id*="project-description"]'); + if (!projectDescriptionTab) { + return null; + } + + // @ts-ignore + return projectDescriptionTab.click(); + } case "IRT": { if (status === "APV") { return history.push({ @@ -203,7 +212,7 @@ const ProjectPage: FC = () => { ), }, isFeatureEnabled(Feature.AMS_AGENT) && - project_summary?.status_code === "SUB" && { + project_summary?.submission_date && { label: "Project Description", key: "project-description", children: ( diff --git a/services/minespace-web/src/tests/components/project/projectOverviewTab/__snapshots__/ProjectOverviewTab.spec.js.snap b/services/minespace-web/src/tests/components/project/projectOverviewTab/__snapshots__/ProjectOverviewTab.spec.js.snap index 68aa5d3998..f6f6b3dca6 100644 --- a/services/minespace-web/src/tests/components/project/projectOverviewTab/__snapshots__/ProjectOverviewTab.spec.js.snap +++ b/services/minespace-web/src/tests/components/project/projectOverviewTab/__snapshots__/ProjectOverviewTab.spec.js.snap @@ -97,6 +97,7 @@ exports[`ProjectOverviewTab renders properly 1`] = ` Array [ Object { "key": undefined, + "navigateForward": [Function], "payload": Object { "documents": Array [], "mine_guid": "60300a07-376c-46f1-a984-88a813f91438",