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

Allocations/routing: wait, don't redirect #1782

Merged
merged 2 commits into from
Dec 17, 2019
Merged

Allocations/routing: wait, don't redirect #1782

merged 2 commits into from
Dec 17, 2019

Conversation

chadoh
Copy link
Collaborator

@chadoh chadoh commented Dec 16, 2019

Since it can take quite some time from initial load of an app until the time that it may have enough data loaded to show a certain URL, we do not want to change the route if no matching item is found. Instead, we want to ignore the unknown URL.

This sets us up to do that by making the BudgetDetail component ignore routing, instead passing budget in as a prop. This allows all routing logic to be located in the Routes component in App.js.

I also standardized on usePathHelpers, rather than sometimes using raw usePath.

PeterMPhillips
PeterMPhillips previously approved these changes Dec 16, 2019
Copy link
Member

@PeterMPhillips PeterMPhillips left a comment

Choose a reason for hiding this comment

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

Looks good. Are you still using patientlyRequestPath in usePathHelpers.js? It's still in that file, just want to confirm that you want to keep it

Chad Ostrowski added 2 commits December 16, 2019 17:06
Since it can take quite some time from initial load of an app until the
time that it may have enough data loaded to show a certain URL, we do
not want to change the route if no matching item is found. Instead, we
want to ignore the unknown URL.

This sets us up to do that by making the BudgetDetail component ignore
routing, instead passing `budget` in as a prop. This allows all routing
logic to be located in the Routes component in App.js.

This also means that we can entirely remove the patientlyRequestPath
function. When doing this, I noticed that nothing is using the `path`
export from `usePathHelpers`, so I also removed it.
Rather than some files using raw `usePath` and some using
`usePathHelpers`, I think it makes sense to standardize on
`usePathHelpers` everywhere.

I also prefer the named import (`{ requestPath }`) to the positional
import (`[ , requestPath ]`)
@chadoh
Copy link
Collaborator Author

chadoh commented Dec 16, 2019

Ah, great point, @PeterMPhillips! I removed it

@chadoh chadoh merged commit 1bee69d into dev Dec 17, 2019
@chadoh chadoh deleted the allocations-routing branch December 17, 2019 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants