Enhance Training Framework Programs with Session Duration and Filtering Features
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Successful in 39s
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 1m29s

- Added SQL aggregations for session duration (min/max) and goal titles in the training framework programs query.
- Updated the TrainingPlanningFrameworkImportModal component to include filtering options for focus areas, training types, and target groups.
- Implemented session duration display in the TrainingFrameworkProgramsListPage, improving user visibility of program details.
- Introduced utility functions for formatting session duration ranges, enhancing the overall user experience in training planning.
This commit is contained in:
Lars committed 2026-05-20 13:19:40 +02:00
1 parent 5a8a212f40
commit 9353909fda
7 files changed
+450 -14

No files matched your search

@@ -4,6 +4,7 @@ import NavStateLink from '../components/NavStateLink'
import { useAuth } from '../context/AuthContext'
import { getTenantClubDependencyKey } from '../utils/activeClub'
import { buildFrameworkProgramsListReturnContext } from '../utils/navReturnContext'
import { frameworkSessionDurationLabel } from '../utils/frameworkProgramListHelpers'
function dashIfEmpty(val) {
const s = (val ?? '').toString().trim()
@@ -37,8 +38,22 @@ function FrameworkSummaryMeta({ r }) {
lineHeight: 1.45,
}
const durationLabel = frameworkSessionDurationLabel(r)
const goals =
typeof r.goal_titles_agg === 'string' ? r.goal_titles_agg.trim() : ''
return (
<dl style={{ margin: '0.5rem 0 0', padding: 0, fontSize: '0.875rem', color: 'var(--text2)' }}>
<div style={rowStyle}>
<dt style={{ margin: 0, fontWeight: 600, color: 'var(--text3)' }}>Session-Dauer</dt>
<dd style={{ margin: 0 }}>{durationLabel}</dd>
</div>
{goals ? (
<div style={rowStyle}>
<dt style={{ margin: 0, fontWeight: 600, color: 'var(--text3)' }}>Entwicklungsziele</dt>
<dd style={{ margin: 0 }}>{goals}</dd>
</div>
) : null}
<div style={rowStyle}>
<dt style={{ margin: 0, fontWeight: 600, color: 'var(--text3)' }}>Fokusbereich</dt>
<dd style={{ margin: 0 }}>{dashIfEmpty(focus)}</dd>
@@ -187,6 +202,19 @@ export default function TrainingFrameworkProgramsListPage() {
{r.title || `Rahmen #${r.id}`}
</NavStateLink>
<div style={{ fontSize: '0.85rem', color: 'var(--text2)', marginTop: '0.35rem' }}>
<span
style={{
display: 'inline-block',
marginRight: '8px',
padding: '2px 8px',
borderRadius: '6px',
background: 'var(--surface2)',
fontWeight: 600,
color: 'var(--text1)',
}}
>
{frameworkSessionDurationLabel(r)}
</span>
<span>
{(r.goals_count ?? '—') + ' Ziele · '}
{(r.slots_count ?? '—') + ' Slots'}