feat: external Learning Hub toggle + applicant help button
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m52s

- Add admin settings: learning_hub_external, learning_hub_external_url, support_email
- Jury/Mentor nav respects external Learning Hub URL (opens in new tab)
- RoleNav supports external nav items with ExternalLink icon
- Applicant header shows Help button with configurable support email
- Settings update mutation now upserts (creates on first use)
- Shared inferSettingCategory for consistent category assignment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-03 23:09:29 +01:00
parent 924f8071e1
commit 1d4e31ddd1
6 changed files with 160 additions and 43 deletions

View File

@@ -123,6 +123,9 @@ export function SettingsContent({ initialSettings, isSuperAdmin = true }: Settin
'default_page_size',
'autosave_interval_seconds',
'display_project_names_uppercase',
'learning_hub_external',
'learning_hub_external_url',
'support_email',
])
const digestSettings = getSettingsByKeys([
@@ -432,7 +435,7 @@ export function SettingsContent({ initialSettings, isSuperAdmin = true }: Settin
</TabsContent>
)}
<TabsContent value="defaults">
<TabsContent value="defaults" className="space-y-6">
<AnimatedCard>
<Card>
<CardHeader>
@@ -446,6 +449,20 @@ export function SettingsContent({ initialSettings, isSuperAdmin = true }: Settin
</CardContent>
</Card>
</AnimatedCard>
<AnimatedCard>
<Card>
<CardHeader>
<CardTitle>Platform Features</CardTitle>
<CardDescription>
Configure Learning Hub, support contact, and other platform features
</CardDescription>
</CardHeader>
<CardContent>
<PlatformFeaturesSection settings={defaultsSettings} />
</CardContent>
</Card>
</AnimatedCard>
</TabsContent>
<TabsContent value="digest" className="space-y-6">
@@ -805,6 +822,37 @@ function AuditSettingsSection({ settings }: { settings: Record<string, string> }
)
}
function PlatformFeaturesSection({ settings }: { settings: Record<string, string> }) {
return (
<div className="space-y-6">
<div className="space-y-4">
<Label className="text-sm font-medium">Learning Hub</Label>
<SettingToggle
label="Use External Learning Hub"
description="When enabled, jury and mentor navigation links will open the external URL instead of the built-in Learning Hub"
settingKey="learning_hub_external"
value={settings.learning_hub_external || 'false'}
/>
<SettingInput
label="External URL"
description="The URL to redirect jury and mentor users to (e.g. Google Drive, Notion, etc.)"
settingKey="learning_hub_external_url"
value={settings.learning_hub_external_url || ''}
/>
</div>
<div className="border-t pt-4 space-y-4">
<Label className="text-sm font-medium">Support</Label>
<SettingInput
label="Support Email"
description="Shown as a help button on the applicant page header. Leave empty to hide."
settingKey="support_email"
value={settings.support_email || ''}
/>
</div>
</div>
)
}
function WhatsAppSettingsSection({ settings }: { settings: Record<string, string> }) {
return (
<div className="space-y-4">