Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide links to single page test plan view for test plan versions using v2 #855

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions client/components/DataManagement/DataManagementRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 (
<PhaseCell role="list" aria-setsize={isAdmin ? 2 : 1}>
<VersionString
role="listitem"
iconColor="#2BA51C"
linkHref={`/test-review/${latestVersion.id}`}
linkHref={linkHref}
>
{latestVersion.versionString}
</VersionString>
Expand Down Expand Up @@ -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 (
<PhaseCell role="list" aria-setsize={isAdmin ? 3 : 2}>
<VersionString
role="listitem"
iconColor="#2BA51C"
linkRef={draftVersionStringRef}
linkHref={`/test-review/${latestVersion.id}`}
linkHref={linkHref}
>
{latestVersion.versionString}
</VersionString>
Expand Down Expand Up @@ -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 (
<PhaseCell
role="list"
Expand All @@ -889,7 +903,7 @@ const DataManagementRow = ({
role="listitem"
iconColor="#2BA51C"
linkRef={candidateVersionStringRef}
linkHref={`/test-review/${latestVersion.id}`}
linkHref={linkHref}
>
{latestVersion.versionString}
</VersionString>
Expand Down Expand Up @@ -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 (
<PhaseCell role="list">
<VersionString
role="listitem"
iconColor="#2BA51C"
linkRef={recommendedVersionStringRef}
linkHref={`/test-review/${latestVersion.id}`}
linkHref={linkHref}
>
{latestVersion.versionString}
</VersionString>
Expand Down
3 changes: 3 additions & 0 deletions client/components/DataManagement/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const DATA_MANAGEMENT_PAGE_QUERY = gql`
}
}
}
metadata
}
}
`;
Expand Down Expand Up @@ -133,6 +134,7 @@ export const UPDATE_TEST_PLAN_VERSION_PHASE = gql`
feedbackType
}
}
metadata
}
}
}
Expand Down Expand Up @@ -179,6 +181,7 @@ export const UPDATE_TEST_PLAN_VERSION_RECOMMENDED_TARGET_DATE = gql`
feedbackType
}
}
metadata
}
}
}
Expand Down
42 changes: 27 additions & 15 deletions client/components/TestPlanVersionsPage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
</VersionString>
Expand Down Expand Up @@ -673,21 +679,27 @@ const TestPlanVersionsPage = () => {
: {testPlanVersion.gitMessage}
</a>
</li>
<li>
<a
href={`/test-review/${testPlanVersion.id}`}
>
<FontAwesomeIcon
icon={
faArrowUpRightFromSquare
{/* TODO: Remove this testFormatVersion check when #745 is implemented */}
{testPlanVersion.metadata
.testFormatVersion === 2 ? null : (
<li>
<a
href={`/test-review/${testPlanVersion.id}`}
>
<FontAwesomeIcon
icon={
faArrowUpRightFromSquare
}
size="xs"
color="#818F98"
/>
View tests in{' '}
{
testPlanVersion.versionString
}
size="xs"
color="#818F98"
/>
View tests in{' '}
{testPlanVersion.versionString}
</a>
</li>
</a>
</li>
)}
{!hasFinalReports ? null : (
<li>
<a
Expand Down
1 change: 1 addition & 0 deletions client/components/TestPlanVersionsPage/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const TEST_PLAN_VERSIONS_PAGE_QUERY = gql`
name
}
}
metadata
}
}
}
Expand Down
Loading