From a665d5397e187d18b4d4e9f0cc3d8f9ad62e041d Mon Sep 17 00:00:00 2001 From: Arjun C Vinod Date: Thu, 6 Jun 2024 00:17:17 +0530 Subject: [PATCH 1/4] fix(bug):Fixed null mobile number handling and added validation. --- .../Dashboard/modules/ManageUsers/UserForm.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/Dashboard/modules/ManageUsers/UserForm.tsx b/src/modules/Dashboard/modules/ManageUsers/UserForm.tsx index cf3fa4f2c..a472ee4e3 100644 --- a/src/modules/Dashboard/modules/ManageUsers/UserForm.tsx +++ b/src/modules/Dashboard/modules/ManageUsers/UserForm.tsx @@ -142,7 +142,15 @@ const UserForm = forwardRef( const handleChange = (e: React.ChangeEvent) => { const { name, value } = e.target; - setData(prevData => ({ ...prevData, [name]: value })); + if (name === "mobile" && value && !/^\+?\d{0,12}$/.test(value.trim())) { + setErrors(prevErrors => ({ + ...prevErrors, + mobile: "Invalid format" + })); + } else { + setErrors(prevErrors => ({ ...prevErrors, mobile: undefined })); + setData(prevData => ({ ...prevData, [name]: value.trim() || " " })); + } }; const handleYearChange = (e: React.ChangeEvent) => { @@ -373,7 +381,7 @@ const UserForm = forwardRef(
Date: Sat, 8 Jun 2024 16:24:22 +0530 Subject: [PATCH 2/4] refactor(update):Wadhwani course description length updated --- src/modules/Dashboard/modules/Wadhwani/index.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/modules/Dashboard/modules/Wadhwani/index.tsx b/src/modules/Dashboard/modules/Wadhwani/index.tsx index 59c9b1755..5b4c57b1a 100644 --- a/src/modules/Dashboard/modules/Wadhwani/index.tsx +++ b/src/modules/Dashboard/modules/Wadhwani/index.tsx @@ -90,10 +90,17 @@ function getRootIdByTitle(titleToSearch: string): string { console.log(course?.courseName + titleToSearch) return course ? course.courseRootId : "null"; } - - function stringSlice(inputString: string): string { - return inputString.substring(3, 200); +function stringSlice(inputString: string): string { + const secondPeriodIndex = inputString.indexOf( + ".", + inputString.indexOf(".") + 1 + ); + if (secondPeriodIndex !== -1) { + return inputString.substring(0, secondPeriodIndex + 1).trim(); } + return inputString.substring(0, 200); +} + const CourseCard: React.FC = ({ title, desc, duration, rootId }) => { return (
@@ -108,7 +115,6 @@ function getRootIdByTitle(titleToSearch: string): string {
); }; - return (

Wadhwani Foundation Courses

From c9706c30c101c45a6d13cd5a5583a42f446e8d77 Mon Sep 17 00:00:00 2001 From: Arjun C Vinod Date: Sat, 8 Jun 2024 16:25:10 +0530 Subject: [PATCH 3/4] feat(loader):Muloader added --- src/modules/Dashboard/modules/Wadhwani/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/Dashboard/modules/Wadhwani/index.tsx b/src/modules/Dashboard/modules/Wadhwani/index.tsx index 5b4c57b1a..05a1e80bf 100644 --- a/src/modules/Dashboard/modules/Wadhwani/index.tsx +++ b/src/modules/Dashboard/modules/Wadhwani/index.tsx @@ -115,6 +115,9 @@ function stringSlice(inputString: string): string {
); }; + if (isLoading) { + return ; + } return (

Wadhwani Foundation Courses

From 53cdf95a59108be726c9ed68575caea41eb05930 Mon Sep 17 00:00:00 2001 From: Arjun C Vinod Date: Sat, 8 Jun 2024 16:29:54 +0530 Subject: [PATCH 4/4] style(wadhwani): Added cursor pointer for course button --- src/modules/Dashboard/modules/Wadhwani/index.module.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/Dashboard/modules/Wadhwani/index.module.css b/src/modules/Dashboard/modules/Wadhwani/index.module.css index 456268457..023487c11 100644 --- a/src/modules/Dashboard/modules/Wadhwani/index.module.css +++ b/src/modules/Dashboard/modules/Wadhwani/index.module.css @@ -100,4 +100,5 @@ color: white; padding: 0.5rem 1rem; border-radius: 5px; + cursor: pointer; } \ No newline at end of file