From 841feb76ba35ff403361c1bb6ba72d5aafe09965 Mon Sep 17 00:00:00 2001 From: Howard Edwards Date: Tue, 5 Dec 2023 15:38:33 -0500 Subject: [PATCH] Check for v2 testFormatVersion where applicable and hide link --- .../DataManagementRow/index.jsx | 25 +++++++++-- client/components/DataManagement/queries.js | 3 ++ .../components/TestPlanVersionsPage/index.jsx | 42 ++++++++++++------- .../TestPlanVersionsPage/queries.js | 1 + 4 files changed, 52 insertions(+), 19 deletions(-) diff --git a/client/components/DataManagement/DataManagementRow/index.jsx b/client/components/DataManagement/DataManagementRow/index.jsx index 49b3c4f55..ee0d13d91 100644 --- a/client/components/DataManagement/DataManagementRow/index.jsx +++ b/client/components/DataManagement/DataManagementRow/index.jsx @@ -507,6 +507,12 @@ const DataManagementRow = ({ } }; + // TODO: Remove this testFormatVersion check when #745 is implemented + const getLinkHref = version => + version.metadata?.testFormatVersion === 2 + ? null + : `/test-review/${version.id}`; + switch (phase) { case 'RD': { // If the latest version of the plan is in the draft, candidate, or recommended @@ -548,12 +554,15 @@ const DataManagementRow = ({ // Otherwise, show VERSION_STRING link with a draft transition button. Phase is // "active" insertActivePhaseForTestPlan(latestVersion); + + // TODO: Remove this testFormatVersion check when #745 is implemented + const linkHref = getLinkHref(latestVersion); return ( {latestVersion.versionString} @@ -676,13 +685,15 @@ const DataManagementRow = ({ // Phase is "active" insertActivePhaseForTestPlan(latestVersion); + // TODO: Remove this testFormatVersion check when #745 is implemented + const linkHref = getLinkHref(latestVersion); return ( {latestVersion.versionString} @@ -880,6 +891,9 @@ const DataManagementRow = ({ // Phase is "active" insertActivePhaseForTestPlan(latestVersion); + + // TODO: Remove this testFormatVersion check when #745 is implemented + const linkHref = getLinkHref(latestVersion); return ( {latestVersion.versionString} @@ -998,13 +1012,16 @@ const DataManagementRow = ({ // Phase is "active" insertActivePhaseForTestPlan(latestVersion); + + // TODO: Remove this testFormatVersion check when #745 is implemented + const linkHref = getLinkHref(latestVersion); return ( {latestVersion.versionString} diff --git a/client/components/DataManagement/queries.js b/client/components/DataManagement/queries.js index 586b480fb..20ccdb328 100644 --- a/client/components/DataManagement/queries.js +++ b/client/components/DataManagement/queries.js @@ -87,6 +87,7 @@ export const DATA_MANAGEMENT_PAGE_QUERY = gql` } } } + metadata } } `; @@ -133,6 +134,7 @@ export const UPDATE_TEST_PLAN_VERSION_PHASE = gql` feedbackType } } + metadata } } } @@ -179,6 +181,7 @@ export const UPDATE_TEST_PLAN_VERSION_RECOMMENDED_TARGET_DATE = gql` feedbackType } } + metadata } } } diff --git a/client/components/TestPlanVersionsPage/index.jsx b/client/components/TestPlanVersionsPage/index.jsx index b78ec7682..028444254 100644 --- a/client/components/TestPlanVersionsPage/index.jsx +++ b/client/components/TestPlanVersionsPage/index.jsx @@ -409,7 +409,13 @@ const TestPlanVersionsPage = () => { testPlanVersion )} autoWidth={false} - linkHref={`/test-review/${testPlanVersion.id}`} + // TODO: Remove this testFormatVersion check when #745 is implemented + linkHref={ + testPlanVersion.metadata + ?.testFormatVersion === 2 + ? null + : `/test-review/${testPlanVersion.id}` + } > {testPlanVersion.versionString} @@ -673,21 +679,27 @@ const TestPlanVersionsPage = () => { : {testPlanVersion.gitMessage} -
  • - - + + + View tests in{' '} + { + testPlanVersion.versionString } - size="xs" - color="#818F98" - /> - View tests in{' '} - {testPlanVersion.versionString} - -
  • + + + )} {!hasFinalReports ? null : (