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
@hanbyul-here hanbyul-here mentioned this pull request Oct 29, 2024
snmln added a commit that referenced this pull request Oct 30, 2024
You can find VEDA Dashboard preview link to test these changes:
NASA-IMPACT/veda-config#470

## 🎉 Features
- Cookie consent component:
#1163,
#1165,
#1127,
#1177
- Stories Hub export in #1162
- Expose As Is - PageHeader, LinkElement Prop & Logo in
#1184
## 🚀 Improvements

- Add docs for registry dev in
#1169
- Timeline date selection centering functionality in
#1181
- Deprecate old explore page, Mapbox component
#1176
- Update doc with new diagrams about general architecture in
#1195
-  Add playwright in #1139
- Pre-select AOIs that have the "selected" prop set to true in
#1215
- 
## 🐛 Fixes
- Check dastaset analysis exclude attribute before running analysis in
#1175
- Restrict dynamic colormaps to applicable layer types in
#1183
- Fix external link badge display for tools hosted under the same domain
in #1192
- Escape special characters in regex expression when searching datasets
in #1204


### New Contributors
* @snmln made their first contribution in
#1127
* @AliceR made their first contribution in
#1204
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