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

Allow candidate test plans to advance with override #832

Merged
merged 3 commits into from
Dec 11, 2023
Merged
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
51 changes: 31 additions & 20 deletions client/components/DataManagement/DataManagementRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,14 @@ const DataManagementRow = ({
const recommendedPhaseTargetDate = new Date(
latestVersion.recommendedPhaseTargetDate
);
const candidatePhaseReachedDate = new Date(
latestVersion.candidatePhaseReachedAt
);
const daysInReview = checkDaysBetweenDates(
currentDate,
candidatePhaseReachedDate
);
const workingModeDaysToReview = 120;

let timeToTargetDate = 0;
if (currentDate > recommendedPhaseTargetDate) {
Expand All @@ -854,19 +862,6 @@ const DataManagementRow = ({
currentDate
);

const daysBetweenDates = checkDaysBetweenDates(
currentDate,
latestVersion.candidatePhaseReachedAt
);
const DAYS_TO_PROVIDE_FEEDBACK = 120;
const shouldShowAdvanceButton =
isAdmin &&
completedRequiredReports(latestVersion) &&
issuesCount === 0 &&
(recommendedTestPlanVersions.length ||
(!recommendedTestPlanVersions.length &&
daysBetweenDates > DAYS_TO_PROVIDE_FEEDBACK));

let coveredReports = [];
latestVersion.testPlanReports.forEach(testPlanReport => {
const markedFinalAt = testPlanReport.markedFinalAt;
Expand All @@ -881,10 +876,7 @@ const DataManagementRow = ({
// Phase is "active"
insertActivePhaseForTestPlan(latestVersion);
return (
<PhaseCell
role="list"
aria-setsize={shouldShowAdvanceButton ? 5 : 4}
>
<PhaseCell role="list" aria-setsize={isAdmin ? 5 : 4}>
<VersionString
role="listitem"
iconColor="#2BA51C"
Expand All @@ -893,7 +885,7 @@ const DataManagementRow = ({
>
{latestVersion.versionString}
</VersionString>
{shouldShowAdvanceButton && (
{isAdmin && (
<Button
ref={ref => setFocusRef(ref)}
className="advance-button"
Expand All @@ -914,7 +906,11 @@ const DataManagementRow = ({
testPlanVersionDataToInclude
);
},
coveredReports
coveredReports,
candidateDaysInReview: daysInReview,
candidateWorkingModeDaysToReview:
workingModeDaysToReview,
testPlanTitle: testPlan.title
});
}}
>
Expand Down Expand Up @@ -1050,7 +1046,6 @@ const DataManagementRow = ({
)}
</td>
</tr>

{showThemedModal && themedModal}
{showAdvanceModal && (
<BasicModal
Expand All @@ -1059,6 +1054,22 @@ const DataManagementRow = ({
title={`Advancing test plan, ${testPlan.title}, ${advanceModalData.version}`}
content={
<>
{advanceModalData.candidateWorkingModeDaysToReview -
advanceModalData.candidateDaysInReview >
0 ? (
<p>
Warning! the {testPlan.title} test plan has
been in candidate review for{' '}
{advanceModalData.candidateDaysInReview}{' '}
days, which is{' '}
{advanceModalData.candidateWorkingModeDaysToReview -
advanceModalData.candidateDaysInReview}{' '}
fewer days than recommended by the ARIA-AT
working mode. Confirm this action only if
impacted stakeholders have had sufficient
opportunity to provide consensus.
</p>
) : null}
This version will be updated to&nbsp;
<b>{advanceModalData.phase}</b>.&nbsp;
{advanceModalData.coveredReports?.length ? (
Expand Down
Loading