-
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
fix(datasets): Replace left panel layout by TableSelector #24599
fix(datasets): Replace left panel layout by TableSelector #24599
Conversation
@justinpark regarding the lack of the warning icon, even if one perceives this as a regression, I sense that overall (performance aside) the replacement is actually net positive as it ensures a consistent UI/UX between the two workflows (and less code to maintain). |
Codecov Report
@@ Coverage Diff @@
## master #24599 +/- ##
==========================================
- Coverage 68.89% 68.89% -0.01%
==========================================
Files 1901 1901
Lines 73925 73863 -62
Branches 8183 8173 -10
==========================================
- Hits 50931 50886 -45
+ Misses 20873 20862 -11
+ Partials 2121 2115 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
/testenv up |
@eschutho Ephemeral environment spinning up at http://34.217.23.241:8080. Credentials are |
I do think the icon is helpful to understand which tables are already backing datasets without having to click into each one. Is there some way to still display that info/indicator on the list? |
Agree with @yousoph. I think there should be some kind of indicator in the dropdown that the table is already used in a different dataset especially as the table can be only used for one dataset (if I understand correctly). |
@justinpark You can use |
@yousoph @kasiazjc @michael-s-molina As discussed, I restored the warning icon. it's not identical but reuse existing warning indicator in TableOption component. |
<Loading position="inline" /> | ||
<p>{inline}</p> | ||
</div> | ||
const datasetNamesSet = datasetNames?.join(divider); |
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 you use a Set here?
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 purpose of using concatenated string is avoiding the re-rendering by the reference differences because it will shallowly comparing only values given the different reference of datasetNames passing from the property
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.
Why not use Lodash's isEqual
to compare the sets? split
and includes
for every table seems way more expensive.
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.
I removed the join/split operation and fix the original hook for tuning
superset-frontend/src/components/WarningIconWithTooltip/index.tsx
Outdated
Show resolved
Hide resolved
Thanks @justinpark ! One small item - in your screenshot, the tooltip looks like it has a bit too much space underneath the text |
@yousoph I just removed the minor bottom margin on the tooltip. |
42ef180
to
cca1d22
Compare
@michael-s-molina I made updates on the addressed ones. |
@@ -24,11 +24,13 @@ import { Tooltip } from 'src/components/Tooltip'; | |||
export interface WarningIconWithTooltipProps { | |||
warningMarkdown: string; | |||
size?: IconType['iconSize']; | |||
indentSize?: number; |
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 you pass marginRight
as the property instead of indentSize
and use theme.gridUnit * 2
as its default value? It seems more clear what's the objective. It's hard to grasp that the indent will be added to the margin.
Left 2 comments. |
cca1d22
to
e5e0358
Compare
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 fix and for addressing all comments!
Ephemeral environment shutdown and build artifacts deleted. |
Co-authored-by: Justin Park <justinpark@apache.org> (cherry picked from commit b2831b4)
Co-authored-by: Justin Park <justinpark@apache.org>
SUMMARY
Since new Dataset creation layout doesn't use virtualized list component for the table list, hard to operate the dataset creation with large table set (>10k). (mostly browser is frozen while scrolling down)
Since the left panel layout designed for database/schema/table selection, we can reuse the database/schema/table selector (which uses virtualized list) for the same functionality (except the warning icon. However the warning message will be shown as is once user selects a table. I think it won't be critical without the warning icon on the list)
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After:
Before:
TESTING INSTRUCTIONS
Go to datasets and create new dataset
ADDITIONAL INFORMATION