-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
chore(a11y): ProfileView #6036
base: develop
Are you sure you want to change the base?
chore(a11y): ProfileView #6036
Conversation
233ca73
to
f92c7b7
Compare
|
||
// https://github.com/RocketChat/Rocket.Chat/blob/174c28d40b3d5a52023ee2dca2e81dd77ff33fa5/apps/meteor/app/lib/server/functions/saveUser.js#L24-L25 | ||
const MAX_BIO_LENGTH = 260; | ||
const MAX_NICKNAME_LENGTH = 120; | ||
const passwordRules = /^(?!.*(.)\1{2})^(?=.*[a-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,24}$/; |
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.
Where did you get this from?
Password policy are built around admin choices
}, | ||
resolver: yupResolver(validationSchema) | ||
}); | ||
const parsedCustomFields = getParsedCustomFields(Accounts_CustomFields); |
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.
Since getParsedCustomFields
does a serialization with a try/catch, I think it makes sense to make it a custom hook with useMemo.
The way it is right now, getParsedCustomFields
is called on every render, which does a JSON.parse
.
You can use useMemo
to run these parses only once and a custom hook would remove the need of a getParsedCustomFields
file, since you're going to add the whole logic inside useParsedCustomFields
file.
return null; | ||
} | ||
try { | ||
const parsedCustomFields = JSON.parse(Accounts_CustomFields); |
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.
Same thing.
Just use useParsedCustomFields
Proposed changes
Migrate ProfileView to hooks and Added accessibility features to the RegisterView.
Issue(s)
https://rocketchat.atlassian.net/browse/MA-198
https://rocketchat.atlassian.net/browse/NATIVE-19
How to test or reproduce
Screenshots
Types of changes
Checklist
Further comments