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

payment history page back button to previous page #33269

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

janechodance
Copy link
Contributor

@janechodance janechodance commented Nov 27, 2024

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?

  • No, I'm not changing any folders (skip to TeamSites and delete the rest of this section)
  • Yes, I'm removing, renaming or moving a folder

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).

Before After
Mobile
Desktop
payment.table.back.button.mov

What areas of the site does it impact?

Payment history page

Acceptance criteria

Quality Assurance & Testing

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Linting warnings have been addressed
  • Documentation has been updated (link to documentation *if necessary)
  • Screenshot of the developed feature is added
  • Accessibility testing has been performed. #980689

Error Handling

  • Browser console contains no warnings or errors.
  • Events are being sent to the appropriate logging solution
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)

Authentication

  • Did you login to a local build and verify all authenticated routes work as expected with a test user

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?

Copy link

@dysbo dysbo left a 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.

@janechodance janechodance marked this pull request as ready for review November 27, 2024 21:47
@janechodance janechodance requested review from a team as code owners November 27, 2024 21:47
dysbo
dysbo previously approved these changes Nov 27, 2024
rmessina1010
rmessina1010 previously approved these changes Nov 28, 2024
Copy link
Contributor

@rmessina1010 rmessina1010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@1Copenut
Copy link
Contributor

1Copenut commented Dec 2, 2024

Starting accessibility test issue now. Should have findings in an hour or two.

Copy link
Contributor

@1Copenut 1Copenut left a 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}`;
Copy link
Contributor

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}
>

@janechodance janechodance dismissed stale reviews from rmessina1010 and dysbo via 8bd5dd8 December 2, 2024 21:21
1Copenut
1Copenut previously approved these changes Dec 2, 2024
Copy link
Contributor

@1Copenut 1Copenut left a 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!

@va-vfs-bot va-vfs-bot temporarily deployed to master/96174-payment-history-back-button/main December 2, 2024 22:04 Inactive
@janechodance janechodance marked this pull request as draft December 3, 2024 14:33
@janechodance janechodance marked this pull request as ready for review December 3, 2024 14:33
dysbo
dysbo previously approved these changes Dec 3, 2024
@va-vfs-bot va-vfs-bot temporarily deployed to master/96174-payment-history-back-button/main December 3, 2024 14:36 Inactive
const totalPages = useRef(0);
const paginatedData = useRef([]);
const currentPage = new URLSearchParams(location.search).get('page') || 1;
const [totalPages, setTotalPages] = useState(0);
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated!

@janechodance janechodance dismissed stale reviews from dysbo and 1Copenut via b86350a December 4, 2024 21:37
@va-vfs-bot va-vfs-bot requested a review from a team December 4, 2024 21:38
Copy link

@va-vfs-bot va-vfs-bot left a 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.

@va-vfs-bot va-vfs-bot temporarily deployed to master/96174-payment-history-back-button/main December 4, 2024 22:10 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/96174-payment-history-back-button/main December 4, 2024 22:45 Inactive
dysbo
dysbo previously approved these changes Dec 5, 2024
@va-vfs-bot va-vfs-bot temporarily deployed to master/96174-payment-history-back-button/main December 5, 2024 19:08 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/96174-payment-history-back-button/main December 5, 2024 19:39 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/96174-payment-history-back-button/main December 6, 2024 18:44 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Payment History] Back Button Not Handling Traversing Backwards in Pagination Tabs
6 participants