feat(version): bump to 0.8.105 and enhance combination exercise features
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 11s
Test Suite / playwright-tests (push) Successful in 56s
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 11s
Test Suite / playwright-tests (push) Successful in 56s
- Updated app version to 0.8.105, reflecting recent improvements in combination exercise handling. - Added support for per-slot timing options in the CombinationMethodProfileEditor, allowing for more flexible exercise configurations. - Enhanced the ExerciseFormPage to manage combination slots more effectively, including new functions for reordering and merging exercises. - Updated changelog to document the latest changes and improvements. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
435da7f17a
commit
ce63d46cf4
5 files changed
+466
-125
No files matched your search
+39
-13
@@ -507,28 +507,54 @@ export function buildExerciseApiPayload(formData, extras = {}) {
|
||||
|
||||
const slotRows = Array.isArray(formData.combination_slots) ? formData.combination_slots : []
|
||||
const combination_slots = []
|
||||
|
||||
function parseTimingField(raw) {
|
||||
if (raw === '' || raw == null || raw === undefined) return undefined
|
||||
const n = parseInt(String(raw), 10)
|
||||
return Number.isFinite(n) ? n : undefined
|
||||
}
|
||||
|
||||
for (let i = 0; i < slotRows.length; i += 1) {
|
||||
const row = slotRows[i] || {}
|
||||
const ix =
|
||||
row.slot_index === '' || row.slot_index == null ? i : parseInt(row.slot_index, 10)
|
||||
if (Number.isNaN(ix) || ix < 0 || ix > 99) {
|
||||
throw new Error(`Station Index ungültig (Zeile ${i + 1}).`)
|
||||
let ids = Array.isArray(row.candidate_exercise_ids)
|
||||
? row.candidate_exercise_ids.map((x) => Number(x)).filter((n) => Number.isFinite(n))
|
||||
: []
|
||||
|
||||
/** Legacy: noch idsText Unterstützung für Import von älteren FormStand */
|
||||
if ((!ids || ids.length === 0) && typeof row.idsText === 'string' && row.idsText.trim()) {
|
||||
ids = row.idsText
|
||||
.split(/[\s,;]+/)
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean)
|
||||
.map((s) => parseInt(s, 10))
|
||||
.filter((n) => Number.isFinite(n))
|
||||
}
|
||||
const idsText = typeof row.idsText === 'string' ? row.idsText : ''
|
||||
const candidate_exercise_ids = idsText
|
||||
.split(/[\s,;]+/)
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean)
|
||||
.map((s) => parseInt(s, 10))
|
||||
.filter((n) => Number.isFinite(n))
|
||||
|
||||
combination_slots.push({
|
||||
slot_index: ix,
|
||||
slot_index: i,
|
||||
title: (typeof row.title === 'string' && row.title.trim()) || null,
|
||||
candidate_exercise_ids,
|
||||
candidate_exercise_ids: ids,
|
||||
})
|
||||
}
|
||||
|
||||
const slot_profiles_v1_next = []
|
||||
for (let i = 0; i < slotRows.length; i += 1) {
|
||||
const row = slotRows[i] || {}
|
||||
const o = { slot_index: i }
|
||||
const load = parseTimingField(row.load_sec)
|
||||
const crs = parseTimingField(row.consecutive_reps)
|
||||
const intra = parseTimingField(row.intra_rep_rest_sec)
|
||||
const tran = parseTimingField(row.transition_after_sec)
|
||||
if (load !== undefined && load >= 0) o.load_sec = Math.round(load)
|
||||
if (crs !== undefined && crs >= 1) o.consecutive_reps = Math.round(crs)
|
||||
if (intra !== undefined && intra >= 0) o.intra_rep_rest_sec = Math.round(intra)
|
||||
if (tran !== undefined && tran >= 0) o.transition_after_sec = Math.round(tran)
|
||||
if (Object.keys(o).length > 1) slot_profiles_v1_next.push(o)
|
||||
}
|
||||
|
||||
payload.method_archetype = (formData.method_archetype || '').trim() || null
|
||||
if (slot_profiles_v1_next.length > 0) mpObj.slot_profiles_v1 = slot_profiles_v1_next
|
||||
else delete mpObj.slot_profiles_v1
|
||||
payload.method_profile = mpObj
|
||||
payload.combination_slots = combination_slots
|
||||
} else {
|
||||
|
||||
@@ -21,6 +21,13 @@ function parseProfileJson(raw) {
|
||||
/** Pro Archetyp: UI-Feldbeschreibungen (Werte werden in method_profile geschrieben) */
|
||||
export const METHOD_PROFILE_GUI_FIELDS = Object.freeze({
|
||||
sequence_linear: [
|
||||
{
|
||||
key: 'rounds',
|
||||
kind: 'int',
|
||||
label: 'Anzahl Gesamtdurchläufe (komplette Sequenz, alle Stationen nacheinander)',
|
||||
min: 1,
|
||||
max: 999,
|
||||
},
|
||||
{
|
||||
key: 'hint_step_duration_sec',
|
||||
kind: 'int',
|
||||
@@ -37,6 +44,14 @@ export const METHOD_PROFILE_GUI_FIELDS = Object.freeze({
|
||||
},
|
||||
],
|
||||
circuit_rotate_time: [
|
||||
{
|
||||
key: 'rounds',
|
||||
kind: 'int',
|
||||
label:
|
||||
'Anzahl Gesamtdurchläufe (jede Station pro Sportler mehrfach beim Umlauf, z. B. 4 Stationen × 2 = zwei komplette Runden)',
|
||||
min: 1,
|
||||
max: 999,
|
||||
},
|
||||
{
|
||||
key: 'work_seconds',
|
||||
kind: 'int',
|
||||
@@ -58,15 +73,15 @@ export const METHOD_PROFILE_GUI_FIELDS = Object.freeze({
|
||||
min: 0,
|
||||
max: INT_MAX,
|
||||
},
|
||||
],
|
||||
circuit_all_parallel: [
|
||||
{
|
||||
key: 'rounds',
|
||||
kind: 'int',
|
||||
label: 'Runden (optional, wenn alle Station je Runde angefahren werden)',
|
||||
label: 'Anzahl Durchläufe (wenn alle parallel dieselbe Rundenlogik haben, optional)',
|
||||
min: 1,
|
||||
max: 999,
|
||||
},
|
||||
],
|
||||
circuit_all_parallel: [
|
||||
{
|
||||
key: 'explain_before_seconds',
|
||||
kind: 'int',
|
||||
@@ -81,6 +96,13 @@ export const METHOD_PROFILE_GUI_FIELDS = Object.freeze({
|
||||
},
|
||||
],
|
||||
station_parcour: [
|
||||
{
|
||||
key: 'rounds',
|
||||
kind: 'int',
|
||||
label: 'Anzahl Durchläufe des Parcours (Start Station 1, alle Bahnpunkte, Wiederholung bei Bedarf)',
|
||||
min: 1,
|
||||
max: 999,
|
||||
},
|
||||
{
|
||||
key: 'allow_free_visit_order',
|
||||
kind: 'bool',
|
||||
@@ -121,7 +143,7 @@ export const METHOD_PROFILE_GUI_FIELDS = Object.freeze({
|
||||
{
|
||||
key: 'interval_rounds',
|
||||
kind: 'int',
|
||||
label: 'Anzahl Wiederholungen / Runden der Domäne (optional)',
|
||||
label: 'Anzahl Wiederholungen der Intervalldomäne (komplette Zyklen Arbeit/Pause)',
|
||||
min: 1,
|
||||
max: 999,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user