Skip to content
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

fix: adding https in checkurltype #6295

Conversation

Princeyadav05
Copy link
Contributor

Fix URL handling for LinkedIn and Twitter links

Fixes #6287

Solution

Updated checkUrlType function to prepend "https://" to URLs if missing, ensuring proper handling of social media links.

Changes

  • Modified /packages/twenty-front/src/utils/checkUrlType.ts
  • Added a check to prepend "https://" if URL doesn't start with a protocol

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

  • Modified /packages/twenty-front/src/utils/checkUrlType.ts
  • Added check to prepend "https://" if URL lacks protocol
  • Ensures proper handling of LinkedIn and Twitter links

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@FelixMalfait
Copy link
Member

Never blindly follow AI 😜
But thanks for the attempt

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

  • Updated /packages/twenty-front/src/modules/ui/field/display/components/LinkDisplay.tsx to prepend 'https://' to URLs missing a protocol
  • Removed protocol prepending logic from /packages/twenty-front/src/utils/checkUrlType.ts
  • Ensured consistent URL handling across components
  • Watch for any unintended side effects in URL formatting

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@FelixMalfait FelixMalfait merged commit 539251c into twentyhq:main Jul 16, 2024
5 of 8 checks passed
@@ -18,6 +18,12 @@ export const LinkDisplay = ({ value }: LinkDisplayProps) => {
return <></>;
}

const absoluteUrl = url
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should leverage existing utils here :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid URL Redirects for X and LinkedIn Fields
3 participants