From c42dbaeff717af611a22432c2a8a32732e141c6f Mon Sep 17 00:00:00 2001 From: Disura Randunu <37591051+Disura-Randunu@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:57:54 +0530 Subject: [PATCH 01/12] Make monthly checkins optional (#219) --- src/schemas.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas.ts b/src/schemas.ts index e1f8ed3..b73406f 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -131,7 +131,7 @@ export const MenteeCheckInSchema = z.object({ progressTowardsGoals: z.string().min(5, 'Please summarize your progress'), mediaContentLinks: z .array(z.string().url('Please provide a valid URL')) - .min(1, 'Please provide at least 1 media links'), + .optional(), }); export const MentorFeedbackSchema = z.object({ From eebbcf0e626c2ab3f9a740e13a8a989bbe01941e Mon Sep 17 00:00:00 2001 From: Kavindu Deshappriya Gammanpila Date: Sat, 23 Nov 2024 19:02:46 +0530 Subject: [PATCH 02/12] Fix overflowing issue on ongoing mentorship page (#220) --- .../OngoingMentorshipPrograms/OngoingMentorshipPrograms.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Dashboard/scenes/OngoingMentorshipPrograms/OngoingMentorshipPrograms.tsx b/src/pages/Dashboard/scenes/OngoingMentorshipPrograms/OngoingMentorshipPrograms.tsx index 7e0952f..1103e65 100644 --- a/src/pages/Dashboard/scenes/OngoingMentorshipPrograms/OngoingMentorshipPrograms.tsx +++ b/src/pages/Dashboard/scenes/OngoingMentorshipPrograms/OngoingMentorshipPrograms.tsx @@ -52,7 +52,7 @@ const OngoingMentorshipPrograms: React.FC = () => {

Approved Mentees

-
+
{approvedMentees.map(renderMenteeLink)} {approvedMentees.length === 0 && (

No approved mentees available.

From d81a17f75726f9eef079dfe0f952d198e4ef7158 Mon Sep 17 00:00:00 2001 From: Kavindu Deshappriya Gammanpila Date: Sat, 23 Nov 2024 20:05:08 +0530 Subject: [PATCH 03/12] Fix the wrong validation error message issue (#222) --- .../MenteeCheckInFormModal.component.tsx | 10 +++++----- src/schemas.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/MonthlyChecking/MenteeCheckInFormModal.component.tsx b/src/components/MonthlyChecking/MenteeCheckInFormModal.component.tsx index 9cc7f1d..03a0870 100644 --- a/src/components/MonthlyChecking/MenteeCheckInFormModal.component.tsx +++ b/src/components/MonthlyChecking/MenteeCheckInFormModal.component.tsx @@ -39,7 +39,7 @@ const MonthlyCheckInModal: React.FC<{ } = useForm({ resolver: zodResolver(MenteeCheckInSchema), defaultValues: { - title: '', + month: '', progressTowardsGoals: '', generalUpdatesAndFeedback: '', mediaContentLinks: [], @@ -107,9 +107,9 @@ const MonthlyCheckInModal: React.FC<{ Select the month for which you are submitting the progress.

- {errors.title && ( + {errors.month && (

- {errors.title.message} + {errors.month.message}

)}
diff --git a/src/schemas.ts b/src/schemas.ts index b73406f..1933f22 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -124,7 +124,7 @@ export const MentorApplicationSchema = z.object({ }); export const MenteeCheckInSchema = z.object({ - title: z.string().min(1, 'Title is required'), + month: z.string().min(1, 'Month is required'), generalUpdatesAndFeedback: z .string() .min(5, 'Please provide general updates'), From a93deed90769e3ceb143a77eb3fa21462f84cc71 Mon Sep 17 00:00:00 2001 From: Dwayne Dehoedt Date: Sun, 24 Nov 2024 21:30:23 +0530 Subject: [PATCH 04/12] Fix #200 Hide Website Link on Mentor Profile When Not Provided (#225) --- .../MentorProfile/MentorProfile.component.tsx | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/pages/MentorProfile/MentorProfile.component.tsx b/src/pages/MentorProfile/MentorProfile.component.tsx index 8e86cb3..2f0a9bd 100644 --- a/src/pages/MentorProfile/MentorProfile.component.tsx +++ b/src/pages/MentorProfile/MentorProfile.component.tsx @@ -193,22 +193,26 @@ const MentorProfile: React.FC = () => {
- - Linkedin - - - Website - + + {mentor?.application.linkedin && ( + + Linkedin + + )} + + {mentor?.application.website && ( + + Website + + )}
From 991d87bd09adbfa5ab6fe315091cbe19708c4b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Y=D3=A8=C6=A7=CE=89I=C6=AC=CE=89=CE=9B=20=D0=AF=CE=9B?= =?UTF-8?q?=C6=AC=CE=89=D0=9F=CE=9BY=CE=9BK=CE=A3?= Date: Thu, 5 Dec 2024 08:42:23 +0530 Subject: [PATCH 05/12] Add the ScholarX Development Setup Guide to the readme.md file (#228) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ec765be..31aa72b 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ Frontend dashboard of the scholarX platform ## Setup Development Environment +### **Project setup walkthrough :- https://youtu.be/1STopJMM2nM** + 1. Clone your forked repository ``` git clone https://github.com/USERNAME/scholarx-frontend From 2d4093f895d27ef98166c378c4f0355cade4a924 Mon Sep 17 00:00:00 2001 From: Dilan Kavishka <109354298+dilankavishka@users.noreply.github.com> Date: Sat, 7 Dec 2024 20:37:24 +0530 Subject: [PATCH 06/12] Add country select dropdown (#230) Co-authored-by: Anjula Shanaka --- src/hooks/useCountries.ts | 22 ++++++++++++ .../MentorRegistration.component.tsx | 34 ++++++++++++++----- 2 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 src/hooks/useCountries.ts diff --git a/src/hooks/useCountries.ts b/src/hooks/useCountries.ts new file mode 100644 index 0000000..656fdfb --- /dev/null +++ b/src/hooks/useCountries.ts @@ -0,0 +1,22 @@ +import { useQuery } from '@tanstack/react-query'; +import { API_URL } from '../constants'; +import axios from 'axios'; + +const useCountries = () => { + const { isLoading, error, data } = useQuery({ + queryKey: ['countries'], + initialData: [], + queryFn: async () => { + const { data } = await axios.get(`${API_URL}/countries`); + return data.data; + }, + }); + + return { + isLoading, + error, + data, + }; +}; + +export default useCountries; diff --git a/src/pages/MentorRegistration/MentorRegistration.component.tsx b/src/pages/MentorRegistration/MentorRegistration.component.tsx index aed43ad..1d41b94 100644 --- a/src/pages/MentorRegistration/MentorRegistration.component.tsx +++ b/src/pages/MentorRegistration/MentorRegistration.component.tsx @@ -14,6 +14,7 @@ import { useLoginModalContext } from '../../contexts/LoginModalContext'; import useMentor from '../../hooks/useMentor'; import { Link } from 'react-router-dom'; import TermsAgreementModalMentor from '../../components/TermsAgreementModal'; +import useCountries from '../../hooks/useCountries'; const steps = [ { @@ -63,6 +64,12 @@ const MentorRegistrationPage: React.FC = () => { error: categoriesError, } = useCategories(); + const { + data: allCountries, + isLoading: countriesLoading, + error: countriesError, + } = useCountries(); + const { createMentorApplication, applicationError, @@ -265,14 +272,25 @@ const MentorRegistrationPage: React.FC = () => { register={register} error={errors.contactNo} /> - +
+ + {!countriesLoading && ( + + )} +
)} {currentStep === 1 && ( From cdc3413d232b18560fa9c0942587c7ca5868080d Mon Sep 17 00:00:00 2001 From: Thenuka Dinudaya Gurusinghe <124603416+thenukadinudaya@users.noreply.github.com> Date: Sat, 7 Dec 2024 22:02:36 +0530 Subject: [PATCH 07/12] Remove the comma after mentee application position (#231) --- src/components/MenteeCard/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MenteeCard/index.tsx b/src/components/MenteeCard/index.tsx index 37b2977..b59eef0 100644 --- a/src/components/MenteeCard/index.tsx +++ b/src/components/MenteeCard/index.tsx @@ -39,7 +39,7 @@ const MenteeCard: React.FC = ({

) : ( <> -

{mentee.application.position}

, +

{mentee.application.position}

{mentee.application.company}

From 881499153cdd727524987c5dc09529a8f037923d Mon Sep 17 00:00:00 2001 From: Disura Randunu <37591051+Disura-Randunu@users.noreply.github.com> Date: Sun, 8 Dec 2024 19:27:20 +0530 Subject: [PATCH 08/12] Redirect for specific dashboard after login (#229) --- src/components/Layout/Navbar/index.tsx | 14 ++++++++++++++ .../MentorProfile/MentorProfile.component.tsx | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/Layout/Navbar/index.tsx b/src/components/Layout/Navbar/index.tsx index 07ad6a5..0c6b066 100644 --- a/src/components/Layout/Navbar/index.tsx +++ b/src/components/Layout/Navbar/index.tsx @@ -74,6 +74,20 @@ const Navbar: React.FC = () => { }; }, []); + useEffect(() => { + if (user) { + if (isUserMentor) { + navigate('/mentor/dashboard'); + } else if (isUserAdmin) { + navigate('/admin/dashboard/mentor-applications'); + } else if (isUserMentee) { + navigate('/mentee/dashboard'); + } else { + navigate('/'); + } + } + }, [user]); + return (