-
Notifications
You must be signed in to change notification settings - Fork 6
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
Open all external links in a new tab #870
Conversation
✅ Deploy Preview for veda-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@sandesh-sp i tried the deploy preview link and this external link opened in the same tab 👀 |
@slesaad I didn't consider the external links on the cards but only within the stories. Let me look at that right away. |
@slesaad External links present on cards should also open in a new tab now |
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.
Thanks for the contribution, @sandesh-sp! Please always reference the ticket you are working off of.
I guess it was this one:
But I had not considered that we would change this centrally in VEDA UI, so I now created a ticket in this repo for it:
As I stated in the ticket, we need to clarify: Would it be very complex to make this behavior optional?
@j08lue @sandrahoang686 yes, we do want to make the behavior optional. @sandesh-sp is looking at making it configurable via the config file in the the veda-config repo probably via the https://github.com/NASA-IMPACT/veda-config/blob/develop/veda.config.js file or an env var? |
For the E&A feature flag, we chose the But I'll defer to @sandrahoang686 to advise. |
@slesaad @sandesh-sp I would recommend to make this type of configuration in the |
Creating a new pull request in veda-config-ghg |
I see you closed this pull request, @sandesh-sp. Is the change in VEDA UI not needed? |
@j08lue I think that was a mistake. Reopening. @sandrahoang686 @hanbyul-here can you guys have a look at the approach followed here and let us know what you think? |
@slesaad @sandesh-sp this looks like a better path, thanks for making the updates! Could we possibly move this defining of linkProps into a more global util file? I think
For SmartLink it would then look like...
|
Thanks @sandrahoang686 ! I'll make the changes as suggested |
@sandrahoang686 could you have a look to the new changes. I defined getLinkProps on utils/url which was then used to get the needed attributes for the links.
|
@sandesh-sp what is your exact error? Maybe try typing Another error looks like |
Thanks @sandrahoang686, this seems to be working. Could you please review it. |
return isExternalLink | ||
? { | ||
href: linkTo, | ||
to: linkTo, |
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.
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.
@sandrahoang686 that's because we also need externalLinksInNewTab set to true on veda-config/veda.config.js.
It is working on veda-config-ghg (US-GHG-Center/veda-config-ghg#326) and also on my local machine.
I had to set it this way to prevent typescript error which was expecting "to" prop from the function
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.
lgtm
@sandesh-sp letting you know Jonas is out and should be back monday ! |
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.
Referring to @sandrahoang686 for an authoritative review of the technical implementation.
From a feature perspective, this seems complete now with the option to enable / disable external links to open in new tabs per-instance.
## 🎉 Features - Zoom in AOI, TOI when analysis is run in #906 - Add custom javascript injection #846 - ADR for V2 Refactor: #875 - Open all external links in a new tab in #870 - Include dataset id to filter layers in #910 - Some datasets can only be analyzed with layers from the same source in #913 - Create minimal partial data layer scaffold starting off with Data Catalog for VEDA2 Refactor in #893 - Add analysis preset in #921 ## 🚀 Improvements - Chart style improvement in #903 - Data Catalog enhancement with floating filter sidebar in #918 - Sum as statistics option in #925 - ## 🐛 Fixes - Sort featured stories based on publication date in descending order in #907 - Replace latency with temporalResolution in layer info in #898 - Add a workaround for Safari scroll problem in #909 - Handle empty result in #922
Closes #873