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

Update PageHeader/Nav to not throw #1149

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Conversation

sandrahoang686
Copy link
Collaborator

@sandrahoang686 sandrahoang686 commented Sep 11, 2024

Was playing around a bit with nav header with next instance and noticed something I did not catch in the initial PR review. But we dont want to throw an error when type is incorrect. This will break the app because nothing is catching it. Instead we should still render the rest of the nav items that are correct.

I opted in for logging the error for incorrect types but if we prefer a different way like catching and bubbling up the error, lmk.

Updated behavior looks like:
Screenshot 2024-09-11 at 12 08 28 PM

Copy link

netlify bot commented Sep 11, 2024

Deploy Preview for veda-ui ready!

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

@sandrahoang686
Copy link
Collaborator Author

sandrahoang686 commented Sep 11, 2024

This brings up a broader discussion of how do want to better handle errors on UI side? We should have a standard of logging errors and then when we throw, we should make sure the app doesn't break. Instead these throws should bubble up and be caught at some point and component returns null instead of breaking... more standard and better practice.

Copy link
Collaborator

@dzole0311 dzole0311 left a comment

Choose a reason for hiding this comment

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

@sandrahoang686 Could you provide some steps for what to look for when testing the PR please?

@sandrahoang686
Copy link
Collaborator Author

@dzole0311 with the preview, you'd just wanna make sure it works as expected. To test fail case, you can pull down code locally and update the navConfig to have an unexpected type. This would be a good test case scenerio 🤔

Copy link
Collaborator

@dzole0311 dzole0311 left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for spotting this 👍

@sandrahoang686 sandrahoang686 merged commit 54f476b into main Sep 12, 2024
8 checks passed
@sandrahoang686 sandrahoang686 deleted the page-header-do-not-throw branch September 12, 2024 13:15
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.

2 participants