Merge pull request #1827 from FlowerC9/fix/username-flexibility-added
Fix/username flexibility added
This commit is contained in:
2 files changed
+31
-6
No files matched your search
@@ -628,10 +628,19 @@ function Sidebar() {
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Avatar small={true} />
|
<Avatar small={true} />
|
||||||
<Box ml={theme.spacing(2)}>
|
<Box
|
||||||
|
ml={theme.spacing(2)}
|
||||||
|
sx={{ maxWidth: "50%", overflow: "hidden" }}
|
||||||
|
>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
fontWeight={500}
|
fontWeight={500}
|
||||||
|
sx={{
|
||||||
|
display: "block",
|
||||||
|
whiteSpace: "nowrap",
|
||||||
|
overflow: "hidden",
|
||||||
|
textOverflow: "ellipsis",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{authState.user?.firstName} {authState.user?.lastName}
|
{authState.user?.firstName} {authState.user?.lastName}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -706,12 +715,21 @@ function Sidebar() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{collapsed && (
|
{collapsed && (
|
||||||
<MenuItem sx={{ cursor: "default", minWidth: "150px" }}>
|
<MenuItem sx={{ cursor: "default", minWidth: "50%" }}>
|
||||||
<Box mb={theme.spacing(2)}>
|
<Box
|
||||||
|
mb={theme.spacing(2)}
|
||||||
|
sx={{ maxWidth: "50%", overflow: "hidden" }}
|
||||||
|
>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
fontWeight={500}
|
fontWeight={500}
|
||||||
fontSize={13}
|
fontSize={13}
|
||||||
|
sx={{
|
||||||
|
display: "block",
|
||||||
|
whiteSpace: "nowrap",
|
||||||
|
overflow: "hidden",
|
||||||
|
textOverflow: "ellipsis",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{authState.user?.firstName} {authState.user?.lastName}
|
{authState.user?.firstName} {authState.user?.lastName}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -7,11 +7,18 @@ const nameSchema = joi
|
|||||||
.string()
|
.string()
|
||||||
.max(50)
|
.max(50)
|
||||||
.trim()
|
.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({
|
.messages({
|
||||||
"string.empty": "Name is required",
|
"string.empty": "Name is required",
|
||||||
"string.max": "Name must be less than 50 characters long",
|
"string.max": "Name must be less than 50 characters",
|
||||||
"string.pattern.base": "Name must contain only letters",
|
"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
|
const passwordSchema = joi
|
||||||
|
|||||||
Reference in new issue
Block a user