From 372b6738866865b41c048b3cbc2171f6710d226c Mon Sep 17 00:00:00 2001 From: Monojit Tewari Date: Wed, 26 Feb 2025 14:36:18 +0530 Subject: [PATCH 1/4] added flexibility to add non-ascii letter or spaces in username --- src/Validation/validation.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Validation/validation.js b/src/Validation/validation.js index 68c0b5f12..a243b37e8 100644 --- a/src/Validation/validation.js +++ b/src/Validation/validation.js @@ -7,11 +7,18 @@ const nameSchema = joi .string() .max(50) .trim() - .pattern(/^[A-Za-z]+$/) + .pattern(/^(?=.*[\p{L}\p{Sc}])[\p{L}\p{Sc}\s']+$/u, { + name: "name.containsLetterOrSymbol", + }) + .pattern(/^[\p{L}\p{Sc}\s']+$/u, { + name: "name.validCharacters", + }) .messages({ "string.empty": "Name is required", - "string.max": "Name must be less than 50 characters long", - "string.pattern.base": "Name must contain only letters", + "string.max": "Name must be less than 50 characters", + "string.pattern.name": "Name must contain at least 1 letter or currency symbol", + "string.pattern.base.validCharacters": + "Can only contain letters, spaces, apostrophes, and currency symbols", }); const passwordSchema = joi From f1cf836bdcd73430046e2c0db46f4efd22f27ee0 Mon Sep 17 00:00:00 2001 From: Monojit Tewari Date: Wed, 26 Feb 2025 16:05:41 +0530 Subject: [PATCH 2/4] added flexibility to add non-ascii letter or spaces in username --- src/Components/Sidebar/index.jsx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/Components/Sidebar/index.jsx b/src/Components/Sidebar/index.jsx index 2d5d7636f..bc5705e61 100644 --- a/src/Components/Sidebar/index.jsx +++ b/src/Components/Sidebar/index.jsx @@ -628,10 +628,19 @@ function Sidebar() { ) : ( <> - + {authState.user?.firstName} {authState.user?.lastName} @@ -707,11 +716,20 @@ function Sidebar() { > {collapsed && ( - + {authState.user?.firstName} {authState.user?.lastName} From cdc2306e4c09fd2c97f3660cd38e838256776c66 Mon Sep 17 00:00:00 2001 From: Monojit Tewari Date: Thu, 27 Feb 2025 09:49:39 +0530 Subject: [PATCH 3/4] relative width applied to sidebar profile view --- src/Components/Sidebar/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/Sidebar/index.jsx b/src/Components/Sidebar/index.jsx index bc5705e61..399d8be75 100644 --- a/src/Components/Sidebar/index.jsx +++ b/src/Components/Sidebar/index.jsx @@ -630,7 +630,7 @@ function Sidebar() { Date: Thu, 27 Feb 2025 09:55:50 +0530 Subject: [PATCH 4/4] relative width applied to sidebar profile view --- src/Components/Sidebar/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Sidebar/index.jsx b/src/Components/Sidebar/index.jsx index 399d8be75..ee0071d4f 100644 --- a/src/Components/Sidebar/index.jsx +++ b/src/Components/Sidebar/index.jsx @@ -715,7 +715,7 @@ function Sidebar() { }} > {collapsed && ( - +