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 external link badge display for tools hosted under the same domain #1192

Merged
merged 3 commits into from
Oct 16, 2024

Conversation

dzole0311
Copy link
Collaborator

@dzole0311 dzole0311 commented Oct 14, 2024

Related Ticket: #1187

Description of Changes

After discussing with @hanbyul-here during pod week, we identified two potential solutions:

  1. Introduce an isExternalLink prop in the .mdx configuration files for each story, or,
  2. Add logic in the card component to dynamically check the domain of the link and decide whether it is external

Option 2 requires less configuration for developers/users of VEDA instances, but it's not easy to test locally especially if we want more fine-grained control over future integration tests. So the implementation here goes for Option 1.

More context: https://developmentseed.slack.com/archives/C063GD0NYP8/p1728407361439379

  • Add a new isLinkExternal prop that can be passed to the story as a configuration
  • The existing check for http/https (/^https?:\/\//) remains in place as a fallback if the new prop is not present

Notes & Questions About Changes

Validation / Testing

  • Use the new isLinkExternal prop in some of the stories and validate that it shows/hides the "External Link" badge in the UI
  • Remove the isLinkExternal prop that you added and see if the UI still behaves as expected (e.g if the link you added in the story .mdx file has https, it will be marked as External Link in the UI cards)
  • Click around the UI cards and verify that the links work as expected

Copy link

netlify bot commented Oct 14, 2024

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit ed27b16
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/670fbf8153f67900088a306c
😎 Deploy Preview https://deploy-preview-1192--veda-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dzole0311 dzole0311 requested a review from snmln October 14, 2024 11:24
@dzole0311 dzole0311 merged commit 46e1c5d into main Oct 16, 2024
8 checks passed
@dzole0311 dzole0311 deleted the 1187-incorrect-badge-for-same-domain-tools branch October 16, 2024 13:50
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.

3 participants