chore(version): update version and changelog for release 0.8.140
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 37s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m8s
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 37s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m8s
- Bumped APP_VERSION to 0.8.140 and updated the changelog to reflect recent changes. - Enhanced the Training Planning Module with new controls for managing whole group and parallel phases, including the ability to add streams to existing parallel phases. - Introduced utility functions for handling phase and stream configurations, improving the overall structure and usability of the training unit sections editor. - Updated the TrainingPlanningUnitFormModal to support the new phase controls, ensuring seamless integration with the frontend components.
This commit is contained in:
1 parent
749c185e3d
commit
f50e9db523
4 files changed
+256
-2
No files matched your search
@@ -5,6 +5,87 @@ export function defaultSection(title = 'Hauptteil') {
|
||||
return { title, guidance_notes: '', items: [] }
|
||||
}
|
||||
|
||||
/** Standard-`planLoc` für eine Ganzgruppen-Phase (Editor-Breakout-UI). */
|
||||
export function defaultPlanLocWholeGroup(phaseOrderIndex = 0) {
|
||||
return {
|
||||
phaseKind: 'whole_group',
|
||||
phaseOrderIndex,
|
||||
parallelStreamOrderIndex: null,
|
||||
phaseTitle: null,
|
||||
phaseGuidanceNotes: null,
|
||||
streamTitle: null,
|
||||
streamNotes: null,
|
||||
streamAssignedTrainerProfileIds: null,
|
||||
}
|
||||
}
|
||||
|
||||
/** Standard-`planLoc` für einen Stream innerhalb einer parallelen Phase. */
|
||||
export function defaultPlanLocParallel(phaseOrderIndex, streamOrderIndex) {
|
||||
return {
|
||||
phaseKind: 'parallel',
|
||||
phaseOrderIndex,
|
||||
parallelStreamOrderIndex: streamOrderIndex,
|
||||
phaseTitle: null,
|
||||
phaseGuidanceNotes: null,
|
||||
streamTitle: null,
|
||||
streamNotes: null,
|
||||
streamAssignedTrainerProfileIds: null,
|
||||
}
|
||||
}
|
||||
|
||||
export function planLocKey(pl) {
|
||||
if (!pl || !pl.phaseKind) return ''
|
||||
if (pl.phaseKind === 'whole_group') return `wg:${pl.phaseOrderIndex ?? 0}`
|
||||
return `par:${pl.phaseOrderIndex ?? 0}:${pl.parallelStreamOrderIndex ?? 0}`
|
||||
}
|
||||
|
||||
export function maxPhaseOrderIndexFromSections(sections) {
|
||||
let m = -1
|
||||
for (const s of sections || []) {
|
||||
const pl = s?.planLoc
|
||||
if (!pl || typeof pl.phaseOrderIndex !== 'number') continue
|
||||
if (pl.phaseOrderIndex > m) m = pl.phaseOrderIndex
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
/**
|
||||
* Eindeutige Ziele für die Zuordnung eines Abschnitts (Dropdown).
|
||||
* `template` ist ein vollständiges planLoc-Objekt zum Kopieren.
|
||||
*/
|
||||
export function buildPlanTargetOptions(sections) {
|
||||
const map = new Map()
|
||||
for (const s of sections || []) {
|
||||
const pl = s?.planLoc
|
||||
if (!pl?.phaseKind) continue
|
||||
if (pl.phaseKind === 'whole_group') {
|
||||
const po = pl.phaseOrderIndex ?? 0
|
||||
const k = `wg:${po}`
|
||||
if (!map.has(k)) {
|
||||
const title = pl.phaseTitle != null && String(pl.phaseTitle).trim() ? String(pl.phaseTitle).trim() : ''
|
||||
map.set(k, {
|
||||
key: k,
|
||||
label: title || `Ganzgruppe · Phase ${po}`,
|
||||
template: { ...pl },
|
||||
})
|
||||
}
|
||||
} else {
|
||||
const po = pl.phaseOrderIndex ?? 0
|
||||
const so = pl.parallelStreamOrderIndex ?? 0
|
||||
const k = `par:${po}:${so}`
|
||||
if (!map.has(k)) {
|
||||
const st = pl.streamTitle != null && String(pl.streamTitle).trim() ? String(pl.streamTitle).trim() : ''
|
||||
map.set(k, {
|
||||
key: k,
|
||||
label: st || `Parallel · Phase ${po} · Stream ${so}`,
|
||||
template: { ...pl },
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
return [...map.values()].sort((a, b) => a.key.localeCompare(b.key, undefined, { numeric: true }))
|
||||
}
|
||||
|
||||
function normalizeCatalogMethodProfile(cp) {
|
||||
if (cp && typeof cp === 'object' && !Array.isArray(cp)) return { ...cp }
|
||||
return {}
|
||||
|
||||
Reference in new issue
Block a user