Open JRRoof opened 6 months ago
The component can be found here: https://github.com/department-of-veterans-affairs/vets-website/blob/main/src/platform/site-wide/user-nav/components/PageNotFound.jsx
You can import it using: import PageNotFound from '@department-of-veterans-affairs/platform-site-wide/PageNotFound';
Description
Currently, an HTTP 404 error code is generated by the VA web server if a veteran tries to access an unknown or bad URL on the VA site for a static content page (e.g. https://www.va.gov/dummy). The web server is set up to respond to HTTP 404 error codes by showing a "page not found" page to the user as shown below. This works well for static content served by the web server. However, dynamic content that gets rendered on the client side (like from a React app) cannot generate HTTP codes for missing pages for the web server to respond to. All React apps that the VA site uses render on the client side. Each React app has a specified root URL in its manifest.json file (e.g./health-care/schedule-view-va-appointments/) that links to the app regardless of any sub-path provided in the URL (e.g. /health-care/schedule-view-va-appointments//path/path/path leads to the same React app). The apps use React Router conditional code to render content based on the child path(s) of the root URL (e.g. /path/path/path). An empty or incomplete page can result if the app’s routing logic does not explicitly handle the provided path(s). A sample of this behavior can be found below.
This results in the VA site rendering empty or incomplete pages with no further information or action for the user.
Recommendation
React apps have various routing patterns that restrict our ability to implement a catch-all solution at the React Router level. These various patterns also mean that the routing for some apps may need to be refactored in order to properly handle unknown URLs. Our recommendation is as follows:
Slack Canvas outlining issue and ask
Acceptance Criteria
Given an authenticated user When navigating to an unknown or bad URL starting with va.gov/my-health/appointments/ Then page-not-found component is displayed
Design Assets
All spec copy is FPO. Use copy in copy doc.
Definition of Done
How to configure this issue
backend
,frontend
,devops
,design
,research
,product
,ia
,qa
,analytics
,contact center
,research
,accessibility
,content
)bug
,request
,discovery
,documentation
, etc.)