Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Display RouteNotFound component on unmatched routes #657

Merged
merged 1 commit into from Jul 10, 2019

Conversation

kellyi
Copy link
Contributor

@kellyi kellyi commented Jul 9, 2019

Overview

Make react-router setup adjustments to ensure we display RouteNotFound component on unmatched routes.

Connects #621

Testing Instructions

  • serve branch, ./scripts/manage resetdb && ./scripts/manage processfixtures
  • turn on claim a facility
  • visit the app on 6543 and navigate through routes as:
    • c1@example
    • c2@example
    • non-signed-in user

...and verify that the routing now:

  • displays a component when appropriate match occurs
  • displays the RouteNotFound component (which is still not very well-styled) for routes which should not match)

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

@kellyi kellyi force-pushed the ki/use-routenotfound-for-unmatched-routes branch from 0c8d176 to 42c6100 Compare July 10, 2019 18:59
@kellyi kellyi changed the title WIP use RouteNotFound for unmatched routes Display RouteNotFound component on unmatched routes Jul 10, 2019
@kellyi kellyi requested a review from rajadain July 10, 2019 19:02
@kellyi kellyi marked this pull request as ready for review July 10, 2019 19:02
@kellyi kellyi force-pushed the ki/use-routenotfound-for-unmatched-routes branch from 42c6100 to 39d6cf1 Compare July 10, 2019 19:09
Copy link
Contributor

@rajadain rajadain left a comment

Choose a reason for hiding this comment

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

+1 tested, got a 404 when hitting invalid / disallowed routes as various users.

src/app/src/App.jsx Outdated Show resolved Hide resolved
@rajadain rajadain assigned kellyi and unassigned rajadain Jul 10, 2019
Adjust react router switch statements to display the RouteNotFound
component on unmatched routes. For routes which are leaf nodes, add an
`exact` prop to these routes to indicate that they should only match
exactly; for matches that are not, adjust order of cases in the `Switch`
blocks to ensure routes are rendered appropriately.
@kellyi kellyi force-pushed the ki/use-routenotfound-for-unmatched-routes branch from 39d6cf1 to d83c203 Compare July 10, 2019 20:34
@kellyi kellyi merged commit 6c243c3 into develop Jul 10, 2019
@kellyi kellyi deleted the ki/use-routenotfound-for-unmatched-routes branch July 10, 2019 20:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants