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

+40 -1
View File
@@ -444,7 +444,46 @@ def list_training_framework_programs(tenant: TenantContext = Depends(get_tenant_
FROM training_framework_program_target_groups j
JOIN target_groups tg ON tg.id = j.target_group_id
WHERE j.framework_program_id = fp.id
) AS target_group_names_agg
) AS target_group_names_agg,
(
SELECT STRING_AGG(g.title::text, ' | ' ORDER BY g.sort_order)
FROM training_framework_goals g
WHERE g.framework_program_id = fp.id
) AS goal_titles_agg,
(
SELECT MIN(tu.planned_duration_min)::int
FROM training_framework_slots fs
INNER JOIN training_units tu ON tu.framework_slot_id = fs.id
WHERE fs.framework_program_id = fp.id
AND tu.planned_duration_min IS NOT NULL
) AS session_duration_min,
(
SELECT MAX(tu.planned_duration_min)::int
FROM training_framework_slots fs
INNER JOIN training_units tu ON tu.framework_slot_id = fs.id
WHERE fs.framework_program_id = fp.id
AND tu.planned_duration_min IS NOT NULL
) AS session_duration_max,
(
SELECT COALESCE(json_agg(j.focus_area_id ORDER BY j.focus_area_id), '[]'::json)
FROM training_framework_program_focus_areas j
WHERE j.framework_program_id = fp.id
) AS focus_area_ids,
(
SELECT COALESCE(json_agg(j.style_direction_id ORDER BY j.style_direction_id), '[]'::json)
FROM training_framework_program_style_directions j
WHERE j.framework_program_id = fp.id
) AS style_direction_ids,
(
SELECT COALESCE(json_agg(j.training_type_id ORDER BY j.training_type_id), '[]'::json)
FROM training_framework_program_training_types j
WHERE j.framework_program_id = fp.id
) AS training_type_ids,
(
SELECT COALESCE(json_agg(j.target_group_id ORDER BY j.target_group_id), '[]'::json)
FROM training_framework_program_target_groups j
WHERE j.framework_program_id = fp.id
) AS target_group_ids
FROM training_framework_programs fp
"""
vis_clause, vis_params = library_content_visibility_sql(