fix: risk and colors on covergae in myteam page
This commit is contained in:
@@ -39,8 +39,8 @@ export function SkillMatrix({ members, skillGaps }: SkillMatrixProps) {
|
|||||||
importanceOrder[b.importance] - importanceOrder[a.importance];
|
importanceOrder[b.importance] - importanceOrder[a.importance];
|
||||||
if (importanceDiff !== 0) return importanceDiff;
|
if (importanceDiff !== 0) return importanceDiff;
|
||||||
|
|
||||||
// Si même importance, trier par couverture (décroissant)
|
// Si même importance, trier par couverture (ascendant)
|
||||||
return (b.coverage || 0) - (a.coverage || 0);
|
return (a.coverage || 0) - (b.coverage || 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
const skillsByCategory = validSkillGaps.reduce((acc, skill) => {
|
const skillsByCategory = validSkillGaps.reduce((acc, skill) => {
|
||||||
@@ -224,12 +224,11 @@ export function SkillMatrix({ members, skillGaps }: SkillMatrixProps) {
|
|||||||
<div className="w-full bg-white/10 rounded-full h-2">
|
<div className="w-full bg-white/10 rounded-full h-2">
|
||||||
<div
|
<div
|
||||||
className={`h-2 rounded-full ${
|
className={`h-2 rounded-full ${
|
||||||
isCoverageBelowObjective(
|
(skill.coverage || 0) >= 75
|
||||||
skill.coverage || 0,
|
? "bg-green-500/50"
|
||||||
skill.importance
|
: (skill.coverage || 0) >= 50
|
||||||
)
|
? "bg-yellow-500/50"
|
||||||
? "bg-red-500/50"
|
: "bg-red-500/50"
|
||||||
: colors.bg.replace("/20", "/50")
|
|
||||||
}`}
|
}`}
|
||||||
style={{
|
style={{
|
||||||
width: `${Math.max(
|
width: `${Math.max(
|
||||||
@@ -241,12 +240,11 @@ export function SkillMatrix({ members, skillGaps }: SkillMatrixProps) {
|
|||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
className={`text-sm whitespace-nowrap ${
|
className={`text-sm whitespace-nowrap ${
|
||||||
isCoverageBelowObjective(
|
(skill.coverage || 0) >= 75
|
||||||
skill.coverage || 0,
|
? "text-green-400"
|
||||||
skill.importance
|
: (skill.coverage || 0) >= 50
|
||||||
)
|
? "text-yellow-400"
|
||||||
? "text-red-400"
|
: "text-red-400"
|
||||||
: colors.text
|
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{Math.round(skill.coverage || 0)}%
|
{Math.round(skill.coverage || 0)}%
|
||||||
@@ -354,12 +352,11 @@ export function SkillMatrix({ members, skillGaps }: SkillMatrixProps) {
|
|||||||
<div className="w-full bg-white/10 rounded-full h-2">
|
<div className="w-full bg-white/10 rounded-full h-2">
|
||||||
<div
|
<div
|
||||||
className={`h-2 rounded-full ${
|
className={`h-2 rounded-full ${
|
||||||
isCoverageBelowObjective(
|
(skill.coverage || 0) >= 75
|
||||||
skill.coverage || 0,
|
? "bg-green-500/50"
|
||||||
skill.importance
|
: (skill.coverage || 0) >= 50
|
||||||
)
|
? "bg-yellow-500/50"
|
||||||
? "bg-red-500/50"
|
: "bg-red-500/50"
|
||||||
: colors.bg.replace("/20", "/50")
|
|
||||||
}`}
|
}`}
|
||||||
style={{
|
style={{
|
||||||
width: `${Math.max(
|
width: `${Math.max(
|
||||||
@@ -371,12 +368,11 @@ export function SkillMatrix({ members, skillGaps }: SkillMatrixProps) {
|
|||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
className={`text-sm whitespace-nowrap ${
|
className={`text-sm whitespace-nowrap ${
|
||||||
isCoverageBelowObjective(
|
(skill.coverage || 0) >= 75
|
||||||
skill.coverage || 0,
|
? "text-green-400"
|
||||||
skill.importance
|
: (skill.coverage || 0) >= 50
|
||||||
)
|
? "text-yellow-400"
|
||||||
? "text-red-400"
|
: "text-red-400"
|
||||||
: colors.text
|
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{Math.round(skill.coverage || 0)}%
|
{Math.round(skill.coverage || 0)}%
|
||||||
|
|||||||
@@ -158,13 +158,16 @@ export class TeamReviewService {
|
|||||||
);
|
);
|
||||||
const coverage = calculateSkillCoverage(levels, totalTeamMembers);
|
const coverage = calculateSkillCoverage(levels, totalTeamMembers);
|
||||||
|
|
||||||
// Déterminer le niveau de risque en fonction de l'importance
|
// Déterminer le niveau de risque en fonction de l'importance et de la couverture
|
||||||
|
const coverageObjective = COVERAGE_OBJECTIVES[skill.importance];
|
||||||
const risk =
|
const risk =
|
||||||
skill.importance === "incontournable" && experts === 0
|
skill.importance === "incontournable" && coverage < coverageObjective
|
||||||
? "high"
|
? "high"
|
||||||
: skill.importance === "majeure" && experts === 0 && mentors === 0
|
: skill.importance === "majeure" &&
|
||||||
|
coverage < coverageObjective &&
|
||||||
|
experts === 0
|
||||||
? "high"
|
? "high"
|
||||||
: experts === 0 && mentors === 0
|
: coverage < coverageObjective
|
||||||
? "medium"
|
? "medium"
|
||||||
: "low";
|
: "low";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user