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
Extend slugify function #8740
Extend slugify function #8740
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
@AyushMainali123 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
π¦ Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. π€ This PR introduced no changes to the JavaScript bundle! π |
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.
Tested - LGTM
Will wait for a few others to test tho as this is core code.
@PeerRich @baileypumfleet are we actually wanting to support emojis in usernames π€ |
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.
Definitively an improvement. Thank you for your contribution π
We could discuss this in a follow up |
What does this PR do?
Closes #7718
The slugify function appears to have limited functionality, which led to issue #7718. Additionally, I observed that the function does not trim multiple spaces in the slug.
For example:
Previously,
ayush mainali
was updated toayush------mainali
.test test test π©π½π¨π½ ζΌ’
would be converted totest-test-test-----------
, which is quite confusing.Now,
ayush mainali
will be converted toayush-mainali
,test test test π©π½π¨π½ ζΌ’
will be converted totest-test-test-π©π½π¨π½-ζΌ’
I didn't use something like:
/[^a-zA-Z0-9-\p{Emoji}]/gu
because, it couldn't properly slugify combined emoji like πͺ . It would return something likeπ¨-π©-π¦
when slugified.Fixes # (7718 )
https://user-images.githubusercontent.com/49358949/236681331-41a7cd2d-7334-4291-a5ff-30ebc8bc8936.mp4
Environment: Staging(main branch) / Production
Type of change
How should this be tested?
Checklist
I have checked test suites using yarn run test (yarn test-e2e was testing against 0 test suites in my local) .
Test
Weekday tests βΊ fn: weekdayNames βΊ should return the weekday names for a given locale and format
was failing in the production branch, so it isn't addressed in my PR.Except for that test case, all other test case has passed in the PR I submitted.