Implement Skill Tree Selection Components and Update API Calls
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 37s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m15s
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 37s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m15s
- Introduced new `SkillTreeSelect` and `SkillTreeMultiSelect` components for enhanced skill selection in various modals and forms. - Updated API calls to use `listSkillsCatalog` instead of `listSkills` for improved data retrieval. - Enhanced CSS styles for skill selection components to improve user experience and visual consistency across the application.
This commit is contained in:
1 parent
728b37ad5f
commit
3067b2e6a8
12 files changed
+793
-46
No files matched your search
@@ -14,7 +14,8 @@ import {
|
||||
buildExerciseMediaDragPayload,
|
||||
} from '../../utils/exerciseInlineMediaRefs'
|
||||
import { autoScrollForDragNearEdges } from '../../utils/dragAutoScroll'
|
||||
import { SKILL_LEVEL_OPTIONS, normalizeSkillLevelSlug } from '../../constants/skillLevels'
|
||||
import SkillTreeSelect from '../SkillTreeSelect'
|
||||
import { skillCatalogPathLabel } from '../../utils/skillCatalogTree'
|
||||
import { useAuth } from '../../context/AuthContext'
|
||||
import { useToast } from '../../context/ToastContext'
|
||||
import {
|
||||
@@ -609,7 +610,7 @@ function ExerciseFormPageRoot() {
|
||||
const boot = async () => {
|
||||
try {
|
||||
const [skillsData, faData, sdData, ttData, tgData] = await Promise.all([
|
||||
api.listSkills(),
|
||||
api.listSkillsCatalog(),
|
||||
api.listFocusAreas(),
|
||||
api.listTrainingStyles(),
|
||||
api.listTrainingTypes(),
|
||||
@@ -1184,8 +1185,6 @@ function ExerciseFormPageRoot() {
|
||||
}
|
||||
}
|
||||
|
||||
const availableSkills = skillsCatalog.filter((s) => !formData.skills.some((x) => x.skill_id === s.id))
|
||||
|
||||
const selectedVariantForEdit =
|
||||
typeof variantEditSelection === 'number' ? variants.find((v) => v.id === variantEditSelection) : null
|
||||
const selectedVariantIdx = selectedVariantForEdit
|
||||
@@ -1856,20 +1855,14 @@ function ExerciseFormPageRoot() {
|
||||
|
||||
<div className="form-row">
|
||||
<label className="form-label">Fähigkeiten (je Übung mehrere, mit Niveau)</label>
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px', marginBottom: '10px' }}>
|
||||
<select
|
||||
className="form-input"
|
||||
style={{ flex: '1 1 200px' }}
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px', marginBottom: '10px', alignItems: 'stretch' }}>
|
||||
<SkillTreeSelect
|
||||
value={skillPick}
|
||||
onChange={(e) => setSkillPick(e.target.value)}
|
||||
>
|
||||
<option value="">Fähigkeit wählen…</option>
|
||||
{availableSkills.map((s) => (
|
||||
<option key={s.id} value={s.id}>
|
||||
{s.name} ({s.category})
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
onChange={setSkillPick}
|
||||
skills={skillsCatalog}
|
||||
excludeIds={formData.skills.map((s) => s.skill_id)}
|
||||
placeholder="Fähigkeit wählen…"
|
||||
/>
|
||||
<button type="button" className="btn btn-secondary" onClick={addSkillRow}>
|
||||
Hinzufügen
|
||||
</button>
|
||||
@@ -1880,11 +1873,11 @@ function ExerciseFormPageRoot() {
|
||||
<div key={`${row.skill_id}-${idx}`} className="skills-editor-row">
|
||||
<div>
|
||||
<strong style={{ fontSize: '14px' }}>{sk?.name || `Skill #${row.skill_id}`}</strong>
|
||||
{sk?.category && (
|
||||
{sk ? (
|
||||
<span style={{ color: 'var(--text2)', fontSize: '12px', marginLeft: '6px' }}>
|
||||
{sk.category}
|
||||
{skillCatalogPathLabel(sk)}
|
||||
</span>
|
||||
)}
|
||||
) : null}
|
||||
</div>
|
||||
<label style={{ fontSize: '12px', display: 'flex', alignItems: 'center', gap: '4px' }}>
|
||||
<input
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
import { SKILL_LEVEL_OPTIONS } from '../../constants/skillLevels'
|
||||
import MultiSelectCombo from '../MultiSelectCombo'
|
||||
import SkillTreeMultiSelect from '../SkillTreeMultiSelect'
|
||||
import ExerciseFocusRulePicker from '../ExerciseFocusRulePicker'
|
||||
import CatalogRulePicker from '../CatalogRulePicker'
|
||||
|
||||
@@ -18,7 +18,7 @@ export default function ExerciseListFilterModal({
|
||||
styleOptions,
|
||||
trainingTypeOptions,
|
||||
targetGroupOptions,
|
||||
skillOptions,
|
||||
skillsCatalog = [],
|
||||
visibilityOptions,
|
||||
statusOptions,
|
||||
savingExercisePrefs,
|
||||
@@ -103,10 +103,10 @@ export default function ExerciseListFilterModal({
|
||||
<h4 className="exercise-filter-section-title">Fähigkeit und zugehörige Stufe</h4>
|
||||
<div className="exercise-filter-skill-block">
|
||||
<label className="form-label">Fähigkeit</label>
|
||||
<MultiSelectCombo
|
||||
<SkillTreeMultiSelect
|
||||
value={filters.skill_ids}
|
||||
onChange={(v) => setFilters({ ...filters, skill_ids: v })}
|
||||
options={skillOptions}
|
||||
skills={skillsCatalog}
|
||||
placeholder="Fähigkeit suchen …"
|
||||
/>
|
||||
<p className="exercise-filter-skill-hint">
|
||||
|
||||
@@ -13,6 +13,7 @@ import ExercisePeekModal from '../ExercisePeekModal'
|
||||
import NavStateLink from '../NavStateLink'
|
||||
import { buildExercisesListReturnContext } from '../../utils/navReturnContext'
|
||||
import { buildExerciseListFilterChips } from '../../utils/exerciseListFilterChips'
|
||||
import { skillCatalogPathLabel } from '../../utils/skillCatalogTree'
|
||||
import { applyDashboardExerciseListUrl, buildExerciseListQueryBase } from '../../utils/exerciseListQuery'
|
||||
import { readExerciseListSessionState, writeExerciseListSessionState } from '../../utils/exerciseListSessionState'
|
||||
import {
|
||||
@@ -186,7 +187,11 @@ function ExercisesListPageRoot() {
|
||||
[catalogs.targetGroups]
|
||||
)
|
||||
const skillOptions = useMemo(
|
||||
() => catalogs.skills.map((s) => ({ id: s.id, label: s.name || String(s.id) })),
|
||||
() =>
|
||||
catalogs.skills.map((s) => ({
|
||||
id: s.id,
|
||||
label: skillCatalogPathLabel(s) || s.name || String(s.id),
|
||||
})),
|
||||
[catalogs.skills]
|
||||
)
|
||||
const visibilityOptions = useMemo(
|
||||
@@ -549,7 +554,7 @@ function ExercisesListPageRoot() {
|
||||
styleOptions={styleOptions}
|
||||
trainingTypeOptions={trainingTypeOptions}
|
||||
targetGroupOptions={targetGroupOptions}
|
||||
skillOptions={skillOptions}
|
||||
skillsCatalog={catalogs.skills}
|
||||
visibilityOptions={visibilityOptions}
|
||||
statusOptions={statusOptions}
|
||||
savingExercisePrefs={savingExercisePrefs}
|
||||
|
||||
Reference in new issue
Block a user