feat: update capability levels and enhance exercise filtering
Deploy Development / deploy (push) Successful in 36s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 5s
Test Suite / playwright-tests (push) Failing after 1m55s

- Updated capability level mappings in the backend to reflect new terminology (e.g., "einsteiger" to "basis" and "experte" to "optimierung").
- Refactored the exercise management logic to normalize skill levels using canonical slugs, improving consistency across the application.
- Enhanced the ExercisesListPage with additional filtering options for style direction, training type, and target group, along with AI search capabilities.
- Incremented application version to 0.7.7 and updated changelog to document these changes.
This commit is contained in:
Lars committed 2026-04-27 18:25:23 +02:00
1 parent c6d20e4dec
commit 76098f5244
8 files changed
+418 -56

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
/** Kanonische Übungs-Fähigkeitsstufen 1–5 (Slug → Anzeige) */
export const SKILL_LEVEL_OPTIONS = [
{ value: '', label: '—', level: null },
{ value: 'basis', label: '1 · Basis', level: 1 },
{ value: 'grundlagen', label: '2 · Grundlagen', level: 2 },
{ value: 'aufbau', label: '3 · Aufbau', level: 3 },
{ value: 'fortgeschritten', label: '4 · Fortgeschritten', level: 4 },
{ value: 'optimierung', label: '5 · Optimierung', level: 5 },
]
const LEGACY_MAP = {
einsteiger: 'basis',
experte: 'optimierung',
'1': 'basis',
'2': 'grundlagen',
'3': 'aufbau',
'4': 'fortgeschritten',
'5': 'optimierung',
}
const LABEL_BY_SLUG = Object.fromEntries(
SKILL_LEVEL_OPTIONS.filter((o) => o.value).map((o) => [o.value, o.label])
)
export function normalizeSkillLevelSlug(raw) {
if (raw == null || raw === '') return ''
const s = String(raw).trim().toLowerCase()
if (LEGACY_MAP[s]) return LEGACY_MAP[s]
if (LABEL_BY_SLUG[s]) return s
return ''
}
export function formatSkillLevelSlug(raw) {
const slug = normalizeSkillLevelSlug(raw)
if (!slug) return ''
return LABEL_BY_SLUG[slug] || slug
}