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

Lazyload SmartLink to avoid loading react-router-dom + use a proper linkProperties #1160

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

hanbyul-here
Copy link
Collaborator

@hanbyul-here hanbyul-here commented Sep 18, 2024

Related Ticket: follow up of follow up -_- #1159

Description of Changes

Urg I used wrong attributes, so the previous fix didn't really fix the problem.
The previous approach broke the library build too by including SmartLink, which uses react-router-dom. I think I worked around by lazy loading the component in this PR. I tested it locally but if you can, please give it another test 🙇

Notes & Questions About Changes

Validation / Testing

ok, this time, I actually created a preview on GHG; this is the page that uses Card component: https://deploy-preview-596--ghg-demo.netlify.app/learn

Copy link

netlify bot commented Sep 18, 2024

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit e7065ff
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/66edaa3beb479900088a505e
😎 Deploy Preview https://deploy-preview-1160--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.

onLinkClick,
pathAttributeKeyName: 'to',
linkComponent: SmartLink
// @ts-expect-error SmartLink needs to be lazily loaded temporarily to prevent ui-library from loading react-router-dom
LinkElement: SmartLink
Copy link
Collaborator

Choose a reason for hiding this comment

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

Relooked at your previous PR - so looks like we have to default to SmartLink here because GHG is unable to pass this element into the card? We may just want to update this on GHG side to pass the LinkElement in instead of this non-ideal temporary solution? Unsure if thats too much of a lift right now though so this comment is non-blocking. But could we leave a @TODO or @NOTE too here with the same note you have?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, it will be best to just change the code from the instance side. But I think it is easy to miss it with R3 and everything, so put the temporary measure here. I left a note.

@hanbyul-here hanbyul-here merged commit 7ce68a2 into main Sep 20, 2024
8 checks passed
@hanbyul-here hanbyul-here deleted the fix/card branch September 20, 2024 17:17
sandrahoang686 added a commit that referenced this pull request Sep 25, 2024
## 🎉 Features
- [E&A] Implement colormap configurability
#1117
- [E&A] Feature flag colormap configurability
#1147
- Add font md size as 20px for new Design System
#1125
## 🚀 Improvements
- [E&A] Return default value of colormap along with other settings
#1128
- Create new raster paint layer module and factor out
BaseTimeseriesProps #1105
- Consolidate a place where to check linkProps
#1121
#1160
- Expose Data Catalog and update child components to pass in routing/nav
for library build #1096
#1159
- Set up eslint rule for no trailing spaces
#1146
- Replace cmr-stac with titiler-cmr
#1131
## 🐛 Fixes
- Update external link in top navigation target
#1145
- Update PageHeader/Nav to not throw
#1149
- [E&A] Fix to convert the time to usertzdate
#1151
- Use sourceparams as it is when it is there
#1148
- Fix compare label on block map
#1153
- Discard the previous sourceExclusive value to fix the case when the
datasets with different sourceExclusive can be selected together
#1161
- Show the name of the selected filter on story hub
#1161
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