Skip to content

ref(rr6): Remove useRouter from pageFilters actions#110888

Merged
evanpurkhiser merged 1 commit intomasterfrom
evanpurkhiser/ref-rr6-remove-userouter-from-pagefilters-actions
Mar 25, 2026
Merged

ref(rr6): Remove useRouter from pageFilters actions#110888
evanpurkhiser merged 1 commit intomasterfrom
evanpurkhiser/ref-rr6-remove-userouter-from-pagefilters-actions

Conversation

@evanpurkhiser
Copy link
Member

Replace the router parameter with location + navigate in
updateDateTime, updateProjects, updateEnvironments, and
initializeUrlState. This removes the dependency on the legacy
InjectedRouter type from all page filter action functions.

@evanpurkhiser evanpurkhiser requested review from a team as code owners March 17, 2026 18:17
@evanpurkhiser evanpurkhiser requested review from a team and removed request for a team March 17, 2026 18:17
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 17, 2026
Comment on lines +176 to +188
const routerNavigate = router
? (((to: any, options?: any) => {
if (typeof to === 'number') {
router.go(to);
return;
}
if (options?.replace) {
router.replace(to);
} else {
router.push(to);
}
}) as ReactRouter3Navigate)
: undefined;
Copy link
Member Author

Choose a reason for hiding this comment

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

not sure why it decided to do it like this 🤦

Copy link
Member Author

Choose a reason for hiding this comment

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

OK I see, it's because it's a class component and it can't get navgiate from useNaviate.

I'm going to swap this over to using a withNavigate deprecated HoC that we can use in these few places, and then ofc remove when we convert these all to FCs in whatever future.

@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-rr6-remove-userouter-from-pagefilters-actions branch from aaf84e6 to e39328f Compare March 17, 2026 19:15
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-rr6-remove-userouter-from-pagefilters-actions branch from e39328f to 0a0bae5 Compare March 17, 2026 19:28
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-rr6-remove-userouter-from-pagefilters-actions branch from 0a0bae5 to 91c8e5e Compare March 17, 2026 20:22
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-rr6-remove-userouter-from-pagefilters-actions branch from 91c8e5e to 081ccab Compare March 25, 2026 19:58
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-rr6-remove-userouter-from-pagefilters-actions branch from 351d90b to 22afef1 Compare March 25, 2026 20:39
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-rr6-remove-userouter-from-pagefilters-actions branch from 1c3f3ee to d363e8e Compare March 25, 2026 21:50
Replace the `router` parameter with `location` + `navigate` in
updateDateTime, updateProjects, updateEnvironments, and
initializeUrlState. This removes the dependency on the legacy
InjectedRouter type from all page filter action functions.
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-rr6-remove-userouter-from-pagefilters-actions branch from d363e8e to 226a790 Compare March 25, 2026 22:23
@evanpurkhiser evanpurkhiser merged commit 7b4a7f4 into master Mar 25, 2026
70 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-rr6-remove-userouter-from-pagefilters-actions branch March 25, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants