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

Add UI for Required Reports Phase update #774

Open
wants to merge 64 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
415080a
Add required reports dropdown
Paul-Clue Aug 17, 2023
1f9eed0
Merge branch 'update-database-impl' into edit-required-reports
Paul-Clue Aug 21, 2023
d2599d5
Fix bug that would allow testPlanVersion to be updated to RECOMMENDED…
howard-e Aug 21, 2023
b062bac
Start interface in UI for required reports
Paul-Clue Aug 23, 2023
cc1ec2d
Refine raise an issue behavior (#753)
alflennik Aug 24, 2023
e31ecab
Fix for test results not being automatically saved when navigating th…
howard-e Aug 24, 2023
3357740
Filter and sort functionality for Data Management table (#750)
stalgiag Aug 28, 2023
232f0d0
Explicitly support 'DEPRECATED' phase for `TestPlanVersion.phase` (#749)
howard-e Aug 28, 2023
8c85daa
Ensure only reports marked as final are displayed on /embed/reports/<…
howard-e Aug 29, 2023
3f64387
Fix test
howard-e Aug 29, 2023
3ed8eac
Update failing test
howard-e Aug 29, 2023
f3823b0
Adjust semantic structure on Data Management Page (#752)
howard-e Aug 29, 2023
452f9bb
Adjust BasicModal to support AtAndBrowserDetailsModal closing
howard-e Aug 29, 2023
a3b8dbe
Stop assign menu dropdown from creating unintended bottom space with …
howard-e Aug 29, 2023
112d948
Formatting
howard-e Aug 29, 2023
fffdb62
Close #755
howard-e Aug 30, 2023
b3366b3
Close #754
howard-e Aug 30, 2023
66267cc
Remove superfluous header from TestPlanReportStatusDialog (#766)
stalgiag Aug 30, 2023
15f22da
Revise required reports conditions (#764)
howard-e Aug 30, 2023
0828988
Add UI models and resolvers for phase requirements
Paul-Clue Sep 5, 2023
58920b0
Update Version History Page (#767)
howard-e Sep 6, 2023
04c15f6
Update date format used in aria-label
howard-e Sep 7, 2023
4ca4fd2
Update required report table
Paul-Clue Sep 12, 2023
e4e78fa
Fix createRequiredReport not being called during edge case condition
howard-e Sep 12, 2023
5aa85a3
update modals and functions for phase requirement
Paul-Clue Sep 14, 2023
e6bd038
Add Update delete modal and modal for updating
Paul-Clue Sep 18, 2023
349db06
Add tests
Paul-Clue Sep 18, 2023
cbfed9b
Add required reports dropdown
Paul-Clue Aug 17, 2023
9e8a703
Start interface in UI for required reports
Paul-Clue Aug 23, 2023
c24bb53
Add UI models and resolvers for phase requirements
Paul-Clue Sep 5, 2023
f03e87d
Delete commented code
Paul-Clue Sep 18, 2023
0c4b432
Update required report table
Paul-Clue Sep 12, 2023
f6b5e7e
Fix createRequiredReport not being called during edge case condition
howard-e Sep 12, 2023
1354983
update modals and functions for phase requirement
Paul-Clue Sep 14, 2023
a88b8d0
Add Update delete modal and modal for updating
Paul-Clue Sep 18, 2023
3c16ce5
Add tests
Paul-Clue Sep 18, 2023
666ab8a
Fix reference after rebase
howard-e Sep 18, 2023
bccaab0
Remove comments and fix test
Paul-Clue Sep 19, 2023
6a90d72
Fix test and delete comments
Paul-Clue Sep 19, 2023
0895466
Add prop for ManageRequiredReports dropdown
Paul-Clue Sep 20, 2023
84c260f
Remove comment
Paul-Clue Sep 20, 2023
87abb14
Update `Timeline for All Versions` table on Test Plan Versions Page (…
howard-e Sep 21, 2023
1338f81
Deprecated phase copy (#781)
alflennik Sep 21, 2023
77fd305
Add hidden JSON metadata to issues created by the app (#775)
alflennik Sep 26, 2023
373a142
Relocate customToggle components and fix browser selection value
Paul-Clue Sep 27, 2023
0897edb
Add comment
Paul-Clue Sep 27, 2023
1556b45
Fix tab issue on Phase select element
Paul-Clue Sep 27, 2023
80b51b1
Change default data management sort status direction (#790)
stalgiag Sep 28, 2023
fae9cab
Address edge case scenarios during the updating of TestPlanVersion ph…
howard-e Sep 28, 2023
af052a4
Fix merge conflicts
Paul-Clue Sep 28, 2023
2644b19
Fix merge conflicts
Paul-Clue Sep 28, 2023
d09a0a4
Merge branch 'main' into edit-required-reports
howard-e Sep 29, 2023
176b1a0
Pull changes from rebase
Paul-Clue Oct 2, 2023
590b550
Fix check for browser selection
Paul-Clue Oct 5, 2023
868f63b
Implement requested changes
Paul-Clue Oct 5, 2023
8add712
Remove a state for browser option
Paul-Clue Oct 5, 2023
b9861bb
Fix at selection
Paul-Clue Oct 5, 2023
34e0664
Fix typo
Paul-Clue Oct 5, 2023
612bd4c
Fix typo
Paul-Clue Oct 5, 2023
4aa01b9
Fix typo
Paul-Clue Oct 5, 2023
9f41859
Fix typo
Paul-Clue Oct 5, 2023
6eeafaa
Implement requested changes
Paul-Clue Oct 17, 2023
7132a12
Fix merge conflicts
Paul-Clue Oct 18, 2023
bd402b5
Fix selct box responsiveness
Paul-Clue Oct 19, 2023
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
1 change: 1 addition & 0 deletions .github/workflows/runtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
yarn sequelize:test db:migrate
yarn sequelize:test db:seed:all
yarn workspace server db-import-tests:test -c ${IMPORT_ARIA_AT_TESTS_COMMIT_1}
yarn workspace server db-import-tests:test -c ${IMPORT_ARIA_AT_TESTS_COMMIT_2}
yarn workspace server db-import-tests:test
yarn workspace server db-populate-sample-data:test
- name: test
Expand Down
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{
"name": "Import tests",
"program": "${workspaceFolder}/server/scripts/import-tests/index.js",
// "args": ["-c","5fe7afd82fe51c185b8661276105190a59d47322"],
"request": "launch",
"envFile": "${workspaceFolder}/config/dev.env",
"skipFiles": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,7 @@
}

.test-results-header {
border-bottom: none;
margin: 0;
padding: 20px;
font-size: 20px;
background-color: #f5f8fa;
border: #e5efe8 1px solid;
margin: 0 0 1rem;
}

.test-results-table {
Expand Down
218 changes: 91 additions & 127 deletions client/components/CandidateReview/CandidateTestPlanRun/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,17 @@ import { Helmet } from 'react-helmet';
import './CandidateTestPlanRun.css';
import '../../TestRun/TestRun.css';
import '../../App/App.css';
import useResizeObserver from '@react-hook/resize-observer';
import { useMediaQuery } from 'react-responsive';
import { convertDateToString } from '../../../utils/formatter';
import TestPlanResultsTable from '../../Reports/TestPlanResultsTable';
import TestPlanResultsTable from '../../common/TestPlanResultsTable';
import { calculateAssertionsCount } from '../../common/TestPlanResultsTable/utils';
import ProvideFeedbackModal from '../CandidateModals/ProvideFeedbackModal';
import ThankYouModal from '../CandidateModals/ThankYouModal';
import getMetrics from '../../Reports/getMetrics';
import FeedbackListItem from '../FeedbackListItem';
import DisclosureComponent from '../../common/DisclosureComponent';

// https://codesandbox.io/s/react-hookresize-observer-example-ft88x
function useSize(target) {
const [size, setSize] = React.useState();

React.useLayoutEffect(() => {
target && setSize(target.getBoundingClientRect());
}, [target]);

// Where the magic happens
useResizeObserver(target, entry => setSize(entry.contentRect));
return size;
}
import createIssueLink, {
getIssueSearchLink
} from '../../../utils/createIssueLink';

const CandidateTestPlanRun = () => {
const { atId, testPlanVersionId } = useParams();
Expand Down Expand Up @@ -80,10 +69,6 @@ const CandidateTestPlanRun = () => {
const [showBrowserBools, setShowBrowserBools] = useState([]);
const [showBrowserClicks, setShowBrowserClicks] = useState([]);

const [issuesHeading, setIssuesHeading] = React.useState();
const issuesHeadingSize = useSize(issuesHeading);
const [issuesList, setIssuesList] = React.useState();
const issuesListSize = useSize(issuesList);
const isLaptopOrLarger = useMediaQuery({
query: '(min-width: 792px)'
});
Expand Down Expand Up @@ -312,64 +297,79 @@ const CandidateTestPlanRun = () => {
// Assumes that the issues are across the entire AT/Browser combination
const changesRequestedIssues = testPlanReport.issues?.filter(
issue =>
issue.isCandidateReview &&
issue.feedbackType === 'CHANGES_REQUESTED' &&
issue.testNumberFilteredByAt === currentTest.seq
);

const feedbackIssues = testPlanReport.issues?.filter(
issue =>
issue.isCandidateReview &&
issue.feedbackType === 'FEEDBACK' &&
issue.testNumberFilteredByAt === currentTest.seq
);

const issue = {
isCandidateReview: true,
isCandidateReviewChangesRequested: true,
testPlanTitle: testPlanVersion.title,
testPlanDirectory: testPlanVersion.testPlan.directory,
versionString: testPlanVersion.versionString,
testTitle: currentTest.title,
testRowNumber: currentTest.rowNumber,
testRenderedUrl: currentTest.renderedUrl,
atName: testPlanReport.at.name
};

const requestChangesUrl = createIssueLink(issue);

const feedbackUrl = createIssueLink({
...issue,
isCandidateReviewChangesRequested: false
});

const generalFeedbackUrl = createIssueLink({
...issue,
isCandidateReviewChangesRequested: false,
testTitle: undefined,
testRowNumber: undefined,
testRenderedUrl: undefined
});

const issueQuery = {
isCandidateReview: true,
isCandidateReviewChangesRequested: false,
testPlanTitle: testPlanVersion.title,
versionString: testPlanVersion.versionString,
testRowNumber: currentTest.rowNumber,
username: data.me.username,
atName: testPlanReport.at.name
};

const feedbackGithubUrl = getIssueSearchLink(issueQuery);

const changesRequestedGithubUrl = getIssueSearchLink({
...issueQuery,
isCandidateReviewChangesRequested: true
});

let fileBugUrl;

const githubAtLabelMap = {
'VoiceOver for macOS': 'vo',
JAWS: 'jaws',
NVDA: 'nvda'
};

const generateGithubUrl = (
test = false,
type = '',
titleAddition = '',
search = false,
author = ''
) => {
const testPlanVersionDate = convertDateToString(
new Date(testPlanVersion.updatedAt),
'DD-MM-YYYY'
);

const generateGithubTitle = () => {
return `${at} Feedback: "${currentTest.title}" (${
testPlanVersion.title
}${
test ? `, Test ${currentTest.seq}` : ''
}, ${testPlanVersionDate})${
titleAddition ? ` - ${titleAddition}` : ''
}`;
};

const githubIssueUrlTitle = generateGithubTitle();
const defaultGithubLabels = 'app,candidate-review';
let githubUrl;

if (!search) {
githubUrl = `https://github.com/w3c/aria-at/issues/new?title=${encodeURI(
githubIssueUrlTitle
)}&labels=${defaultGithubLabels},${githubAtLabelMap[at]}`;
return `${githubUrl},${type}`;
} else {
let title = generateGithubTitle();
let query = encodeURI(
`label:app label:candidate-review label:${type} label:${
githubAtLabelMap[at]
} ${author ? `author:${author}` : ''} ${title}`
);
githubUrl = `https://github.com/w3c/aria-at/issues?q=${query}`;
return githubUrl;
}
};
if (githubAtLabelMap[at] == 'vo') {
fileBugUrl =
'https://bugs.webkit.org/buglist.cgi?quicksearch=voiceover';
} else if (githubAtLabelMap[at] == 'nvda') {
fileBugUrl = 'https://github.com/nvaccess/nvda/issues';
} else {
fileBugUrl =
'https://github.com/FreedomScientific/VFO-standards-support/issues';
}

const heading = (
<div className="test-info-heading">
Expand Down Expand Up @@ -426,27 +426,16 @@ const CandidateTestPlanRun = () => {
);

const feedback = testPlanReport.issues.filter(
issue => issue.testNumberFilteredByAt == currentTest.seq
issue =>
issue.isCandidateReview &&
issue.testNumberFilteredByAt == currentTest.seq
).length > 0 && (
<div className="issues-container">
<h2
style={{
width: isLaptopOrLarger
? issuesHeadingSize?.width
: issuesListSize?.width,
position: 'relative'
}}
>
<h2>
<span className="feedback-from-text">Feedback from</span>{' '}
<b>{at} Representative</b>
</h2>
<ul
className="feedback-list"
style={{
width: issuesListSize?.width,
position: 'relative'
}}
>
<ul className="feedback-list">
{[changesRequestedIssues, feedbackIssues].map((list, index) => {
if (list.length > 0) {
const uniqueAuthors = [
Expand All @@ -467,15 +456,16 @@ const CandidateTestPlanRun = () => {
}
issues={list}
individualTest={true}
githubUrl={generateGithubUrl(
true,
index === 0
? 'changes-requested'
: 'feedback',
null,
true,
!differentAuthors ? data.me.username : null
)}
githubUrl={getIssueSearchLink({
isCandidateReview: true,
isCandidateReviewChangesRequested:
index === 0,
atName: testPlanReport.at.name,
testPlanTitle: testPlanVersion.title,
versionString:
testPlanVersion.versionString,
testRowNumber: currentTest.rowNumber
})}
/>
);
}
Expand Down Expand Up @@ -518,17 +508,20 @@ const CandidateTestPlanRun = () => {
testPlanReport.finalizedTestResults[
currentTestIndex
];
const { testsPassedCount } = getMetrics({ testResult });

const { passedAssertionsCount, failedAssertionsCount } =
calculateAssertionsCount(testResult);

return (
<>
<h2 className="test-results-header">
Test Result:{' '}
{testsPassedCount ? 'PASS' : 'FAIL'}
Test Results&nbsp;(
{passedAssertionsCount} passed,&nbsp;
{failedAssertionsCount} failed)
</h2>
<TestPlanResultsTable
tableClassName="test-results-table"
key={`${testPlanReport.id} + ${testResult.id}`}
test={currentTest}
test={{ ...currentTest, at: { name: at } }}
testResult={testResult}
/>
</>
Expand All @@ -540,20 +533,6 @@ const CandidateTestPlanRun = () => {
</div>
);

const requestChangesUrl = generateGithubUrl(true, 'changes-requested');
const feedbackUrl = generateGithubUrl(true, 'feedback');
let fileBugUrl;

if (githubAtLabelMap[at] == 'vo') {
fileBugUrl =
'https://bugs.webkit.org/buglist.cgi?quicksearch=voiceover';
} else if (githubAtLabelMap[at] == 'nvda') {
fileBugUrl = 'https://github.com/nvaccess/nvda/issues';
} else {
fileBugUrl =
'https://github.com/FreedomScientific/VFO-standards-support/issues';
}

return (
<Container className="test-run-container">
<Helmet>
Expand All @@ -580,11 +559,10 @@ const CandidateTestPlanRun = () => {
{heading}
{testInfo}
<Col className="results-container-col">
<Row xs={1} s={1} md={2} ref={setIssuesHeading}>
<Row xs={1} s={1} md={2}>
<Col
className="results-container"
md={isLaptopOrLarger ? 9 : 12}
ref={setIssuesList}
>
<Row>{feedback}</Row>
<Row className="results-container-row">
Expand Down Expand Up @@ -691,28 +669,18 @@ const CandidateTestPlanRun = () => {
testPlan={testPlanVersion.title}
feedbackIssues={testPlanReport.issues?.filter(
issue =>
issue.isCandidateReview &&
issue.feedbackType === 'FEEDBACK' &&
issue.author == data.me.username
)}
feedbackGithubUrl={generateGithubUrl(
false,
'feedback',
null,
true,
data.me.username
)}
feedbackGithubUrl={feedbackGithubUrl}
changesRequestedIssues={testPlanReport.issues?.filter(
issue =>
issue.isCandidateReview &&
issue.feedbackType === 'CHANGES_REQUESTED' &&
issue.author == data.me.username
)}
changesRequestedGithubUrl={generateGithubUrl(
false,
'changes-requested',
null,
true,
data.me.username
)}
changesRequestedGithubUrl={changesRequestedGithubUrl}
handleAction={submitApproval}
handleHide={() => setFeedbackModalShowing(false)}
/>
Expand All @@ -726,11 +694,7 @@ const CandidateTestPlanRun = () => {
setThankYouModalShowing(false);
navigate('/candidate-review');
}}
githubUrl={generateGithubUrl(
false,
'feedback',
'General Feedback'
)}
githubUrl={generalFeedbackUrl}
/>
) : (
<></>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const CANDIDATE_REPORTS_QUERY = gql`
vendorReviewStatus
issues {
author
isCandidateReview
feedbackType
testNumberFilteredByAt
link
Expand Down Expand Up @@ -73,12 +74,14 @@ export const CANDIDATE_REPORTS_QUERY = gql`
metadata
testPageUrl
updatedAt
versionString
candidatePhaseReachedAt
recommendedPhaseTargetDate
}
runnableTests {
id
title
rowNumber
renderedUrl
renderableContent
viewers {
Expand Down
Loading
Loading