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

Incorrect "External Link" badge displayed for same-domain tools #1187

Closed
2 tasks
dzole0311 opened this issue Oct 9, 2024 · 0 comments
Closed
2 tasks

Incorrect "External Link" badge displayed for same-domain tools #1187

dzole0311 opened this issue Oct 9, 2024 · 0 comments
Assignees

Comments

@dzole0311
Copy link
Collaborator

dzole0311 commented Oct 9, 2024

Context

Some tools hosted under the same domain as the instance (e.g., https://earth.gov/mobile-climate-mapper/) are not part of veda routes. Currently, these links are mistakenly marked with an "External Link" badge when shown in the UI. This can be misleading for users as these tools are not truly external (see screenshot below).

Screenshot 2024-10-14 at 13 25 00

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.

Acceptance Criteria

  • Given when then
  • Given when then

Related Tickets

[If applicable, link any tickets that are related]

@dzole0311 dzole0311 self-assigned this Oct 14, 2024
@dzole0311 dzole0311 changed the title Add isExternalLink param to the story metadata Check the domain as well when checking for external links Oct 14, 2024
@dzole0311 dzole0311 changed the title Check the domain as well when checking for external links Incorrect "External Link" badge displayed for same-domain tools Oct 14, 2024
dzole0311 added a commit that referenced this issue Oct 16, 2024
#1192)

**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
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

No branches or pull requests

1 participant