-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
chore: Shows the dataset description in the gallery dropdown #16200
chore: Shows the dataset description in the gallery dropdown #16200
Conversation
a14008f
to
81fd89e
Compare
Codecov Report
@@ Coverage Diff @@
## master #16200 +/- ##
==========================================
- Coverage 76.73% 76.53% -0.21%
==========================================
Files 996 997 +1
Lines 52999 53194 +195
Branches 6738 6764 +26
==========================================
+ Hits 40668 40711 +43
- Misses 12102 12253 +151
- Partials 229 230 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
/testenv up |
@junlincc Ephemeral environment spinning up at http://34.221.205.34:8080. Credentials are |
tested locally, LGTM |
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.
product sign-off ✅
f37b0c0
to
71e9aae
Compare
@mistercrunch Currently, the tooltip is always displayed by Ant Design and it's really helpful for cases where the text is truncated. That said, we did some changes in other places to only show the tooltip if the text is truncated and I liked the idea. I agree that having an icon is very helpful in this scenario because we have extra information, that may or may not be present for a dataset. I'll do the requested changes in a follow-up PR because we need to change the Select component and deal with the combination of truncated text, not truncated text, and icon. |
}) => ({ | ||
value: `${item.id}__${item.datasource_type}`, | ||
label: item.table_name, | ||
title: `${item.table_name}\n\n${ |
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.
Can we replace \n\n
with a span with some padding, so that we have more control over the spacings and can use grid unit from theme?
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.
The implementation looks good. However, I also share some concerns about these tooltips.
Why aren't we using the Antd Tooltip as everywhere else? I feel like this is harder to read.
I think we shouldn't be showing "No description" where there is no description available.
@kgabryje @geido Thanks for the comments!
This is the default behavior of the Select component. We can try to change that but I would like to only change the Select's code after we write the tests for the component to avoid regressions at this point. It's a little tricky because of the sync and async modes. I'll add your suggestion to the component's list of improvements.
Yes. Will do.
Yes. Will do.
I was using the native feature of the Ant Design Select. To use our tooltip we need to change the component. I'll add your suggestion to the component's list of improvements.
The idea here was to show the user that he has the possibility to add a description. We'll add the info bubble in a follow-up PR according to @mistercrunch suggestions. I'm imagining that the icon will only appear for items that have a description so your concern will disappear. |
71e9aae
to
88af84a
Compare
@kgabryje @geido I was able to change the tooltip without modifying the Select component! With that, all your requests with the exception of the 'No data' were implemented. I updated the PR's description with the latest video. This PR is the base for another important PR so let's treat the following improvements in follow-up PRs:
|
/testenv up |
@rusackas Ephemeral environment spinning up at http://52.12.189.84:8080. Credentials are |
.tooltip-description { | ||
margin-top: ${theme.gridUnit * 2}px; | ||
display: -webkit-box; | ||
-webkit-line-clamp: 20; |
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.
Ooh, you don't get to use that every day.
<Tooltip | ||
title={ |
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.
<Tooltip | |
title={ | |
<Tooltip | |
placement="right" | |
title={ |
I love the lazy loading of datasource data! As we now no longer need it in bootstrap data, we can pull it out with this change to make page loading marginally faster/lighter: diff --git a/superset/views/chart/views.py b/superset/views/chart/views.py
index 68c19cc2c..01b9e53ca 100644
--- a/superset/views/chart/views.py
+++ b/superset/views/chart/views.py
@@ -62,15 +62,7 @@ class SliceModelView(
@expose("/add", methods=["GET", "POST"])
@has_access
def add(self) -> FlaskResponse:
- datasources = [
- {"value": str(d.id) + "__" + d.type, "label": repr(d)}
- for d in security_manager.get_user_datasources()
- ]
payload = {
- "datasources": sorted(
- datasources,
- key=lambda d: d["label"].lower() if isinstance(d["label"], str) else "",
- ),
"common": common_bootstrap_payload(),
"user": bootstrap_user_data(g.user),
} Other than that I love @rusackas propsal to place the tooltip on the right - LGTM after these changes. |
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 with the suggestions above!
@rusackas I was able to adjust the tooltip positioning. Now, I'm presenting the tooltip at the row level, always preserving the visibility of the items independently of the content length. Screen.Recording.2021-08-13.at.1.03.53.PM.mov@villebro I removed the bootstrap data according to your instructions. Thanks! |
…unnecessary bootstrap data
e4f4a6f
to
6d4f06c
Compare
/testenv up |
@rusackas Ephemeral environment spinning up at http://34.219.74.76:8080. Credentials are |
Ephemeral environment shutdown and build artifacts deleted. |
…gies * upstream/master: (64 commits) check roles before fetching reports (#16260) chore: upgrade mypy and add type guards (#16227) fix: pivot columns with ints for name (#16259) chore(pylint): Bump Pylint to 2.9.6 (#16146) fix examples tab for dashboard (#16253) chore: bump superset-ui packages to 0.17.84 (#16251) chore: Shows the dataset description in the gallery dropdown (#16200) fix(Dashboard): Omnibar dropdown visibility and keyboard commands (#16168) chore: bump py version for integration test (#16213) fix: skip perms on query context update (#16250) refactor: external metadata fetch API (#16193) feat(dao): admin can remove self from object owners (#15149) fix(dashboard): cross filter chart highlight when filters badge icon clicked (#16233) fix: validate_parameters and query (#16241) fix: Remove Advanced Analytics tag for 2 charts (#16240) Revert "feat: Changing Dataset names (#16199)" (#16235) feat: Allow users to connect via legacy SQLA form (#16201) fix: remove encryption from db params (#16214) fix(Explore): Show the tooltip only when label does not fit the container in METRICS/FILTERS/GROUP BY/SORT BY of the DATA panel (#16060) Show/hide tooltips (#16192) ... # Conflicts: # superset/tasks/caching/cache_strategy.py
…16200) * chore: Shows the dataset description in the gallery dropdown * chore: Adjusts the tooltip positioning, fixes the search and removes unnecessary bootstrap data
…16200) * chore: Shows the dataset description in the gallery dropdown * chore: Adjusts the tooltip positioning, fixes the search and removes unnecessary bootstrap data
SUMMARY
Closes #16153
@junlincc @rusackas @jinghua-qa
@villebro After this PR is merged we need to remove the datasets from bootstrap data.
AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2021-08-12.at.4.21.38.PM.mov
TESTING INSTRUCTIONS
Check the original issue for instructions.
ADDITIONAL INFORMATION