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

CMS-437: Update URL paths, use resolvers #148

Open
wants to merge 3 commits into
base: CMS-634-header-footer
Choose a base branch
from

Conversation

duncan-oxd
Copy link
Collaborator

Jira Ticket

CMS-437

Description

I couldn't find a way to resolve routes by a name or ID in React, so I've added a "paths" file with functions that take park/season IDs and return the URL paths.

This branch replaces all the hard-coded URL paths in all of the links and navigate calls, and uses the resolvers instead.

I also updated the non-winter season URL paths to be consistent with the winter-fees, and made the resource names plural.

Previously:

park/:parkId/edit/:seasonId
park/:parkId/edit/:seasonId/preview
park/:parkId/winter-fees/:seasonId/edit
park/:parkId/winter-fees/:seasonId/preview

Updated:

parks/:parkId/seasons/:seasonId/edit
parks/:parkId/seasons/:seasonId/preview
parks/:parkId/winter-fees/:seasonId/edit
parks/:parkId/winter-fees/:seasonId/preview

@duncan-oxd duncan-oxd self-assigned this Mar 1, 2025
Comment on lines -371 to 372
<NavBack routePath={`/park/${parkId}/edit/${seasonId}`}>
<NavBack routePath={paths.park(parkId)}>
Back to {data?.park.name} dates
</NavBack>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I also fixed this; these "NavBack" buttons should always go back to the Park details page, so it was incorrect here on the non-winter preview page.

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.

1 participant