-
Notifications
You must be signed in to change notification settings - Fork 126
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
payment history page back button to previous page #33269
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like managing the page solely through the param vs managing it in both the param and the state. Great move.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Starting accessibility test issue now. Should have findings in an hour or two. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @janechodance. I'm still working with DST to figure out this phantom axe-core issue, but otherwise the accessibility review has gone really well. I added an improvement (suggested) change for screen reader handling.
If you'd prefer to add this as a separate issue, let me know and I'll file a follow-on ticket.
Thank you!
|
||
const onPageChange = page => { | ||
setCurrentData(paginatedData.current[page - 1]); | ||
setCurrentPage(page); | ||
const newURL = `${location.pathname}?page=${page}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to use this custom event to also set focus on the H3 that announces the number of results. I tested it locally and it's working really well and only a few more lines:
// Line 33
+ const tableHeadingRef = useRef(null);
const onPageChange = page => {
const newURL = `${location.pathname}?page=${page}`;
+ if (tableHeadingRef) {
+ tableHeadingRef.current.focus();
+ }
navigate(newURL);
};
<h3
className="vads-u-font-size--lg vads-u-font-family--serif"
+ ref={tableHeadingRef}
+ tabIndex={-1}
>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍LGTM! I retested with latest main
and the axe browser plugin issue we were seeing before is gone. I retested the new focus management with NVDA and Narrator. Works great!
const totalPages = useRef(0); | ||
const paginatedData = useRef([]); | ||
const currentPage = new URLSearchParams(location.search).get('page') || 1; | ||
const [totalPages, setTotalPages] = useState(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use useRef
here unless you want the page to re-render when you call setTotalPages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint is disabled
vets-website
uses ESLint to help enforce code quality. In most situations we would like ESLint to remain enabled.
What you can do
See if the code can be refactored to avoid disabling ESLint, or wait for a VSP review.
...tions/disability-benefits/view-payments/components/view-payments-lists/payments/Payments.jsx
Outdated
Show resolved
Hide resolved
…m/department-of-veterans-affairs/vets-website into 96174-payment-history-back-button
Note: Delete the description statements, complete each step. None are optional, but can be justified as to why they cannot be completed as written. Provide known gaps to testing that may raise the risk of merging to production.
Are you removing, renaming or moving a folder in this PR?
Did you change site-wide styles, platform utilities or other infrastructure?
Summary
Add navigation to payment history page so the back button will correctly navigate to previous page
Related issue(s)
department-of-veterans-affairs/va.gov-team#96174
Testing done
locally tested and add unit test
Screenshots
Note: This field is mandatory for UI changes (non-component work should NOT have screenshots).
payment.table.back.button.mov
What areas of the site does it impact?
Payment history page
Acceptance criteria
Quality Assurance & Testing
Error Handling
Authentication
Requested Feedback
(OPTIONAL) What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?