feat(exercise): add support for exercise variants in ExerciseFullContent and related components
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 10s
Test Suite / playwright-tests (push) Successful in 55s
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 10s
Test Suite / playwright-tests (push) Successful in 55s
- Updated ExerciseFullContent to accept a new `variantId` prop and display variant-specific information. - Enhanced TrainingCoachPage to pass `variantId` when rendering ExerciseFullContent. - Refactored TrainingUnitRunPage to manage exercise context with variant support, including updates to modal handling. - Improved UI to show variant details, including name, description, and execution changes where applicable.
This commit is contained in:
1 parent
1ce6d929ce
commit
fb8837574e
3 files changed
+49
-8
No files matched your search
@@ -400,7 +400,7 @@ export default function TrainingCoachPage() {
|
||||
return () => {
|
||||
cancelled = true
|
||||
}
|
||||
}, [step, currentEntry?.item?.exercise_id, currentEntry?.item?.item_type])
|
||||
}, [step, currentEntry?.item?.exercise_id, currentEntry?.item?.exercise_variant_id, currentEntry?.item?.item_type])
|
||||
|
||||
const handleSaveDebrief = async () => {
|
||||
setSaveOk(null)
|
||||
@@ -739,6 +739,7 @@ export default function TrainingCoachPage() {
|
||||
error={catalogError}
|
||||
exercise={catalogExercise}
|
||||
exerciseId={currentEntry?.item?.exercise_id ?? null}
|
||||
variantId={currentEntry?.item?.exercise_variant_id ?? null}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function TrainingUnitRunPage() {
|
||||
const [loadError, setLoadError] = useState(null)
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [checked, setChecked] = useState(() => new Set())
|
||||
const [peekExerciseId, setPeekExerciseId] = useState(null)
|
||||
const [peekCtx, setPeekCtx] = useState(null)
|
||||
|
||||
const loadChecked = useCallback((uid) => {
|
||||
try {
|
||||
@@ -143,9 +143,10 @@ export default function TrainingUnitRunPage() {
|
||||
return (
|
||||
<div className="training-run-page app-page" style={{ paddingBottom: '2rem' }}>
|
||||
<ExercisePeekModal
|
||||
open={peekExerciseId != null}
|
||||
exerciseId={peekExerciseId}
|
||||
onClose={() => setPeekExerciseId(null)}
|
||||
open={peekCtx != null}
|
||||
exerciseId={peekCtx?.exerciseId}
|
||||
variantId={peekCtx?.variantId ?? undefined}
|
||||
onClose={() => setPeekCtx(null)}
|
||||
/>
|
||||
|
||||
<nav className="training-run-toolbar no-print" style={{ marginBottom: '1rem', display: 'flex', gap: '0.5rem', flexWrap: 'wrap', alignItems: 'center' }}>
|
||||
@@ -314,7 +315,12 @@ export default function TrainingUnitRunPage() {
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
style={{ fontSize: '0.82rem', margin: 0 }}
|
||||
onClick={() => setPeekExerciseId(it.exercise_id)}
|
||||
onClick={() =>
|
||||
setPeekCtx({
|
||||
exerciseId: it.exercise_id,
|
||||
variantId: it.exercise_variant_id != null ? Number(it.exercise_variant_id) : null,
|
||||
})
|
||||
}
|
||||
>
|
||||
Katalog (Popup)
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user