Replace string-based redirects in route definitions with named routes
- Dominant language
- JavaScript
- Stars
- 400
- Forks
- 89
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 146
Description
Part of #8094 (prerequisite: #8084)
## What
4 route definitions use hardcoded path strings for their `redirect` property instead of named route objects.
| File | Line | Current | Should be |
|------|------|---------|-----------|
| `pages/account/routes.js` | 46 | `redirect: '/account/settings'` | `redirect: { name: 'user-settings-overview' }` |
| `pages/account/routes.js` | 81 | `redirect: '/account/security/password'` | `redirect: { name: '...' }` (see note below) |
| `pages/admin/routes.js` | 42 | `redirect: '/admin/overview'` | `redirect: { name: 'admin-overview' }` |
| `pages/admin/routes.js` | 59 | `redirect: '/admin/settings/general'` | `redirect: { name: 'admin-settings-general' }` |
## Note
The `password` child route under `user-settings-security` doesn't currently have a `name` property. A name will need to be added to that child route (something like `user-settings-security-password`) before the redirect can reference it.
Contributor guide
Research direction
Start with the four listed route definitions in pages/account/routes.js and pages/admin/routes.js, then inspect the password child route under user-settings-security to identify its existing structure. Replace the redirects with named route objects and add the missing password route name; done means all four redirects use names and the password redirect can reference its child route.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100