mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-25 14:17:31 +00:00
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:
@@ -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')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user