From ea4fa8994ff618f907330592092407457f1f5afc Mon Sep 17 00:00:00 2001 From: Iryna Lypnyk Date: Mon, 8 Jun 2026 10:37:41 +0100 Subject: [PATCH 1/3] feat(#686): include mentee profile in mentor applications --- .../mentorship/MenteeApplicationResponse.java | 35 ++++++++++++++++--- .../service/MenteeWorkflowService.java | 3 +- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/wcc/platform/domain/platform/mentorship/MenteeApplicationResponse.java b/src/main/java/com/wcc/platform/domain/platform/mentorship/MenteeApplicationResponse.java index a995e44a..7fb7cbfb 100644 --- a/src/main/java/com/wcc/platform/domain/platform/mentorship/MenteeApplicationResponse.java +++ b/src/main/java/com/wcc/platform/domain/platform/mentorship/MenteeApplicationResponse.java @@ -29,7 +29,24 @@ public record MenteeApplicationResponse( long daysSinceApplied, String menteeName, String menteeLinkedIn, - String menteeBio) { + String menteeBio, + Mentee mentee) { + + /** + * Creates an enriched response from a MenteeApplication and full mentee profile. + * + * @param application the base application + * @param mentee the mentee profile + * @return enriched response with mentee information + */ + public static MenteeApplicationResponse from( + final MenteeApplication application, final Mentee mentee) { + if (mentee == null) { + return from(application); + } + + return from(application, mentee.getFullName(), mentee.getNetwork(), mentee.getBio(), mentee); + } /** * Creates an enriched response from a MenteeApplication and mentee details. @@ -45,6 +62,15 @@ public static MenteeApplicationResponse from( final String menteeName, final List networks, final String bio) { + return from(application, menteeName, networks, bio, null); + } + + private static MenteeApplicationResponse from( + final MenteeApplication application, + final String menteeName, + final List networks, + final String bio, + final Mentee mentee) { final String linkedIn = extractLinkedIn(networks); @@ -68,7 +94,8 @@ public static MenteeApplicationResponse from( application.getDaysSinceApplied(), menteeName, linkedIn, - bio); + bio, + mentee); } /** @@ -79,7 +106,7 @@ public static MenteeApplicationResponse from( * @return response without enriched mentee information */ public static MenteeApplicationResponse from(final MenteeApplication application) { - return from(application, null, List.of(), null); + return from(application, null, List.of(), null, null); } private static String extractLinkedIn(final List networks) { @@ -92,4 +119,4 @@ private static String extractLinkedIn(final List networks) { .findFirst() .orElse(null); } -} \ No newline at end of file +} diff --git a/src/main/java/com/wcc/platform/service/MenteeWorkflowService.java b/src/main/java/com/wcc/platform/service/MenteeWorkflowService.java index cba04979..e49230cf 100644 --- a/src/main/java/com/wcc/platform/service/MenteeWorkflowService.java +++ b/src/main/java/com/wcc/platform/service/MenteeWorkflowService.java @@ -298,8 +298,7 @@ private List enrichApplications( app -> { final Mentee mentee = menteeMap.get(app.getMenteeId()); if (mentee != null) { - return MenteeApplicationResponse.from( - app, mentee.getFullName(), mentee.getNetwork(), mentee.getBio()); + return MenteeApplicationResponse.from(app, mentee); } return MenteeApplicationResponse.from(app); }) From 8ec1180a3e7fb2d0fc6cb655332f9a998ee67aa9 Mon Sep 17 00:00:00 2001 From: Iryna Lypnyk Date: Mon, 8 Jun 2026 13:10:55 +0100 Subject: [PATCH 2/3] feat(#683): add mentee profile card to reviewing mentor applications page --- .../__tests__/pages/admin/mentor.test.tsx | 42 ++++++++++ admin-wcc-app/pages/admin/mentor.tsx | 80 +------------------ admin-wcc-app/types/menteeApplication.ts | 5 +- 3 files changed, 48 insertions(+), 79 deletions(-) diff --git a/admin-wcc-app/__tests__/pages/admin/mentor.test.tsx b/admin-wcc-app/__tests__/pages/admin/mentor.test.tsx index 36af0906..208dce97 100644 --- a/admin-wcc-app/__tests__/pages/admin/mentor.test.tsx +++ b/admin-wcc-app/__tests__/pages/admin/mentor.test.tsx @@ -49,6 +49,48 @@ const reviewingApp = { reviewed: false, matched: false, daysSinceApplied: 3, + mentee: { + id: 7, + fullName: 'Mentee #7', + position: 'Frontend Developer', + email: 'mentee7@example.com', + slackDisplayName: '@mentee7', + country: { + countryCode: 'GB', + countryName: 'United Kingdom', + }, + city: 'London', + companyName: 'Test Company', + memberTypes: ['Mentee'], + images: [], + network: [ + { + type: 'linkedin', + link: 'https://www.linkedin.com/in/test-mentee', + }, + ], + isWomen: true, + profileStatus: 'ACTIVE', + skills: { + yearsExperience: 2, + areas: [ + { + technicalArea: 'FRONTEND', + proficiencyLevel: 'INTERMEDIATE', + }, + ], + languages: [ + { + language: 'JAVASCRIPT', + proficiencyLevel: 'INTERMEDIATE', + }, + ], + mentorshipFocus: ['GROW_BEGINNER_TO_MID'], + }, + bio: 'Test mentee bio', + spokenLanguages: ['English'], + availableHsMonth: 4, + }, }; const pendingApp = { diff --git a/admin-wcc-app/pages/admin/mentor.tsx b/admin-wcc-app/pages/admin/mentor.tsx index f1d9fa74..01faa7d4 100644 --- a/admin-wcc-app/pages/admin/mentor.tsx +++ b/admin-wcc-app/pages/admin/mentor.tsx @@ -33,6 +33,7 @@ import { } from '@/services/menteeService'; import { MenteeApplication } from '@/types/menteeApplication'; import LinkedInIcon from '@mui/icons-material/LinkedIn'; +import MenteeCard from '@/components/mentorship/MenteeCard'; interface MemberWithId { id: number; @@ -313,9 +314,6 @@ export default function MentorDashboardPage() { Mentee - - Bio - Message @@ -329,87 +327,13 @@ export default function MentorDashboardPage() { {pendingApplications.map((app) => { - const name = app.menteeName || `Mentee #${app.menteeId}`; return ( - - {getInitials(name)} - - {name} - {app.menteeLinkedIn && ( - - )} + - - {app.menteeBio ? ( - expandedBioId === app.applicationId ? ( - - - {app.menteeBio} - - - - ) : ( - - { - if (el) { - bioRefs.current.set(app.applicationId, el); - } else { - bioRefs.current.delete(app.applicationId); - } - }} - sx={{ - display: '-webkit-box', - WebkitLineClamp: 2, - WebkitBoxOrient: 'vertical', - overflow: 'hidden', - }} - > - {app.menteeBio} - - {overflowingBioIds.has(app.applicationId) && ( - - )} - - ) - ) : ( - - - - - )} - {expandedMessageId === app.applicationId ? ( diff --git a/admin-wcc-app/types/menteeApplication.ts b/admin-wcc-app/types/menteeApplication.ts index e84fb83e..0968d67d 100644 --- a/admin-wcc-app/types/menteeApplication.ts +++ b/admin-wcc-app/types/menteeApplication.ts @@ -1,3 +1,6 @@ +import { MenteeItem } from '@/types/mentorship'; +import type { SocialNetwork } from '@/types/member'; + export type ApplicationStatus = | 'PENDING' | 'MENTOR_REVIEWING' @@ -29,6 +32,7 @@ export interface MenteeApplication { menteeName?: string; menteeLinkedIn?: string; menteeBio?: string; + mentee: MenteeItem; } export interface MenteeSkillArea { @@ -56,7 +60,6 @@ export interface MenteeImage { export { SocialNetworkType } from '@/types/member'; export type { SocialNetwork, SocialNetworkTypeValue } from '@/types/member'; -import type { SocialNetwork } from '@/types/member'; export interface DashboardMentee { id: number; From 619458122c75941464f252339e18b91f1755ac9b Mon Sep 17 00:00:00 2001 From: Iryna Lypnyk Date: Tue, 9 Jun 2026 22:30:47 +0100 Subject: [PATCH 3/3] test(#686): cover nested mentee in mentor applications --- .../service/MenteeApplicationEnrichedTest.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/wcc/platform/service/MenteeApplicationEnrichedTest.java b/src/test/java/com/wcc/platform/service/MenteeApplicationEnrichedTest.java index eddafe4a..887127fc 100644 --- a/src/test/java/com/wcc/platform/service/MenteeApplicationEnrichedTest.java +++ b/src/test/java/com/wcc/platform/service/MenteeApplicationEnrichedTest.java @@ -65,11 +65,18 @@ void shouldReturnEnrichedApplicationsWithMenteeInfo() { final List result = service.getMentorApplications(MENTOR_ID); assertThat(result).hasSize(1); - assertThat(result.get(0).menteeName()).isEqualTo("Jane Doe"); - assertThat(result.get(0).menteeLinkedIn()).isEqualTo("https://linkedin.com/in/janedoe"); - assertThat(result.get(0).menteeBio()).isEqualTo("A passionate developer"); - assertThat(result.get(0).applicationId()).isEqualTo(1L); - assertThat(result.get(0).menteeId()).isEqualTo(MENTEE_ID); + final MenteeApplicationResponse response = result.get(0); + + assertThat(response.menteeName()).isEqualTo("Jane Doe"); + assertThat(response.menteeLinkedIn()).isEqualTo("https://linkedin.com/in/janedoe"); + assertThat(response.menteeBio()).isEqualTo("A passionate developer"); + assertThat(response.applicationId()).isEqualTo(1L); + assertThat(response.menteeId()).isEqualTo(MENTEE_ID); + + assertThat(response.mentee()).isNotNull(); + assertThat(response.mentee().getId()).isEqualTo(MENTEE_ID); + assertThat(response.mentee().getFullName()).isEqualTo("Jane Doe"); + assertThat(response.mentee().getBio()).isEqualTo("A passionate developer"); } @Test @@ -99,6 +106,7 @@ void shouldReturnNullEnrichedFieldsWhenMenteeNotFound() { assertThat(result.get(0).menteeName()).isNull(); assertThat(result.get(0).menteeLinkedIn()).isNull(); assertThat(result.get(0).menteeBio()).isNull(); + assertThat(result.get(0).mentee()).isNull(); } @Test