Implement Phase 3 Features for Skill Profiles and Discovery
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 38s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m27s

- Updated the framework program documentation to reflect the completion of Phase 3 v1.0, including new skill scoring and API enhancements.
- Added new API endpoints for skill profile retrieval and suggestions, improving the ability to aggregate and display skills based on training data.
- Introduced new UI components for skill profiles and discovery in the frontend, enhancing user interaction with training frameworks and skills.
- Updated version information to 0.8.151, reflecting the addition of skill profiles and related features.
This commit is contained in:
Lars committed 2026-05-20 16:42:25 +02:00
1 parent e382b6ed35
commit 732b322c52
16 files changed
+1626 -17

No files matched your search

+4
View File
@@ -2,10 +2,12 @@ import React, { useState, useEffect } from 'react'
import api from '../utils/api'
import { useAuth } from '../context/AuthContext'
import PageSectionNav from '../components/PageSectionNav'
import SkillDiscoveryPanel from '../components/skills/SkillDiscoveryPanel'
const SKILLS_SECTION_TABS = [
{ id: 'skills', label: 'Fähigkeiten' },
{ id: 'methods', label: 'Trainingsmethoden' },
{ id: 'discovery', label: 'Planungs-Vorschläge' },
]
function SkillsPage() {
@@ -243,6 +245,8 @@ function SkillsPage() {
</>
)}
{activeTab === 'discovery' && <SkillDiscoveryPanel skills={skills} />}
{/* Methods Tab */}
{activeTab === 'methods' && (
<>
@@ -6,6 +6,7 @@ import ExercisePeekModal from '../components/ExercisePeekModal'
import TrainingUnitSectionsEditor from '../components/TrainingUnitSectionsEditor'
import PageSectionNav from '../components/PageSectionNav'
import PageFormEditorChrome from '../components/PageFormEditorChrome'
import SkillProfilePanel from '../components/skills/SkillProfilePanel'
import { useToast } from '../context/ToastContext'
import { useNavReturn } from '../hooks/useNavReturn'
import {
@@ -248,6 +249,10 @@ export default function TrainingFrameworkProgramEditPage() {
)
/** Schmale Ansicht: welcher Session-Slot gerade die volle Breite nutzt (Chip-Navigation) */
const [mobileSlotIdx, setMobileSlotIdx] = useState(0)
const [skillProfileData, setSkillProfileData] = useState(null)
const [skillProfileLoading, setSkillProfileLoading] = useState(false)
const [skillProfileError, setSkillProfileError] = useState('')
const [skillProfileTick, setSkillProfileTick] = useState(0)
const toast = useToast()
const baselineRef = useRef(null)
@@ -301,6 +306,32 @@ export default function TrainingFrameworkProgramEditPage() {
return () => document.removeEventListener('pointerdown', onPointerDown, true)
}, [])
useEffect(() => {
if (isNew || !idParam) {
setSkillProfileData(null)
return undefined
}
let cancelled = false
;(async () => {
setSkillProfileLoading(true)
setSkillProfileError('')
try {
const data = await api.getFrameworkProgramSkillProfile(idParam)
if (!cancelled) setSkillProfileData(data)
} catch (e) {
if (!cancelled) {
setSkillProfileData(null)
setSkillProfileError(e.message || 'Fähigkeiten-Profil nicht geladen')
}
} finally {
if (!cancelled) setSkillProfileLoading(false)
}
})()
return () => {
cancelled = true
}
}, [isNew, idParam, skillProfileTick])
const loadMeta = useCallback(async () => {
try {
const [cl, fa, sd, tt, tg] = await Promise.all([
@@ -480,6 +511,7 @@ export default function TrainingFrameworkProgramEditPage() {
setBypassDirty(false)
setBaselineReady(true)
toast.success('Gespeichert.')
setSkillProfileTick((t) => t + 1)
if (closeAfter) goBack()
return true
} catch (e) {
@@ -940,6 +972,17 @@ export default function TrainingFrameworkProgramEditPage() {
/>
</div>
{!isNew ? (
<SkillProfilePanel
title="Fähigkeiten-Schwerpunkte (aus Übungen)"
hint="Gewichtung nach geplanter Dauer, Häufigkeit der Übung im Programm, Primär-Fähigkeit und Intensität. Vergleichbar mit manuell gesetzten Fokusbereichen in den Stammdaten."
profile={skillProfileData?.overall}
slots={skillProfileData?.slots}
loading={skillProfileLoading}
error={skillProfileError}
/>
) : null}
<div
className={
'framework-edit__panel framework-edit__panel--meta card' +
@@ -3,6 +3,7 @@ import { useLocation, useNavigate, useParams } from 'react-router-dom'
import api from '../utils/api'
import ExercisePickerModal from '../components/ExercisePickerModal'
import FormActionBar from '../components/FormActionBar'
import SkillProfilePanel from '../components/skills/SkillProfilePanel'
import { hydrateExercisePlanningRow } from '../utils/trainingUnitSectionsForm'
import { useAuth } from '../context/AuthContext'
import { useToast } from '../context/ToastContext'
@@ -76,6 +77,10 @@ export default function TrainingModuleEditPage() {
const [methods, setMethods] = useState([])
const [pickerOpen, setPickerOpen] = useState(false)
const [error, setError] = useState('')
const [skillProfileData, setSkillProfileData] = useState(null)
const [skillProfileLoading, setSkillProfileLoading] = useState(false)
const [skillProfileError, setSkillProfileError] = useState('')
const [skillProfileTick, setSkillProfileTick] = useState(0)
const [title, setTitle] = useState('')
const [summary, setSummary] = useState('')
@@ -130,6 +135,32 @@ export default function TrainingModuleEditPage() {
const blocker = useUnsavedChangesBlocker(Boolean(formDirtyEffective && !saving))
useBeforeUnloadWhen(Boolean(formDirtyEffective && !saving))
useEffect(() => {
if (isNew || !Number.isFinite(moduleId)) {
setSkillProfileData(null)
return undefined
}
let cancelled = false
;(async () => {
setSkillProfileLoading(true)
setSkillProfileError('')
try {
const data = await api.getTrainingModuleSkillProfile(moduleId)
if (!cancelled) setSkillProfileData(data)
} catch (e) {
if (!cancelled) {
setSkillProfileData(null)
setSkillProfileError(e.message || 'Fähigkeiten-Profil nicht geladen')
}
} finally {
if (!cancelled) setSkillProfileLoading(false)
}
})()
return () => {
cancelled = true
}
}, [isNew, moduleId, skillProfileTick])
const { user } = useAuth()
const isPlatformAdmin = user?.role === 'admin' || user?.role === 'superadmin'
const tenantClubDepKey = useMemo(() => getTenantClubDependencyKey(user), [user])
@@ -339,6 +370,7 @@ export default function TrainingModuleEditPage() {
baselineRef.current = moduleFormSnapshot(latestFormRef.current)
setBypassDirty(false)
toast.success('Gespeichert.')
setSkillProfileTick((t) => t + 1)
if (closeAfter) goBack()
return true
} catch (err) {
@@ -391,6 +423,14 @@ export default function TrainingModuleEditPage() {
onSubmit={handleSave}
>
<div className="page-form-shell__scroll">
{!isNew ? (
<SkillProfilePanel
title="Fähigkeiten im Modul"
profile={skillProfileData?.overall}
loading={skillProfileLoading}
error={skillProfileError}
/>
) : null}
<div className="form-row">
<label className="form-label">Titel *</label>
<input className="form-input" value={title} onChange={(e) => setTitle(e.target.value)} />