-
Notifications
You must be signed in to change notification settings - Fork 103
fix(condo): DOMA-12068 add profile name char check #7228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -53,6 +53,7 @@ export const UserProfileForm: React.FC = () => { | |||||||||||||||||||||||||||||||||||||||||||
| const ApplyChangesMessage = intl.formatMessage({ id: 'ApplyChanges' }) | ||||||||||||||||||||||||||||||||||||||||||||
| const MinLengthError = intl.formatMessage({ id: 'field.ClientName.minLengthError' }) | ||||||||||||||||||||||||||||||||||||||||||||
| const MaxLengthError = intl.formatMessage({ id: 'field.ClientName.maxLengthError' }) | ||||||||||||||||||||||||||||||||||||||||||||
| const FullNameInvalidCharMessage = intl.formatMessage({ id:'field.FullName.invalidChar' }) | ||||||||||||||||||||||||||||||||||||||||||||
| const ProfileUpdateTitle = intl.formatMessage({ id: 'profile.Update' }) | ||||||||||||||||||||||||||||||||||||||||||||
| const EmailIsAlreadyRegisteredMsg = intl.formatMessage({ id: 'pages.auth.EmailIsAlreadyRegistered' }) | ||||||||||||||||||||||||||||||||||||||||||||
| const ChangePasswordLabel = intl.formatMessage({ id: 'profile.ChangePassword' }) | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -197,12 +198,12 @@ export const UserProfileForm: React.FC = () => { | |||||||||||||||||||||||||||||||||||||||||||
| router.push('/user') | ||||||||||||||||||||||||||||||||||||||||||||
| }, [router]) | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| const { requiredValidator, emailValidator, changeMessage, minLengthValidator, maxLengthValidator } = useValidations() | ||||||||||||||||||||||||||||||||||||||||||||
| const { requiredValidator, emailValidator, changeMessage, minLengthValidator, maxLengthValidator, specCharValidator } = useValidations() | ||||||||||||||||||||||||||||||||||||||||||||
| const minClientNameRule = changeMessage(minLengthValidator(2), MinLengthError) | ||||||||||||||||||||||||||||||||||||||||||||
| const maxClientNameRule = changeMessage(maxLengthValidator(100), MaxLengthError) | ||||||||||||||||||||||||||||||||||||||||||||
| const validations = { | ||||||||||||||||||||||||||||||||||||||||||||
| email: [emailValidator], | ||||||||||||||||||||||||||||||||||||||||||||
| name: [requiredValidator, minClientNameRule, maxClientNameRule], | ||||||||||||||||||||||||||||||||||||||||||||
| name: [requiredValidator, changeMessage(specCharValidator, FullNameInvalidCharMessage), minClientNameRule, maxClientNameRule], | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+201
to
207
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add On Line 206, Suggested patch- const { requiredValidator, emailValidator, changeMessage, minLengthValidator, maxLengthValidator, specCharValidator } = useValidations()
+ const { requiredValidator, emailValidator, changeMessage, minLengthValidator, maxLengthValidator, trimValidator, specCharValidator } = useValidations()
@@
- name: [requiredValidator, changeMessage(specCharValidator, FullNameInvalidCharMessage), minClientNameRule, maxClientNameRule],
+ name: [
+ requiredValidator,
+ trimValidator,
+ changeMessage(specCharValidator, FullNameInvalidCharMessage),
+ minClientNameRule,
+ maxClientNameRule,
+ ],📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| const initialValues = useMemo(() => ({ | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after colon in
id:(should beid:)Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!