feat: update capability levels and enhance exercise filtering
- 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:
1 parent
c6d20e4dec
commit
76098f5244
8 files changed
+418
-56
No files matched your search
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'
|
||||
import { useNavigate, useParams } from 'react-router-dom'
|
||||
import api, { buildExerciseApiPayload } from '../utils/api'
|
||||
import RichTextEditor from '../components/RichTextEditor'
|
||||
import { SKILL_LEVEL_OPTIONS, normalizeSkillLevelSlug } from '../constants/skillLevels'
|
||||
|
||||
const INTENSITY_OPTIONS = [
|
||||
{ value: '', label: '—' },
|
||||
@@ -10,15 +11,6 @@ const INTENSITY_OPTIONS = [
|
||||
{ value: 'hoch', label: 'hoch' },
|
||||
]
|
||||
|
||||
const LEVEL_OPTIONS = [
|
||||
{ value: '', label: '—' },
|
||||
{ value: 'einsteiger', label: 'Einsteiger' },
|
||||
{ value: 'grundlagen', label: 'Grundlagen' },
|
||||
{ value: 'aufbau', label: 'Aufbau' },
|
||||
{ value: 'fortgeschritten', label: 'Fortgeschritten' },
|
||||
{ value: 'experte', label: 'Experte' },
|
||||
]
|
||||
|
||||
function emptyForm() {
|
||||
return {
|
||||
title: '',
|
||||
@@ -78,8 +70,8 @@ function detailToForm(exercise) {
|
||||
skill_id: s.skill_id,
|
||||
is_primary: s.is_primary || false,
|
||||
intensity: s.intensity || '',
|
||||
required_level: s.required_level || '',
|
||||
target_level: s.target_level || '',
|
||||
required_level: normalizeSkillLevelSlug(s.required_level),
|
||||
target_level: normalizeSkillLevelSlug(s.target_level),
|
||||
})) || [],
|
||||
}
|
||||
}
|
||||
@@ -636,7 +628,7 @@ function ExerciseFormPage() {
|
||||
value={row.required_level || ''}
|
||||
onChange={(e) => updateSkillField(idx, 'required_level', e.target.value)}
|
||||
>
|
||||
{LEVEL_OPTIONS.map((o) => (
|
||||
{SKILL_LEVEL_OPTIONS.map((o) => (
|
||||
<option key={`r-${o.value}`} value={o.value}>
|
||||
von {o.label}
|
||||
</option>
|
||||
@@ -647,7 +639,7 @@ function ExerciseFormPage() {
|
||||
value={row.target_level || ''}
|
||||
onChange={(e) => updateSkillField(idx, 'target_level', e.target.value)}
|
||||
>
|
||||
{LEVEL_OPTIONS.map((o) => (
|
||||
{SKILL_LEVEL_OPTIONS.map((o) => (
|
||||
<option key={`t-${o.value}`} value={o.value}>
|
||||
bis {o.label}
|
||||
</option>
|
||||
|
||||
Reference in new issue
Block a user