-
Couldn't load subscription status.
- Fork 1.4k
[newcomers-form] fix: accept Google Drive links in profile picture validation #7041
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: master
Are you sure you want to change the base?
Conversation
|
🚀 Preview for commit 0bc92e9 at: https://68f13121a6457b84033b3eb4--layer5.netlify.app |
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.
Hi, thanks for this contribution! The logic is looking good.
We can simplify the validation by using a single regular expression. This makes the intent clearer and is easier to maintain than multiple includes() checks.
const validGoogleDrivePattern = /drive\.google\.com\/file\/d\/.+\/(view|uc\?)/;
if (value.includes('drive.google.com') && !validGoogleDrivePattern.test(value)) {
error = "Please provide a direct Google Drive file link.";
} else {
// ...
}I also noticed the DCO check is failing. This happens when commits are not signed off. https://docs.meshery.io/project/contributing
|
This is a very important to work on as I faced this issue through while filling the form. Between, the DCO checks is failing. |
|
Thankyou for the feedback. I'll simplify the validation and also fix the DCO check issue. |
|
@hudazaan thanks for your contribution , you can check https://github.com/layer5io/layer5/pull/7041/checks?check_run_id=53083532468 to fix the DCO error |
|
🚀 Preview for commit a4dcc18 at: https://68f3b03153e83cd59ef816d1--layer5.netlify.app |
|
DCO Failed |
|
Thank you for your contribution! |
Description
This PR fixes #6986
Fixed the profile picture validation to accept Google Drive links. Previously, when users tried to paste Google Drive links as profile pictures, the form showed the error "URL must point to an image file (jpg, jpeg, png, svg, webp or gif)".
Notes for Reviewers
Signed commits