Enhance Skill Scoring and Profile Functionality
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Successful in 42s
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 1m15s

- Introduced a new function to calculate club-specific skill percentages, ensuring values are capped at 100%.
- Updated skill profile calculations to include indicators for the best club performance per skill.
- Enhanced frontend components to display club best indicators and improved layout for skill profiles.
- Refactored CSS styles for skill profile components, ensuring a more cohesive and user-friendly interface.
- Updated tests to validate new functionality and ensure accurate representation of skill metrics.
This commit is contained in:
Lars committed 2026-05-21 09:33:20 +02:00
1 parent 78c6c51520
commit 9a0cf7f823
9 files changed
+312 -189

No files matched your search

+25 -14
View File
@@ -26,10 +26,34 @@ export function maxSelectedSkillClubPercent(summary, skillIds = []) {
export function formatClubPercent(value) {
if (value == null || !Number.isFinite(Number(value))) return '—'
const n = Number(value)
const n = Math.min(100, Number(value))
return n % 1 === 0 ? `${n}%` : `${n.toFixed(1)}%`
}
/** KPI-Zeilen: immer Top je Unterkategorie; bei Skill-Filter nur passende Kategorien. */
export function kpiRowsFromSummary(summary, { skillIds = [], limit = 8 } = {}) {
if (!summary) return []
let rows = (summary.top_by_category || []).map((row) => ({
skill_id: row.skill_id,
skill_name: row.skill_name,
category_name: row.category_name,
main_category_name: row.main_category_name,
weight: row.weight ?? row.score,
universal_percent: row.universal_percent,
is_club_best_for_skill: row.is_club_best_for_skill,
}))
if (skillIds.length) {
const wanted = new Set(skillIds.map(String))
rows = rows.filter((row) => wanted.has(String(row.skill_id)))
}
return rows.slice(0, limit)
}
/** @deprecated Nutze kpiRowsFromSummary für Listen */
export function compactSkillDisplayRows(summary, opts = {}) {
return kpiRowsFromSummary(summary, opts)
}
export function artifactTypeLabel(type) {
if (type === 'framework_program') return 'Rahmenprogramm'
if (type === 'training_module') return 'Modul'
@@ -47,16 +71,3 @@ export function artifactPath(ref) {
}
return null
}
/** Zeilen für Kompakt-Anzeige: gewählte Fähigkeiten oder Top je Kategorie. */
export function compactSkillDisplayRows(summary, { skillIds = [], limit = 6 } = {}) {
if (!summary) return []
if (skillIds.length) {
return skillIds
.map((id) => skillEntryFromSummary(summary, id))
.filter(Boolean)
.sort((a, b) => (b.universal_percent ?? 0) - (a.universal_percent ?? 0))
.slice(0, limit)
}
return (summary.top_by_category || []).slice(0, limit)
}