fix(help): show the settings help on the admin Security and Services tabs

Both tabs fell back to the admin overview without guides, and the guides for API keys, providers and file types opened the Security tab instead of Services.
This commit is contained in:
Maurice
2026-11-23 15:01:44 +01:00
parent e459ec6e60
commit dec3058777
7 changed files with 44 additions and 10 deletions
@@ -27,4 +27,12 @@ describe('HelpGuideView: links', () => {
expect(screen.queryByRole('link', { name: /Open Appearance settings/ })).toBeNull()
expect(screen.getByRole('link', { name: /Open in Help & Docs/ })).toHaveAttribute('href', '/help/My-Trips-Dashboard#per-trip-actions')
})
it('takes an admin guide to the tab its settings sit under', () => {
const { unmount } = render(<HelpGuideView guide={getHelpGuide('instance-keys')!} />)
expect(screen.getByRole('link', { name: /^Go to/ })).toHaveAttribute('href', '/admin?tab=services')
unmount()
render(<HelpGuideView guide={getHelpGuide('auth-methods')!} />)
expect(screen.getByRole('link', { name: /^Go to/ })).toHaveAttribute('href', '/admin?tab=settings')
})
})
+1 -1
View File
@@ -38,7 +38,7 @@ export default function HelpGuideView({ guide }: { guide: HelpGuide }): React.Re
const related = (guide.related ?? []).map(getHelpGuide).filter((g): g is HelpGuide => g !== null)
const Icon = helpIcon(guide.icon)
const ScreenIcon = screen ? helpIcon(screen.icon) : Icon
const screenRoute = useScreenRoute(screen?.route)
const screenRoute = useScreenRoute(guide.route ?? screen?.route)
return (
<div className="trek-help-view flex flex-col gap-6">