feat: enhance training framework programs and planning features
- Added aggregation of training type names and target group names in the training framework programs API response for improved data presentation. - Implemented origin framework slot tracking in the training planning module, allowing users to import training units from framework programs. - Enhanced the TrainingFrameworkProgramsListPage to display aggregated training type and target group information, improving user experience. - Introduced a modal for importing framework programs into training planning, streamlining the process of managing training units.
This commit is contained in:
1 parent
86192df508
commit
6dcbc8c610
4 files changed
+499
-29
No files matched your search
@@ -295,7 +295,19 @@ def list_training_framework_programs(session=Depends(require_auth)):
|
||||
(SELECT COUNT(*)::int FROM training_framework_program_training_types t
|
||||
WHERE t.framework_program_id = fp.id) AS training_types_count,
|
||||
(SELECT COUNT(*)::int FROM training_framework_program_target_groups tg
|
||||
WHERE tg.framework_program_id = fp.id) AS target_groups_count
|
||||
WHERE tg.framework_program_id = fp.id) AS target_groups_count,
|
||||
(
|
||||
SELECT STRING_AGG(typ.name::text, ', ' ORDER BY typ.sort_order NULLS LAST, typ.name)
|
||||
FROM training_framework_program_training_types j
|
||||
JOIN training_types typ ON typ.id = j.training_type_id
|
||||
WHERE j.framework_program_id = fp.id
|
||||
) AS training_type_names_agg,
|
||||
(
|
||||
SELECT STRING_AGG(tg.name::text, ', ' ORDER BY tg.name)
|
||||
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
|
||||
FROM training_framework_programs fp
|
||||
LEFT JOIN focus_areas fa ON fa.id = fp.focus_area_id
|
||||
LEFT JOIN style_directions sd ON sd.id = fp.style_direction_id
|
||||
|
||||
Reference in new issue
Block a user