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

fix(datasets): Replace left panel layout by TableSelector #24599

Conversation

justinpark
Copy link
Member

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)

superset-goalie_-_Airbnb_-_Slack

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:
Screenshot 2023-07-05 at 2 43 20 PM

Before:
Screenshot 2023-07-05 at 2 34 43 PM

TESTING INSTRUCTIONS

Go to datasets and create new dataset

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@john-bodley
Copy link
Member

john-bodley commented Jul 5, 2023

@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
Copy link

codecov bot commented Jul 6, 2023

Codecov Report

Merging #24599 (1ec2789) into master (1a97245) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 1ec2789 differs from pull request most recent head e5e0358. Consider uploading reports for the commit e5e0358 to get more accurate results

@@            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     
Flag Coverage Δ
javascript 55.68% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/components/Tooltip/index.tsx 100.00% <ø> (ø)
...et-frontend/src/components/TableSelector/index.tsx 86.66% <100.00%> (+5.58%) ⬆️
...nd/src/components/WarningIconWithTooltip/index.tsx 100.00% <100.00%> (ø)
...c/features/datasets/AddDataset/LeftPanel/index.tsx 84.21% <100.00%> (+5.63%) ⬆️
...end/src/features/datasets/hooks/useDatasetLists.ts 33.33% <100.00%> (+2.89%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@eschutho
Copy link
Member

eschutho commented Jul 6, 2023

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

@eschutho Ephemeral environment spinning up at http://34.217.23.241:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@yousoph
Copy link
Member

yousoph commented Jul 7, 2023

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?

@kasiazjc
Copy link
Contributor

kasiazjc commented Jul 7, 2023

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).

@michael-s-molina
Copy link
Member

michael-s-molina commented Jul 7, 2023

Is there some way to still display that info/indicator on the list?

@justinpark You can use customLabel to change how the Select options are displayed and include the icon.

@justinpark
Copy link
Member Author

@yousoph @kasiazjc @michael-s-molina As discussed, I restored the warning icon. it's not identical but reuse existing warning indicator in TableOption component.

Screenshot 2023-07-07 at 11 31 30 AM Screenshot 2023-07-07 at 11 31 38 AM

@justinpark
Copy link
Member Author

Adjusted the right margin of the warning icon
Screenshot 2023-07-07 at 12 30 51 PM

<Loading position="inline" />
<p>{inline}</p>
</div>
const datasetNamesSet = datasetNames?.join(divider);
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

@michael-s-molina michael-s-molina Jul 19, 2023

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.

Copy link
Member Author

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

@yousoph
Copy link
Member

yousoph commented Jul 7, 2023

Thanks @justinpark ! One small item - in your screenshot, the tooltip looks like it has a bit too much space underneath the text

@justinpark
Copy link
Member Author

@yousoph I just removed the minor bottom margin on the tooltip.

Screenshot 2023-07-11 at 9 41 41 AM

@justinpark justinpark force-pushed the fix--add-dataset-left-panel-table-selector-layout branch from 42ef180 to cca1d22 Compare July 13, 2023 22:12
@justinpark
Copy link
Member Author

@michael-s-molina I made updates on the addressed ones.
Could you help review?

@john-bodley john-bodley added the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Jul 14, 2023
@@ -24,11 +24,13 @@ import { Tooltip } from 'src/components/Tooltip';
export interface WarningIconWithTooltipProps {
warningMarkdown: string;
size?: IconType['iconSize'];
indentSize?: number;
Copy link
Member

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.

@michael-s-molina
Copy link
Member

@michael-s-molina I made updates on the addressed ones. Could you help review?

Left 2 comments.

@justinpark justinpark force-pushed the fix--add-dataset-left-panel-table-selector-layout branch from cca1d22 to e5e0358 Compare July 20, 2023 01:48
Copy link
Member

@michael-s-molina michael-s-molina left a 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!

@justinpark justinpark merged commit b2831b4 into apache:master Jul 20, 2023
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

michael-s-molina pushed a commit that referenced this pull request Jul 26, 2023
Co-authored-by: Justin Park <justinpark@apache.org>
(cherry picked from commit b2831b4)
@mistercrunch mistercrunch added 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
Co-authored-by: Justin Park <justinpark@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XL v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants