feat(training-planning): enhance planning method profile handling and UI updates
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 11s
Test Suite / playwright-tests (push) Successful in 59s
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 11s
Test Suite / playwright-tests (push) Successful in 59s
- Integrated PsycopgJson for improved handling of planning method profiles in the backend. - Updated CombinationPlanBracket to display primary load labels for better clarity in the UI. - Enhanced TrainingUnitSectionsEditor and utility functions to ensure proper serialization of planning profiles, preventing potential errors during API interactions. - Improved CSS for combo plan brackets to enhance visual alignment and presentation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
d3ddc52118
commit
3898e8bc2c
8 files changed
+146
-24
No files matched your search
@@ -7,7 +7,12 @@ import {
|
||||
combinationArchetypeLabel,
|
||||
sortCombinationSlotsForDisplay,
|
||||
} from '../constants/combinationArchetypes'
|
||||
import { describeGlobalComboProfile, effectiveStationTimingSummary, readSlotProfilesV1 } from '../utils/combinationMethodProfileUi'
|
||||
import {
|
||||
describeGlobalComboProfile,
|
||||
effectiveStationTimingSummary,
|
||||
readSlotProfilesV1,
|
||||
stationPrimaryLoadLabel,
|
||||
} from '../utils/combinationMethodProfileUi'
|
||||
|
||||
function candidateLine(slot) {
|
||||
const cands = slot.candidates
|
||||
@@ -93,10 +98,18 @@ export default function CombinationPlanBracket({
|
||||
const displayStep = si + 1
|
||||
const stationTitle = ((slot.title || '').trim() || `Station ${displayStep}`).trim()
|
||||
const names = candidateLine(slot)
|
||||
const timing = effectiveStationTimingSummary(arch, methodProfile || {}, timingByIx.get(stationIx))
|
||||
const slotProfRow = timingByIx.get(stationIx)
|
||||
const loadBadge = stationPrimaryLoadLabel(slotProfRow)
|
||||
const timing = effectiveStationTimingSummary(arch, methodProfile || {}, slotProfRow)
|
||||
|
||||
return (
|
||||
<li key={`slot-${stationIx}-${si}`} className="combo-plan-bracket__station">
|
||||
<div
|
||||
className="combo-plan-bracket__station-load"
|
||||
title={loadBadge ? 'Belastung je Station (Sekunden oder Wiederholungen)' : undefined}
|
||||
>
|
||||
{loadBadge || '—'}
|
||||
</div>
|
||||
<div className="combo-plan-bracket__station-main">
|
||||
<div className="combo-plan-bracket__station-title">{stationTitle}</div>
|
||||
<div className="combo-plan-bracket__station-exercises">{names || '(keine Einzelübung)'}</div>
|
||||
|
||||
@@ -5,6 +5,7 @@ import CombinationPlanBracket from './CombinationPlanBracket'
|
||||
import { comboPlanningProfileJsonForEditor, effectiveComboMethodProfile } from '../utils/comboPlanningMethodProfile'
|
||||
import { combinationArchetypeLabel, sortCombinationSlotsForDisplay } from '../constants/combinationArchetypes'
|
||||
import {
|
||||
cloneJsonSerializablePlanningProfile,
|
||||
comboSlotsOutlineForProfileEditor,
|
||||
defaultSection,
|
||||
exerciseRow,
|
||||
@@ -1246,11 +1247,6 @@ export default function TrainingUnitSectionsEditor({
|
||||
<strong style={{ color: 'var(--text1)', fontWeight: 600 }}>Archetyp: </strong>
|
||||
<span style={{ color: 'var(--text1)' }}>
|
||||
{stripArchLbl || stripArchRaw || '—'}
|
||||
{stripArchRaw && stripArchLbl && stripArchLbl !== stripArchRaw ? (
|
||||
<span style={{ marginLeft: 6, fontWeight: 400, color: 'var(--text3)', fontSize: '0.72rem' }}>
|
||||
({stripArchRaw})
|
||||
</span>
|
||||
) : null}
|
||||
</span>
|
||||
<span style={{ marginLeft: 10, fontWeight: 500 }}>{compactComboPlanningCaption(it)}</span>
|
||||
</div>
|
||||
@@ -1628,7 +1624,13 @@ export default function TrainingUnitSectionsEditor({
|
||||
try {
|
||||
const obj = JSON.parse(json || '{}')
|
||||
if (obj && typeof obj === 'object' && !Array.isArray(obj)) {
|
||||
updateItem(comboPlanningModalSX, comboPlanningModalIX, 'planning_method_profile', obj)
|
||||
const cleaned = cloneJsonSerializablePlanningProfile(obj) ?? {}
|
||||
updateItem(
|
||||
comboPlanningModalSX,
|
||||
comboPlanningModalIX,
|
||||
'planning_method_profile',
|
||||
Object.keys(cleaned).length ? cleaned : null,
|
||||
)
|
||||
}
|
||||
} catch {
|
||||
/* Ungültiges JSON — Hinweis im Editor */
|
||||
|
||||
Reference in new issue
Block a user