feat: update version and enhance exercise filtering features
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 6s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Failing after 29s
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 6s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Failing after 29s
- Bumped application version to 0.8.40 and updated module versions accordingly. - Introduced new focus area filtering options in the ExercisesListPage, allowing users to include or exclude exercises based on specified focus areas. - Added utility functions for deduplicating and merging focus area IDs to improve filtering logic. - Enhanced the ExercisePickerModal and ExercisesListPage components to support new focus rules and improve user experience with focus area selections.
This commit is contained in:
1 parent
cfd40889ac
commit
518918a6e5
7 files changed
+357
-41
No files matched your search
@@ -1,6 +1,11 @@
|
||||
/** Gemeinsame Default-Filter für Übungslisten (Übersicht + Auswahlmodal). */
|
||||
export const INITIAL_EXERCISE_LIST_FILTERS = {
|
||||
/** Legacy: ODER über mehrere Fokus-IDs (wird nur noch aus gespeicherten Presets oder Chips genutzt). */
|
||||
focus_area_ids: [],
|
||||
/** Regeln: mode require = muss Fokus haben, forbid = darf diesen Fokus nicht haben (UND über alle require). */
|
||||
focus_rules: [],
|
||||
/** Nur Übungen ohne einen Eintrag in exercise_focus_areas. */
|
||||
focus_only_without: false,
|
||||
style_direction_ids: [],
|
||||
training_type_ids: [],
|
||||
target_group_ids: [],
|
||||
@@ -25,6 +30,20 @@ export function mergeExerciseListPrefsFromApi(raw) {
|
||||
if (!raw || typeof raw !== 'object') return out
|
||||
for (const k of PREFS_KEYS) {
|
||||
if (raw[k] === undefined) continue
|
||||
if (k === 'focus_rules' && Array.isArray(raw[k])) {
|
||||
out.focus_rules = raw[k]
|
||||
.filter((r) => r && r.focus_area_id != null && (r.mode === 'require' || r.mode === 'forbid'))
|
||||
.map((r, i) => ({
|
||||
key: r.key || `imp-${i}-${r.focus_area_id}-${r.mode}`,
|
||||
focus_area_id: String(r.focus_area_id),
|
||||
mode: r.mode,
|
||||
}))
|
||||
continue
|
||||
}
|
||||
if (k === 'focus_only_without') {
|
||||
out.focus_only_without = !!raw[k]
|
||||
continue
|
||||
}
|
||||
if (k.endsWith('_ids') || k.endsWith('_any')) {
|
||||
if (Array.isArray(raw[k])) out[k] = raw[k].map(String)
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user