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: add database and schema names to dataset option #25569
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.
Thanks for the PR! I'm curious what others (especially @kasiazjc) think about this. In particular, I'm wondering about users that have a whole lot of datasets. Adding the table/schema in the tooltip is AMAZING and (I think) uncontroversial. What I'm not sure about is if the table and schema are needed in the menu option listings, since they take up more vertical real estate, and will require more scrolling if the list is long. The tooltip seems sufficient to me, but I'm not sure ¯\_(ツ)_/¯ |
amazing @soniagtm and congrats on your first PR! @soniagtm I have some feedback about the metadata in the dropdown (schema and database) - I think it's 14px, can you change it to 12px? This way it all will be less cluttered and we'll get back a little bit of the precious real estate @rusackas :D For the context, @rusackas: Details in the dropdown solve a problem of quickly identifying which dataset is the one you're looking for (there are use cases of datasets with the same name, or users are just not familiar with them) or where does it come from, what is the context. That's why the request/solution was to make those details visible at all times. Also, this field is searchable, so it shouldn't be a problem with super long list. |
Another design option would be to replicate the database/schema UI elements we use in SQL Lab, etc. for consistency reasons, however it might be overkill, and/or a cumbersome UX. |
Yeah, I think it would be too much - we are actually thinking about using this pattern with metadata in the dropdown in other places, so for sure it wouldn't be a one time thing. |
This looks good to me! Thank you for all the 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.
Design LGTM
...src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetLabel.tsx
Outdated
Show resolved
Hide resolved
...src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetLabel.tsx
Outdated
Show resolved
Hide resolved
...src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetLabel.tsx
Outdated
Show resolved
Hide resolved
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.
Thank you for the PR @soniagtm! I really think this brings a lot of value.
Currently, there are 2 concepts in Superset:
src/components
contains components that are really generic and could be extracted to a library to be used outside of Superset.
src/features
contains components that belong to the Superset domain and that are shared between multiple modules.
Given that we want to uniformly represent datasets throughout the application, the implementation of this new label should be moved to src/features/datasets
and be reused in the native filters and chart creation.
...src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetLabel.tsx
Outdated
Show resolved
Hide resolved
@soniagtm I verified that long database and schema names are truncated. Nice. We can improve the layout a little bit to use all the available space in some cases. |
We'll need to augment the |
I've moved the dataset label implementation to src/features/datasets as suggested and also fixed the UI issues found. BEFORE
AFTERBEFORE
AFTER
Thanks! |
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 addressing the comments @soniagtm. It's looking great! I left some more suggestions.
...rc/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetSelect.tsx
Outdated
Show resolved
Hide resolved
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. Thank you for the awesome improvement @soniagtm and for patiently addressing all comments. Great job!
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!
Thank you for your kind words and for helping me with my first PR! I'm really grateful for all the suggestions :) |
Echoing everyone here, thank you for this submission and all the effort that went into it! |
Co-authored-by: Sonia <sonia.gautam@agoda.com>
Co-authored-by: Sonia <sonia.gautam@agoda.com>
SUMMARY
This PR is created for adding database and schema names to the dataset option in the chart creation page and dashboard filter modal as described in Discussion: #25545.
The changes I have made will add database and schema names beneath each dataset name in the drop down list, as well as in the tooltip, so that users can identify the database and schema from which each dataset is created.
For datasets with a null schema name, the schema name in the tooltip label will be displayed as ‘Not defined’ instead.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE
Chart creation page
Dashboard filter modal
AFTER
Chart creation page
Dashboard filter modal
TESTING INSTRUCTIONS
To verify the changes made, please follow these steps:
Chart Creation Page:
(Assume that there exist some datasets that could be used to create a chart)
Dashboard Filter Modal:
(Assume that there are some dashboards to which you can apply filters)
ADDITIONAL INFORMATION