-
Notifications
You must be signed in to change notification settings - Fork 14k
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
feat(explore): Add empty state to annotations #20160
feat(explore): Add empty state to annotations #20160
Conversation
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.
Very nice, the previous behavior caused a lot of clicking back and forth, this greatly clarifies + simplifies the flow 👍 LGTM (the comment is more thinking about better ways of translating React components where the translation text needs to flow into its children)
{t('Add an annotation layer')}{' '} | ||
<a | ||
href="/annotationlayermodelview/list" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{t('here')} | ||
</a> |
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.
This isn't the only place where we have this type of translation logic, but splitting up a translation like this can be problematic for languages that have different sentence structure/order than English. But since I don't have a better proposal at this time we can surely live with this. But maybe there's a more modern translation library out there that more natively supports these types of Reacty-y use cases better.
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.
..aaand some quick googling turned up this: https://react.i18next.com/
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.
Good point. I'm not very familiar with the translation logic. Do you think it'd be a big project to switch to using this library?
Codecov Report
@@ Coverage Diff @@
## master #20160 +/- ##
==========================================
- Coverage 66.47% 66.46% -0.02%
==========================================
Files 1727 1721 -6
Lines 64724 64524 -200
Branches 6822 6811 -11
==========================================
- Hits 43024 42884 -140
+ Misses 19969 19907 -62
- Partials 1731 1733 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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!
253075f
to
48b3e5e
Compare
* feat(explore): Add empty state to annotations * Set line height for small empty state description * Simplify code
SUMMARY
When there's no annotation sources available, display an empty state with a link to annotation layers view.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
CC @kasiazjc