From d423bb85da54eecdc07a29ad4b43c093df082f83 Mon Sep 17 00:00:00 2001 From: Yannick Musafiri Date: Wed, 24 Jun 2026 16:42:04 +0200 Subject: [PATCH] fix: invalid career readiness stats labels --- .../InstructorStudentsTable.stories.tsx | 12 ++++++------ .../InstructorStudentsTable.tsx | 8 ++++---- admin-frontend/src/hooks/useInstructorStudents.ts | 8 ++++---- .../src/hooks/useInstructorStudentsTableState.ts | 10 +++++----- .../src/i18n/locales/en-GB/translation.json | 4 ++-- .../src/i18n/locales/en-US/translation.json | 4 ++-- .../src/i18n/locales/es-AR/translation.json | 4 ++-- .../src/i18n/locales/es-ES/translation.json | 4 ++-- .../src/i18n/locales/ny-ZM/translation.json | 4 ++-- .../src/i18n/locales/pt-MZ/translation.json | 4 ++-- .../src/i18n/locales/sw-KE/translation.json | 4 ++-- admin-frontend/src/types/index.ts | 4 ++-- 12 files changed, 35 insertions(+), 35 deletions(-) diff --git a/admin-frontend/src/components/InstructorStudentsTable/InstructorStudentsTable.stories.tsx b/admin-frontend/src/components/InstructorStudentsTable/InstructorStudentsTable.stories.tsx index a055754c..75aaa2d5 100644 --- a/admin-frontend/src/components/InstructorStudentsTable/InstructorStudentsTable.stories.tsx +++ b/admin-frontend/src/components/InstructorStudentsTable/InstructorStudentsTable.stories.tsx @@ -19,8 +19,8 @@ const storyInstructorStudentsFixture: InstructorStudentRow[] = [ qualificationType: "Certificate (Level 3)", year: "Year 2", gender: "Female", - modulesExplored: 4, - careerReady: "3/6", + careerReadinessStarted: 4, + careerReadinessCompleted: "3/6", skillsDiscoveryStatus: "in_progress", careerExplorerMessagesSent: 5, lastLogin: "Today", @@ -33,8 +33,8 @@ const storyInstructorStudentsFixture: InstructorStudentRow[] = [ qualificationType: "Diploma (Level 5)", year: "Year 1", gender: "Male", - modulesExplored: 5, - careerReady: "5/6", + careerReadinessStarted: 5, + careerReadinessCompleted: "5/6", skillsDiscoveryStatus: "completed", careerExplorerMessagesSent: 1, lastLogin: "2 days ago", @@ -47,8 +47,8 @@ const storyInstructorStudentsFixture: InstructorStudentRow[] = [ qualificationType: "Certificate (Level 3)", year: "Year 3", gender: "Female", - modulesExplored: 2, - careerReady: "0/6", + careerReadinessStarted: 2, + careerReadinessCompleted: "0/6", skillsDiscoveryStatus: "not_started", careerExplorerMessagesSent: null, lastLogin: "1 week ago", diff --git a/admin-frontend/src/components/InstructorStudentsTable/InstructorStudentsTable.tsx b/admin-frontend/src/components/InstructorStudentsTable/InstructorStudentsTable.tsx index 6d79a09f..59cf6813 100644 --- a/admin-frontend/src/components/InstructorStudentsTable/InstructorStudentsTable.tsx +++ b/admin-frontend/src/components/InstructorStudentsTable/InstructorStudentsTable.tsx @@ -177,8 +177,8 @@ const InstructorStudentsTable: React.FC = ({ }, }, { - key: "modulesExplored", - label: t("instructorDashboard.studentsTable.headers.modulesCompleted"), + key: "careerReadinessStarted", + label: t("instructorDashboard.studentsTable.headers.careerReadinessStarted"), sortable: true, sortType: "number", align: "center", @@ -220,8 +220,8 @@ const InstructorStudentsTable: React.FC = ({ }, }, { - key: "careerReady", - label: t("instructorDashboard.studentsTable.headers.careerReady"), + key: "careerReadinessCompleted", + label: t("instructorDashboard.studentsTable.headers.careerReadinessCompleted"), sortable: true, sortType: "text", align: "center", diff --git a/admin-frontend/src/hooks/useInstructorStudents.ts b/admin-frontend/src/hooks/useInstructorStudents.ts index fb6f56a0..60d27a24 100644 --- a/admin-frontend/src/hooks/useInstructorStudents.ts +++ b/admin-frontend/src/hooks/useInstructorStudents.ts @@ -58,8 +58,8 @@ const toInstructorStudentRow = ( const gender = normalizeGender(toText(item.gender)) ?? PLACEHOLDER_SYMBOL; const lastActiveModuleId = toText(item.last_active_module) ?? PLACEHOLDER_SYMBOL; - const modulesExplored = item.modules_explored ?? 0; - const careerReady = item.career_readiness_modules_explored ?? 0; + const careerReadinessStarted = item.modules_explored ?? 0; + const careerReadinessCompleted = item.career_readiness_modules_explored ?? 0; return { id, studentName: name, @@ -67,8 +67,8 @@ const toInstructorStudentRow = ( qualificationType, year, gender, - modulesExplored, - careerReady: `${careerReady}/6`, + careerReadinessStarted, + careerReadinessCompleted: `${careerReadinessCompleted}/6`, skillsDiscoveryStatus: item.skills_discovery_status ?? "not_started", careerExplorerMessagesSent: item.career_explorer_messages_sent ?? null, lastLogin: formatLastLogin(item.last_login), diff --git a/admin-frontend/src/hooks/useInstructorStudentsTableState.ts b/admin-frontend/src/hooks/useInstructorStudentsTableState.ts index ba740d77..1cfd95da 100644 --- a/admin-frontend/src/hooks/useInstructorStudentsTableState.ts +++ b/admin-frontend/src/hooks/useInstructorStudentsTableState.ts @@ -10,8 +10,8 @@ export type StudentsSortKey = | "year" | "lastLogin" | "lastActiveModuleId" - | "modulesExplored" - | "careerReady" + | "careerReadinessStarted" + | "careerReadinessCompleted" | "skillsDiscoveryStatus" | "careerExplorerMessagesSent"; type SortDir = "asc" | "desc"; @@ -126,9 +126,9 @@ export function useInstructorStudentsTableState( if (key === "year") return normalizeYear(row.year); if (key === "lastLogin") return normalizeLastLogin(row.lastLogin); if (key === "lastActiveModuleId") return normalizeText(row.lastActiveModuleId); - if (key === "modulesExplored") return row.modulesExplored; - if (key === "careerReady") { - const ratio = fracRatio(row.careerReady); + if (key === "careerReadinessStarted") return row.careerReadinessStarted; + if (key === "careerReadinessCompleted") { + const ratio = fracRatio(row.careerReadinessCompleted); return Number.isNaN(ratio) ? null : ratio; } if (key === "skillsDiscoveryStatus") { diff --git a/admin-frontend/src/i18n/locales/en-GB/translation.json b/admin-frontend/src/i18n/locales/en-GB/translation.json index 901f261b..efd8f0cd 100644 --- a/admin-frontend/src/i18n/locales/en-GB/translation.json +++ b/admin-frontend/src/i18n/locales/en-GB/translation.json @@ -361,8 +361,8 @@ "year": "Year", "gender": "Gender", "profileStrength": "Profile Strength", - "modulesCompleted": "Career Readiness Modules Completed", - "careerReady": "Career Readiness Completed", + "careerReadinessStarted": "Career Readiness Started", + "careerReadinessCompleted": "Career Readiness Completed", "skillsInterestsExplored": "Build Your Profile", "careerExplorer": "Career Explorer", "prioritySectorsExplored": "Priority Sectors Explored", diff --git a/admin-frontend/src/i18n/locales/en-US/translation.json b/admin-frontend/src/i18n/locales/en-US/translation.json index ab77aaa5..0807db4a 100644 --- a/admin-frontend/src/i18n/locales/en-US/translation.json +++ b/admin-frontend/src/i18n/locales/en-US/translation.json @@ -360,8 +360,8 @@ "year": "Year", "gender": "Gender", "profileStrength": "Profile Strength", - "modulesCompleted": "Career Readiness Modules Completed", - "careerReady": "Career Readiness Completed", + "careerReadinessStarted": "Career Readiness Started", + "careerReadinessCompleted": "Career Readiness Completed", "skillsInterestsExplored": "Build Your Profile", "careerExplorer": "Career Explorer", "prioritySectorsExplored": "Priority Sectors Explored", diff --git a/admin-frontend/src/i18n/locales/es-AR/translation.json b/admin-frontend/src/i18n/locales/es-AR/translation.json index a2a0a2b0..422f36d4 100644 --- a/admin-frontend/src/i18n/locales/es-AR/translation.json +++ b/admin-frontend/src/i18n/locales/es-AR/translation.json @@ -368,8 +368,8 @@ "year": "Año", "gender": "Género", "profileStrength": "Fuerza del perfil", - "modulesCompleted": "Módulos de preparación profesional completados", - "careerReady": "Preparación profesional", + "careerReadinessStarted": "Módulos de preparación profesional comenzados", + "careerReadinessCompleted": "Preparación profesional", "skillsInterestsExplored": "Construí tu perfil", "careerExplorer": "Explorador de carrera", "prioritySectorsExplored": "Sectores prioritarios explorados", diff --git a/admin-frontend/src/i18n/locales/es-ES/translation.json b/admin-frontend/src/i18n/locales/es-ES/translation.json index 19727ac5..de3c8912 100644 --- a/admin-frontend/src/i18n/locales/es-ES/translation.json +++ b/admin-frontend/src/i18n/locales/es-ES/translation.json @@ -368,8 +368,8 @@ "year": "Año", "gender": "Género", "profileStrength": "Fuerza del perfil", - "modulesCompleted": "Módulos de preparación profesional completados", - "careerReady": "Preparación profesional", + "careerReadinessStarted": "Módulos de preparación profesional comenzados", + "careerReadinessCompleted": "Preparación profesional", "skillsInterestsExplored": "Construye tu perfil", "careerExplorer": "Explorador de carrera", "prioritySectorsExplored": "Sectores prioritarios explorados", diff --git a/admin-frontend/src/i18n/locales/ny-ZM/translation.json b/admin-frontend/src/i18n/locales/ny-ZM/translation.json index aa67087d..5d615251 100644 --- a/admin-frontend/src/i18n/locales/ny-ZM/translation.json +++ b/admin-frontend/src/i18n/locales/ny-ZM/translation.json @@ -368,8 +368,8 @@ "year": "Chaka", "gender": "Jenda", "profileStrength": "Mbiri Yamphamvu", - "modulesCompleted": "Ma module Okonzekera Ntchito Atsirizidwa", - "careerReady": "Kukonzekera Ntchito", + "careerReadinessStarted": "Ma module Okonzekera Ntchito ayamba", + "careerReadinessCompleted": "Kukonzekera Ntchito", "skillsInterestsExplored": "Pangani mbiri yanu", "careerExplorer": "Kufunafuna Ntchito", "prioritySectorsExplored": "Magawo Ofunika Kwambiri Afufuzidwa", diff --git a/admin-frontend/src/i18n/locales/pt-MZ/translation.json b/admin-frontend/src/i18n/locales/pt-MZ/translation.json index cf821655..a811b622 100644 --- a/admin-frontend/src/i18n/locales/pt-MZ/translation.json +++ b/admin-frontend/src/i18n/locales/pt-MZ/translation.json @@ -359,8 +359,8 @@ "year": "Ano", "gender": "Género", "profileStrength": "Força do Perfil", - "modulesCompleted": "Módulos de Preparação para a Carreira Concluídos", - "careerReady": "Preparação para a Carreira Concluída", + "careerReadinessStarted": "Módulos de Preparação para a Carreira Iniciados", + "careerReadinessCompleted": "Preparação para a Carreira Concluída", "skillsInterestsExplored": "Construa o Seu Perfil", "careerExplorer": "Explorador de Carreiras", "prioritySectorsExplored": "Setores Prioritários Explorados", diff --git a/admin-frontend/src/i18n/locales/sw-KE/translation.json b/admin-frontend/src/i18n/locales/sw-KE/translation.json index 5ac51d27..b8e81b6a 100644 --- a/admin-frontend/src/i18n/locales/sw-KE/translation.json +++ b/admin-frontend/src/i18n/locales/sw-KE/translation.json @@ -368,8 +368,8 @@ "year": "Mwaka", "gender": "Jinsia", "profileStrength": "Nguvu ya Wasifu", - "modulesCompleted": "Moduli za Utayari wa Kazi Zimekamilika", - "careerReady": "Kujiandaa kwa Kazi", + "careerReadinessStarted": "Moduli za Utayari wa Kazi Zilizoanza", + "careerReadinessCompleted": "Kujiandaa kwa Kazi", "skillsInterestsExplored": "Jenga wasifu wako", "careerExplorer": "Mtafiti wa Kazi", "prioritySectorsExplored": "Sekta za Kipaumbele Zilizogunduliwa", diff --git a/admin-frontend/src/types/index.ts b/admin-frontend/src/types/index.ts index 62c16007..14482b9d 100644 --- a/admin-frontend/src/types/index.ts +++ b/admin-frontend/src/types/index.ts @@ -35,8 +35,8 @@ export interface InstructorStudentRow { qualificationType: string; year: string; gender: string; - modulesExplored: number; - careerReady: string; + careerReadinessStarted: number; + careerReadinessCompleted: string; skillsDiscoveryStatus: "not_started" | "in_progress" | "completed"; careerExplorerMessagesSent: number | null; lastLogin: string;