Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions web/sdk/react/components/organization/user/update.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,20 @@ const generalSchema = yup
.required('Name is required')
.min(2, 'Name must be at least 2 characters')
.matches(
/^[a-zA-Z\s'-]+$/,
'Name can only contain letters, spaces, hyphens, and apostrophes'
/^[\p{L} .'-]+$/u,
'Name can only contain letters, spaces, periods, hyphens, and apostrophes'
)
.matches(/^\p{L}/u, 'Name must start with a letter')
.matches(
/^\p{L}[\p{L} .'-]*\p{L}$|^\p{L}$/u,
'Name must end with a letter'
)
.matches(/^(?!.* {2}).*$/, 'Name cannot have consecutive spaces')
.matches(/^(?!.* [^\p{L}]).*$/u, 'Spaces must be followed by a letter')
.matches(/^(?!.*-[^\p{L}]).*$/u, 'Hyphens must be followed by a letter')
.matches(
/^(?!.*'[^\p{L}]).*$/u,
'Apostrophes must be followed by a letter'
),
email: yup.string().email().required()
})
Expand Down
Loading