Replace string-based redirects in route definitions with named routes

Open Beginner friendly
#8,095 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Quiet
Tech stack
javascript
Domain
frontend

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.

Description

area:frontend size:XS type:enhancement

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.

Dominant language
JavaScript
Stars
400
Forks
89
Avg merge
1d 22h
Merged PRs (30d)
147

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FlowFuse/flowfuse

All issues in FlowFuse/flowfuse

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.