feat(exercises): update to version 0.8.100 and enhance combination exercise handling
Deploy Development / deploy (push) Successful in 38s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / playwright-tests (push) Successful in 56s
Deploy Development / deploy (push) Successful in 38s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / playwright-tests (push) Successful in 56s
- Bumped app version to 0.8.100, reflecting recent updates. - Improved validation logic for combination exercises in the backend, ensuring proper handling of exercise variants. - Enhanced frontend components, including the ExercisePickerModal, to support filtering and displaying combination exercises. - Updated API payloads and utility functions to accommodate new exercise types and their properties. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
8a9f9f960f
commit
3dc4c9c79e
7 files changed
+162
-54
No files matched your search
@@ -32,6 +32,8 @@ export default function ExercisePickerModal({
|
||||
multiSelect = false,
|
||||
onSelectExercises = null,
|
||||
enableQuickCreateDraft = false,
|
||||
/** Wenn gesetzt: z. B. ['simple'] oder ['combination'] — sonst alle Übungsarten */
|
||||
exerciseKindAny = undefined,
|
||||
}) {
|
||||
const { user } = useAuth()
|
||||
const [catalogs, setCatalogs] = useState({
|
||||
@@ -213,8 +215,14 @@ export default function ExercisePickerModal({
|
||||
if (filters.include_archived) q.include_archived = true
|
||||
if (debouncedSearch) q.search = debouncedSearch
|
||||
if (debouncedAi) q.ai_search = debouncedAi
|
||||
if (
|
||||
Array.isArray(exerciseKindAny) &&
|
||||
exerciseKindAny.length > 0
|
||||
) {
|
||||
q.exercise_kind_any = exerciseKindAny
|
||||
}
|
||||
return q
|
||||
}, [filters, debouncedSearch, debouncedAi])
|
||||
}, [filters, debouncedSearch, debouncedAi, exerciseKindAny])
|
||||
|
||||
const reload = useCallback(async () => {
|
||||
if (!open || !catalogsReady) return
|
||||
@@ -225,7 +233,6 @@ export default function ExercisePickerModal({
|
||||
...queryBase,
|
||||
include_archived: true,
|
||||
include_variants: true,
|
||||
exercise_kind_any: ['simple'],
|
||||
limit: PAGE_SIZE,
|
||||
offset: 0,
|
||||
})
|
||||
@@ -254,7 +261,6 @@ export default function ExercisePickerModal({
|
||||
...queryBase,
|
||||
include_archived: true,
|
||||
include_variants: true,
|
||||
exercise_kind_any: ['simple'],
|
||||
limit: PAGE_SIZE,
|
||||
offset,
|
||||
})
|
||||
@@ -608,6 +614,19 @@ export default function ExercisePickerModal({
|
||||
{ex.focus_area}
|
||||
</span>
|
||||
)}
|
||||
{(ex.exercise_kind || '').toLowerCase().trim() === 'combination' ? (
|
||||
<span
|
||||
className="exercise-tag"
|
||||
style={{
|
||||
marginTop: 6,
|
||||
marginLeft: 6,
|
||||
background: 'var(--accent-soft)',
|
||||
color: 'var(--accent-dark)',
|
||||
}}
|
||||
>
|
||||
Kombination
|
||||
</span>
|
||||
) : null}
|
||||
</>
|
||||
)
|
||||
if (multiSelect) {
|
||||
|
||||
@@ -1055,7 +1055,12 @@ export default function ExerciseProgressionGraphPanel({
|
||||
</div>
|
||||
)}
|
||||
|
||||
<ExercisePickerModal open={pickerOpen} onClose={() => setPickContext(null)} onSelectExercise={applyPickedExercise} />
|
||||
<ExercisePickerModal
|
||||
open={pickerOpen}
|
||||
onClose={() => setPickContext(null)}
|
||||
onSelectExercise={applyPickedExercise}
|
||||
exerciseKindAny={['simple']}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -837,9 +837,11 @@ export default function TrainingUnitSectionsEditor({
|
||||
const variantOpts = Array.isArray(it.variants) ? it.variants : []
|
||||
const exTitle =
|
||||
it.exercise_title || (it.exercise_id ? `Übung #${it.exercise_id}` : '')
|
||||
const isCombination =
|
||||
String(it.exercise_kind || 'simple').toLowerCase().trim() === 'combination'
|
||||
const annotPrev = truncatePreview(it.notes || '', 220)
|
||||
const annotHasText = Boolean((it.notes || '').trim())
|
||||
const hasVariants = variantOpts.length > 0 && it.exercise_id
|
||||
const hasVariants = !isCombination && variantOpts.length > 0 && it.exercise_id
|
||||
const variantIdPeek =
|
||||
it.exercise_variant_id === '' || it.exercise_variant_id == null
|
||||
? undefined
|
||||
@@ -893,6 +895,20 @@ export default function TrainingUnitSectionsEditor({
|
||||
) : (
|
||||
<span className="tu-ex-title-placeholder">Keine Übung gewählt</span>
|
||||
)}
|
||||
{isCombination ? (
|
||||
<span
|
||||
className="exercise-tag"
|
||||
style={{
|
||||
marginLeft: 8,
|
||||
fontSize: '11px',
|
||||
alignSelf: 'center',
|
||||
background: 'var(--accent-soft)',
|
||||
color: 'var(--accent-dark)',
|
||||
}}
|
||||
>
|
||||
Kombination
|
||||
</span>
|
||||
) : null}
|
||||
{planningCompactLegend && curMn ? (
|
||||
<PlanningModuleRowTag moduleId={curMn} title={modBandTitle} />
|
||||
) : null}
|
||||
|
||||
Reference in new issue
Block a user