feat: review admin teams views for importance inclusion

This commit is contained in:
Julien Froidefond
2025-08-27 13:43:47 +02:00
parent e9aecca2a5
commit a5bcdd34fb
10 changed files with 1041 additions and 409 deletions

View File

@@ -48,7 +48,7 @@ export function TeamMemberModal({
return (
<Dialog open={isOpen} onOpenChange={onClose}>
<DialogContent className="max-w-4xl bg-slate-900/95 border-white/20 text-white max-h-[80vh] overflow-y-auto">
<DialogContent className="max-w-6xl bg-slate-900/95 border-white/20 text-white max-h-[90vh] overflow-y-auto">
<DialogHeader>
<DialogTitle className="flex items-center justify-between">
<div className="flex items-center gap-3">
@@ -78,98 +78,198 @@ export function TeamMemberModal({
<div className="space-y-6">
{/* Stats du membre */}
<div className="grid grid-cols-3 gap-4">
<div className="bg-white/5 border border-white/10 rounded-xl p-4 text-center">
<div className="text-2xl font-bold text-white">
<div className="flex items-center gap-4 bg-white/5 border border-white/10 rounded-xl p-3">
<div className="flex items-center gap-2">
<div className="text-lg font-bold text-white">
{member.skills.length}
</div>
<div className="text-sm text-slate-400">Compétences évaluées</div>
<div className="text-xs text-slate-400">compétences</div>
</div>
<div className="bg-white/5 border border-white/10 rounded-xl p-4 text-center">
<div className="text-2xl font-bold text-green-300">
<div className="h-8 w-px bg-white/10" />
<div className="flex items-center gap-2">
<Award className="h-4 w-4 text-green-400" />
<div className="text-lg font-bold text-green-400">
{
member.skills.filter((s) => s.level >= 2 && s.canMentor)
.length
}
</div>
<div className="text-sm text-slate-400">Peut mentorer</div>
<div className="text-xs text-slate-400">mentorables</div>
</div>
<div className="bg-white/5 border border-white/10 rounded-xl p-4 text-center">
<div className="text-2xl font-bold text-blue-300">
<div className="h-8 w-px bg-white/10" />
<div className="flex items-center gap-2">
<BookOpen className="h-4 w-4 text-blue-400" />
<div className="text-lg font-bold text-blue-400">
{member.skills.filter((s) => s.wantsToLearn).length}
</div>
<div className="text-sm text-slate-400">Souhaite apprendre</div>
<div className="text-xs text-slate-400">à apprendre</div>
</div>
</div>
{/* Compétences détaillées */}
<div>
<h4 className="font-medium mb-4 text-lg">
Portfolio de compétences
</h4>
<div className="space-y-2 max-h-96 overflow-y-auto">
{member.skills
.sort((a, b) => b.level - a.level)
.map((skill, idx) => (
<div
key={idx}
className="flex items-center justify-between p-3 bg-white/5 rounded-lg hover:bg-white/10 transition-colors"
>
<div className="flex-1">
<div className="flex items-center justify-between mb-2">
<div>
<div className="font-medium text-white">
{skill.skillName}
</div>
<div className="text-sm text-slate-400">
{skill.category}
</div>
</div>
<div
className={`px-2 py-1 border rounded-lg text-center ${getSkillLevelBadgeClasses(
skill.level
)}`}
>
<span className="text-xs font-medium">
{getSkillLevelLabel(skill.level)}
</span>
</div>
</div>
<div className="w-full bg-white/10 rounded-full h-2 mb-2">
<div
className={`h-2 rounded-full transition-all ${getSkillLevelColor(
skill.level
)
.replace("bg-", "bg-gradient-to-r from-")
.replace("-500", "-400")}`}
style={{ width: `${(skill.level / 3) * 100}%` }}
/>
</div>
<div className="flex items-center gap-2">
{skill.canMentor && (
<Badge
variant="outline"
className="text-xs text-green-300 border-green-500/30"
>
<Award className="h-3 w-3 mr-1" />
Mentor
</Badge>
)}
{skill.wantsToLearn && (
<Badge
variant="outline"
className="text-xs text-blue-300 border-blue-500/30"
>
<BookOpen className="h-3 w-3 mr-1" />
Apprenant
</Badge>
)}
</div>
</div>
<div className="bg-white/5 border border-white/10 rounded-xl overflow-hidden">
<div className="p-3 border-b border-white/10 flex items-center justify-between">
<h4 className="font-medium text-sm text-slate-200">
Portfolio de compétences
</h4>
<div className="flex items-center gap-2 text-xs text-slate-400">
<div className="flex items-center gap-2 text-[10px]">
<div className="flex items-center gap-1">
<div className="w-1 h-4 rounded-sm bg-red-500" />
Inc.
</div>
))}
<div className="flex items-center gap-1">
<div className="w-1 h-4 rounded-sm bg-blue-500" />
Maj.
</div>
<div className="h-4 w-px bg-white/10" />
<div className="flex items-center gap-1">
<div className="w-2 h-2 rounded-full bg-green-500" />
Exp.
</div>
<div className="flex items-center gap-1">
<div className="w-2 h-2 rounded-full bg-blue-500" />
Auto.
</div>
<div className="flex items-center gap-1">
<div className="w-2 h-2 rounded-full bg-orange-500" />
Prog.
</div>
<div className="flex items-center gap-1">
<div className="w-2 h-2 rounded-full bg-red-500" />
Déb.
</div>
</div>
</div>
</div>
<div className="max-h-[60vh] overflow-y-auto">
<table className="w-full">
<colgroup>
<col className="w-[50%]" />
<col className="w-[25%]" />
<col className="w-[25%]" />
</colgroup>
<thead>
<tr className="border-b border-white/10">
<th className="text-left py-2 px-3 text-xs font-medium text-slate-400">
Compétence
</th>
<th className="text-center py-2 px-2 text-xs font-medium text-slate-400">
Niveau
</th>
<th className="text-center py-2 px-2 text-xs font-medium text-slate-400">
Statut
</th>
</tr>
</thead>
<tbody>
{member.skills
.sort((a, b) => {
// D'abord par importance
const importanceOrder = {
incontournable: 2,
majeure: 1,
standard: 0,
};
const importanceDiff =
importanceOrder[b.importance] -
importanceOrder[a.importance];
if (importanceDiff !== 0) return importanceDiff;
// Ensuite par niveau de maîtrise
return b.level - a.level;
})
.map((skill, idx) => (
<tr
key={idx}
className="border-b border-white/5 hover:bg-white/5"
>
<td className="py-2 px-3">
<div className="flex items-center gap-2">
<div
className={`w-1 h-6 rounded-sm ${
skill.importance === "incontournable"
? "bg-red-500"
: skill.importance === "majeure"
? "bg-blue-500"
: "bg-slate-500"
}`}
/>
<div>
<div className="text-sm text-slate-200">
{skill.skillName}
</div>
<div className="flex items-center gap-1">
<div className="text-xs text-slate-400">
{skill.category}
</div>
<span className="text-xs text-slate-400">
</span>
<div
className={`text-[10px] ${
skill.importance === "incontournable"
? "text-red-400"
: skill.importance === "majeure"
? "text-blue-400"
: "text-slate-400"
}`}
>
{skill.importance === "incontournable"
? "Inc."
: skill.importance === "majeure"
? "Maj."
: "Std."}
</div>
</div>
</div>
</div>
</td>
<td className="py-2 px-2">
<div className="flex items-center justify-center gap-2">
<div
className={`text-sm font-medium ${getSkillLevelBadgeClasses(
skill.level
)}`}
>
{skill.level.toFixed(1)}
</div>
<div className="w-12 bg-white/10 rounded-full h-1">
<div
className={`h-1 rounded-full ${getSkillLevelColor(
skill.level
)}`}
style={{ width: `${(skill.level / 3) * 100}%` }}
/>
</div>
</div>
</td>
<td className="py-2 px-2">
<div className="flex items-center justify-center gap-1">
{skill.canMentor && (
<Badge
variant="outline"
className="text-[10px] text-green-300 border-green-500/30 px-1"
>
<Award className="h-2.5 w-2.5 mr-0.5" />
Mentor
</Badge>
)}
{skill.wantsToLearn && (
<Badge
variant="outline"
className="text-[10px] text-blue-300 border-blue-500/30 px-1"
>
<BookOpen className="h-2.5 w-2.5 mr-0.5" />
Apprenant
</Badge>
)}
</div>
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>