feat(combo-planning): enhance combination profile handling and UI improvements
Deploy Development / deploy (push) Successful in 36s
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 59s
Deploy Development / deploy (push) Successful in 36s
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 59s
- Updated CombinationCoachSlots to integrate a new function for formatting inline profile values, improving data display consistency. - Refactored CombinationMethodProfileEditor to streamline slot index handling and enhance title clarity. - Improved CombinationPlanBracket by removing unnecessary elements for a cleaner UI. - Enhanced ExerciseFullContent to support additional catalog method profile snapshots, improving exercise detail accuracy. - Updated CSS for combo plan brackets to enhance visual presentation and alignment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
79dabbca5a
commit
d3ddc52118
8 files changed
+142
-95
No files matched your search
@@ -1,19 +1,56 @@
|
||||
/** Effektives Ablaufprofil für Kombination im Coach/in der Planung */
|
||||
|
||||
/**
|
||||
* Vereinigt slot_profiles_v1 aus Katalog und Planungs-Overlay (je slot_index).
|
||||
* @param {unknown} catArr
|
||||
* @param {unknown} planArr
|
||||
*/
|
||||
function mergeSlotProfilesV1(catArr, planArr) {
|
||||
const c = Array.isArray(catArr) ? catArr : []
|
||||
const p = Array.isArray(planArr) ? planArr : []
|
||||
const byIx = new Map()
|
||||
for (const r of c) {
|
||||
if (!r || typeof r !== 'object') continue
|
||||
const ix = Number(r.slot_index)
|
||||
if (!Number.isFinite(ix)) continue
|
||||
byIx.set(ix, { ...r })
|
||||
}
|
||||
for (const r of p) {
|
||||
if (!r || typeof r !== 'object') continue
|
||||
const ix = Number(r.slot_index)
|
||||
if (!Number.isFinite(ix)) continue
|
||||
const prev = byIx.get(ix) || {}
|
||||
byIx.set(ix, { ...prev, ...r })
|
||||
}
|
||||
return [...byIx.entries()].sort((a, b) => a[0] - b[0]).map(([, row]) => row)
|
||||
}
|
||||
|
||||
/**
|
||||
* Katalog-Basis + optionaler Planungs-Snapshot.
|
||||
* Wichtig: `planning_method_profile` darf nur **Überschreibungen** sein — nie den Katalog komplett ersetzen
|
||||
* (sonst verschwinden Zeiten/Runden bei leerem Objekt oder Teil-Payload).
|
||||
*/
|
||||
export function effectiveComboMethodProfile(catalogDict, planningSnapshot) {
|
||||
const cat =
|
||||
catalogDict && typeof catalogDict === 'object' && !Array.isArray(catalogDict)
|
||||
? catalogDict
|
||||
: {}
|
||||
catalogDict && typeof catalogDict === 'object' && !Array.isArray(catalogDict) ? { ...catalogDict } : {}
|
||||
|
||||
if (
|
||||
planningSnapshot !== null &&
|
||||
planningSnapshot !== undefined &&
|
||||
typeof planningSnapshot === 'object' &&
|
||||
!Array.isArray(planningSnapshot)
|
||||
planningSnapshot === null ||
|
||||
planningSnapshot === undefined ||
|
||||
typeof planningSnapshot !== 'object' ||
|
||||
Array.isArray(planningSnapshot)
|
||||
) {
|
||||
return { ...planningSnapshot }
|
||||
return { ...cat }
|
||||
}
|
||||
return { ...cat }
|
||||
|
||||
const plan = planningSnapshot
|
||||
const merged = { ...cat, ...plan }
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(plan, 'slot_profiles_v1')) {
|
||||
merged.slot_profiles_v1 = mergeSlotProfilesV1(cat.slot_profiles_v1, plan.slot_profiles_v1)
|
||||
}
|
||||
|
||||
return merged
|
||||
}
|
||||
|
||||
export function comboPlanningProfileJsonForEditor(catalogDict, planningSnapshot) {
|
||||
|
||||
Reference in new issue
Block a user