chore(version): update version and changelog for release 0.8.139
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 37s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m11s

- Bumped APP_VERSION to 0.8.139 and updated the changelog to reflect recent changes.
- Enhanced the Training Planning Module to support new phase handling, including improved labeling for sections in the editor.
- Updated the API payload structure to accommodate parallel streams and phases, ensuring better integration with the frontend components.
- Refactored utility functions for improved clarity and maintainability in handling training unit sections and phases.
This commit is contained in:
Lars committed 2026-05-15 07:12:43 +02:00
1 parent 214f90d39b
commit 749c185e3d
4 files changed
+254 -67

No files matched your search

@@ -5,6 +5,18 @@ import { trainingVisibilityShortDE } from '../../utils/trainingPlanningPageHelpe
/**
* Dialog: Trainingsmodul in die Abschnitte einer Einheit einfügen (Bibliothekskopie).
*/
function formatModuleApplySectionOptionLabel(section, flatIndex) {
const title = (section?.title || '').trim() || `Abschnitt ${flatIndex + 1}`
const pl = section?.planLoc
if (pl?.phaseKind === 'parallel') {
const st = (pl.streamTitle || '').trim()
const streamHint = st ? ` — ${st}` : ''
return `${title}${streamHint} (Phase ${pl.phaseOrderIndex ?? 0}, Stream ${pl.parallelStreamOrderIndex ?? 0})`
}
return title
}
export default function TrainingPlanningModuleApplyModal({
open,
busy,
@@ -101,7 +113,7 @@ export default function TrainingPlanningModuleApplyModal({
>
{(sections || []).map((s, i) => (
<option key={`sec-opt-u-${i}`} value={String(i)}>
{(s.title || `Abschnitt ${i + 1}`).trim()}
{formatModuleApplySectionOptionLabel(s, i)}
</option>
))}
</select>
@@ -148,7 +160,7 @@ export default function TrainingPlanningModuleApplyModal({
>
{(sections || []).map((s, i) => (
<option key={`sec-opt-${i}`} value={String(i)}>
{(s.title || `Abschnitt ${i + 1}`).trim()}
{formatModuleApplySectionOptionLabel(s, i)}
</option>
))}
</select>
@@ -11,13 +11,12 @@ import TrainingPlanningFrameworkImportModal from './TrainingPlanningFrameworkImp
import TrainingPlanningModuleApplyModal from './TrainingPlanningModuleApplyModal'
import TrainingPlanningTrainerAssignModal from './TrainingPlanningTrainerAssignModal'
import TrainingPlanningUnitFormModal from './TrainingPlanningUnitFormModal'
/* Parallele Trainingsstreams (Breakout): Planungs-API bleibt flache sections/items bis Schema-Paket 1–2;
Payload-Aufbau → buildSectionsPayload (trainingUnitSectionsForm); Backend _replace_unit_sections. */
/* Parallele Streams: Editor bleibt flache Abschnittsliste; `planLoc` pro Abschnitt steuert PUT `phases` vs. Legacy `sections`. */
import {
defaultSection,
normalizeUnitToForm,
enrichSectionsWithVariants,
buildSectionsPayload,
buildPlanPayloadForSave,
hydrateExercisePlanningRow,
insertTrainingModuleIntoPlanningSections,
} from '../../utils/trainingUnitSectionsForm'
@@ -959,7 +958,7 @@ function TrainingPlanningPageRoot() {
return
}
try {
const sectionsPayload = buildSectionsPayload(formData.sections)
const planPart = buildPlanPayloadForSave(formData.sections)
const payload = {
planned_date: formData.planned_date,
planned_time_start: formData.planned_time_start || null,
@@ -972,7 +971,7 @@ function TrainingPlanningPageRoot() {
status: formData.status || 'planned',
notes: formData.notes || null,
trainer_notes: formData.trainer_notes || null,
sections: sectionsPayload
...planPart,
}
if (editingUnit) {
payload.debrief_completed =