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 { Link, useNavigate, useParams } from 'react-router-dom'
|
||||
import api from '../utils/api'
|
||||
import { sanitizeTrainerHtml } from '../utils/htmlUtils'
|
||||
import { formatSkillLevelSlug } from '../constants/skillLevels'
|
||||
|
||||
const API_BASE = (import.meta.env.VITE_API_URL || '').replace(/\/$/, '')
|
||||
|
||||
@@ -242,15 +243,19 @@ function ExerciseDetailPage() {
|
||||
<section className="card exercise-detail-section">
|
||||
<h2>Fähigkeiten</h2>
|
||||
<div className="exercise-tag-row">
|
||||
{exercise.skills.map((s) => (
|
||||
<span key={s.id} className={`exercise-tag${s.is_primary ? ' exercise-tag--accent' : ''}`}>
|
||||
{s.skill_name}
|
||||
{s.intensity ? ` · ${s.intensity}` : ''}
|
||||
{s.required_level || s.target_level
|
||||
? ` (${[s.required_level, s.target_level].filter(Boolean).join(' → ')})`
|
||||
: ''}
|
||||
</span>
|
||||
))}
|
||||
{exercise.skills.map((s) => {
|
||||
const rl = formatSkillLevelSlug(s.required_level)
|
||||
const tl = formatSkillLevelSlug(s.target_level)
|
||||
const lvl =
|
||||
rl || tl ? ` (${[rl, tl].filter(Boolean).join(' → ')})` : ''
|
||||
return (
|
||||
<span key={s.id} className={`exercise-tag${s.is_primary ? ' exercise-tag--accent' : ''}`}>
|
||||
{s.skill_name}
|
||||
{s.intensity ? ` · ${s.intensity}` : ''}
|
||||
{lvl}
|
||||
</span>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user