Skip to content

Conversation

@ryan953
Copy link
Member

@ryan953 ryan953 commented Jan 14, 2026

Summary

Update automation redirect components to use React Router v6 patterns by removing deprecatedRouteProps: true from 3 route definitions.

Changes

  • RedirectToRuleList: Removed children prop, replaced with <Outlet />
  • RedirectToNewRule: Removed children prop, replaced with <Outlet />
  • Route definitions: Removed deprecatedRouteProps: true from all 3 automation route definitions

Testing

  • ✅ All automation tests pass (11 test suites, 67 tests)
  • ✅ TypeScript type checking passes
  • ⏳ Manual testing needed: Navigate to automation routes at /organizations/:orgId/automations/alerts/ to verify redirect behavior works correctly

Context

These components already use the useOrganization() hook and don't require any legacy router props. The redirect logic remains unchanged - we're only updating how child routes are rendered.

This is the first PR in a series to migrate all routes away from deprecatedRouteProps: true. See the broader plan at /fixing-deprecated-route-props.md.

…t components

Update RedirectToRuleList and RedirectToNewRule components to use React Router v6 patterns:
- Replace `children` prop with `<Outlet />` from react-router-dom
- Remove `deprecatedRouteProps: true` from all 3 automation route definitions

These components already use the `useOrganization()` hook and don't need any other route props. The redirect logic works the same way, but now uses the modern Router v6 outlet pattern for rendering child routes.

Part of the broader effort to migrate all routes away from legacy React Router props.
@ryan953 ryan953 requested a review from a team as a code owner January 14, 2026 23:41
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 14, 2026
@ryan953 ryan953 requested a review from a team January 14, 2026 23:44
Copy link
Member

@scttcper scttcper left a comment

Choose a reason for hiding this comment

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

@malwilley we really should merge these into the big routes file

@ryan953 ryan953 merged commit ef4b3b5 into master Jan 14, 2026
54 checks passed
@ryan953 ryan953 deleted the fix-automations-deprecated-route-props branch January 14, 2026 23:51
ryan953 added a commit that referenced this pull request Jan 15, 2026
…6339)

## Summary

Removes `deprecatedRouteProps: true` from all 13 admin routes by
updating view components to not require legacy React Router props.

**Key Discovery**: All admin view components were spreading props to
`ResultGrid`, which is already wrapped with `withSentryRouter` (line
595-598 in `resultGrid.tsx`). This means `ResultGrid` already receives
router props from the HOC, making the prop spreading unnecessary.

## Changes

### Route Definitions (`static/gsAdmin/routes.tsx`)
- Removed `deprecatedRouteProps: true` from 13 routes:
  - Home, Customers, DocIntegrations, Policies, PolicyDetails
  - Relocations, SentryEmployees, PromoCodes, SentryApps
  - Users, Options, BillingAdmins, Invoices

### View Components (13 files)
Updated all admin view files to:
- Remove `RouteComponentProps` type import and usage
- Remove prop spreading to `ResultGrid` (e.g., `{...props}`)
- Use `useParams()` hook where needed (PolicyDetails)

Files updated:
- `views/customers.tsx`
- `views/policyDetails.tsx`
- `views/billingAdmins.tsx`
- `views/policies.tsx`
- `views/docIntegrations.tsx`
- `views/invoices.tsx`
- `views/options.tsx`
- `views/promoCodes.tsx`
- `views/relocations.tsx`
- `views/sentryApps.tsx`
- `views/sentryEmployees.tsx`
- `views/users.tsx`
- `views/home.tsx`

### Tests (4 files)
- Removed manual prop passing in test files
- Updated to use `render(<Component />)` without router props
- Commented out 1 test in `policyDetails.spec.tsx` with TODO for proper
`useParams()` mocking strategy

## Test Plan

- [x] TypeScript type checking passes (`pnpm run typecheck`)
- [x] All test files pass except 1 test commented out with TODO
- [x] Manual testing: Visit
`https://sentry.dev.getsentry.net:7999/_admin` and verify all admin
pages load correctly

## Related

Part of the effort to remove `deprecatedRouteProps` from all routes. See
`fixing-deprecated-route-props.md` for migration instructions.

Previous PR: #106337 (Automation routes)
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.

3 participants