Replace relative path navigation in settings pages 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
11 settings page components use relative path strings like `{ replace: true, path: 'general' }` to redirect users who lack permissions back to a safe tab. These should use named routes instead.
All of these follow the same pattern in a `checkAccess` method:
```js
if (!this.hasPermission('project:edit', ...)) {
useRouter().push({ replace: true, path: 'general' })
}
```
### Instance Settings (9 files)
| File | Line | Path | Should be |
|------|------|------|-----------|
| `pages/instance/Settings/Danger.vue` | 198 | `'general'` | `{ name: 'instance-settings-general' }` |
| `pages/instance/Settings/Editor.vue` | 114 | `'general'` | `{ name: 'instance-settings-general' }` |
| `pages/instance/Settings/Security.vue` | 198 | `'general'` | `{ name: 'instance-settings-general' }` |
| `pages/instance/Settings/Palette.vue` | 166 | `'general'` | `{ name: 'instance-settings-general' }` |
| `pages/instance/Settings/HighAvailability.vue` | 108 | `'general'` | `{ name: 'instance-settings-general' }` |
| `pages/instance/Settings/Alerts.vue` | 116 | `'general'` | `{ name: 'instance-settings-general' }` |
| `pages/instance/Settings/ChangeInstanceType.vue` | 60 | `'general'` | `{ name: 'instance-settings-general' }` |
| `pages/instance/Settings/ProtectInstance.vue` | 96 | `'general'` | `{ name: 'instance-settings-general' }` |
| `pages/instance/Settings/LauncherSettings.vue` | 123 | `'general'` | `{ name: 'instance-settings-general' }` |
### Device Settings (1 file)
| File | Line | Path | Should be |
|------|------|------|-----------|
| `pages/device/Settings/index.vue` | 72 | `'overview'` | `{ name: 'device-overview' }` |
### Device Group Settings (1 file)
| File | Line | Path | Should be |
|------|------|------|-----------|
| `pages/application/DeviceGroup/Settings/index.vue` | 58 | `'overview'` | `{ name: 'application-device-group' }` |
Highly repetitive, same pattern in every file.
Contributor guide
Research direction
Start with the checkAccess methods in the 9 instance settings files, pages/device/Settings/index.vue, and pages/application/DeviceGroup/Settings/index.vue. Compare each redirect with the issue's route-name table. Done means all 11 relative path redirects use their specified named routes, with no listed case left unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100