Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

fix: Add username warning

Open YashGupta2111 opened this issue 1 year ago • 4 comments

Issue - #31641

This is my first PR in RocketChat

I added a feature that shows a warning if the username you type is not acceptable. This helps you know if the username you chose is okay or if you need to pick a different one

https://github.com/RocketChat/Rocket.Chat/assets/122914867/5fac8869-72b9-45d5-8d15-fe480d76829f

Steps to test or reproduce

To test, go to https://localhost:3000/admin/users/new, click on 'New User', and enter the username.

YashGupta2111 avatar Feb 08 '24 07:02 YashGupta2111

⚠️ No Changeset found

Latest commit: 1a60eaef8fb4920af27eaf2f356be8ef431da6c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Feb 08 '24 07:02 changeset-bot[bot]

We need to validate the settings to... We cannot trust blindly in the regex

UTF8_User_Names_Validation, check setUsernameWithValidation to see backend validatiosn

@hugocostadev Sir, can you clarify?

YashGupta2111 avatar Feb 09 '24 17:02 YashGupta2111

We need to validate the settings to... We cannot trust blindly in the regex UTF8_User_Names_Validation, check setUsernameWithValidation to see backend validatiosn

@hugocostadev Sir, can you clarify?

We can't just infer that this Regex is the only pattern for usernames, there are some other settings like UTF8_User_Names_Validation ( docs here ) and Accounts_BlockedUsernameList .

Check the backend function that does that validation now, it's called setUsernameWithValidation

hugocostadev avatar Feb 09 '24 18:02 hugocostadev

We need to validate the settings to... We cannot trust blindly in the regex UTF8_User_Names_Validation, check setUsernameWithValidation to see backend validatiosn

@hugocostadev Sir, can you clarify?

We can't just infer that this Regex is the only pattern for usernames, there are some other settings like UTF8_User_Names_Validation ( docs here ) and Accounts_BlockedUsernameList .

Check the backend function that does that validation now, it's called setUsernameWithValidation

@hugocostadev Sir, I have made some changes to the code. Could you please review them?

YashGupta2111 avatar Feb 13 '24 12:02 YashGupta2111

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

dionisio-bot[bot] avatar Apr 12 '24 19:04 dionisio-bot[bot]