Handle invisible characters in forms#27414
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
095cfd8 to
a1a7dc3
Compare
|
@kosmydel please update QA step in more detail. |
Merged with the main & slightly updated the PR. |
|
To create room, enable beta in Permissions.js and then go to FAB > Send message > Room tab |
cc @situchan done, thanks! |
|
Server is down - https://expensify.slack.com/archives/C01GTK53T8Q/p1695314249132269 |
|
@kosmydel please fix conflict |
|
No problem. Thanks for the update |
|
Hey @situchan, there is a problem with implementing it in the new Form component. It doesn't implement full validation yet. Here is how the validation looks right now. I've talked with @kowczarz and he is preparing an update to the new component form. I think that we should wait for his changes to be merged. Alternatively, we can process with only the old Form component and create a new PR with changes to the new one. The problem is, that some of the components are already migrated to the new Form (e.g. |
|
I think we can still wait as this is not critical bug. |
|
@kosmydel is there any one GH issue or PR against which I can hold this PR? |
|
Hey @hayata-suenaga |
|
Hey @situchan, I've resolved conflicts. Sorry for the delay, I was OOO on Tuesday, and yesterday we had public holidays in Poland. |
|
@situchan please review this when you got a minute 🙇 |
|
reviewing in an hr |
situchan
left a comment
There was a problem hiding this comment.
Overall looks good. Some minor code dry feedback
|
Performance Tests failing. I believe not caused by this PR but we should still wait until fixed in main and merge again |
|
Hey, sorry for the delay, I was OOO. I think it is ready for another review. @situchan |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-i.know.teacher.movAndroid: mWeb Chromemchrome-bank.step.moviOS: Nativeios-display.name.moviOS: mWeb Safarimsafari-legal.name.movMacOS: Chrome / Safariweb-workspace.settings.movweb-edit.iou.description.movMacOS: Desktopdesktop-new.room.mov |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/hayata-suenaga in version: 1.3.98-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.98-5 🚀
|
|
🚀 Deployed to staging by https://github.com/hayata-suenaga in version: 1.3.99-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.99-0 🚀
|
|
|
||
| // Remove all characters from the 'Other' (C) category except for format characters (Cf) | ||
| // because some of them are used for emojis | ||
| result = result.replace(/[\p{Cc}\p{Cs}\p{Co}\p{Cn}]/gu, ''); |
There was a problem hiding this comment.
In safari this regex is removing emojis too. ref: #52071
Details
This PR handles invisible characters in the required fields, to prevent users from creating an i.g. workspace name with only invisible characters.
We:
Fixed Issues
$ #23297
PROPOSAL: #23297 (comment)
Tests
isEmptyStringfunction,removeInvisibleCharactersfunction.
Offline tests
N/A
QA Steps
NamefieldMy workspace 123)\u200D), you can use this tool to copy it (paste the character in the JS/Java/C section, click Convert, and then Copy in Characters section)\u200D) (should be able to save, but the name will be treated as empty)PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
mWeb-android.mov
Mobile Web - Safari
mWeb-ios.mp4
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov