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

refactor: Move ProgressBar to Antd #11875

Merged
merged 5 commits into from
Dec 3, 2020
Merged

refactor: Move ProgressBar to Antd #11875

merged 5 commits into from
Dec 3, 2020

Conversation

geido
Copy link
Member

@geido geido commented Dec 1, 2020

SUMMARY

Moving the ProgressBar component from react-bootstrap to AntDesign and customizing it with Emotion/CSS to enable a striped background which is not supported by Antd by default.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
progress-bar-before
After:
progress-after
progress-success-after

TEST PLAN

  1. Log into Superset
  2. Navigate to SQL Lab > SQL Editor (/superset/sqllab)
  3. Query a table
  4. Select "QUERY HISTORY" tab

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@geido
Copy link
Member Author

geido commented Dec 1, 2020

@rusackas @junlincc

@geido geido marked this pull request as ready for review December 1, 2020 12:54
@codecov-io
Copy link

codecov-io commented Dec 1, 2020

Codecov Report

Merging #11875 (ab1d52c) into master (0728878) will decrease coverage by 12.53%.
The diff coverage is 16.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #11875       +/-   ##
===========================================
- Coverage   67.65%   55.11%   -12.54%     
===========================================
  Files         927      421      -506     
  Lines       45009    14802    -30207     
  Branches     4306     3815      -491     
===========================================
- Hits        30450     8158    -22292     
+ Misses      14455     6644     -7811     
+ Partials      104        0      -104     
Flag Coverage Δ
cypress 55.11% <16.66%> (+0.12%) ⬆️
javascript ?
python ?

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

Impacted Files Coverage Δ
...rset-frontend/src/SqlLab/components/QueryTable.jsx 11.11% <ø> (-55.56%) ⬇️
...erset-frontend/src/SqlLab/components/ResultSet.tsx 3.41% <ø> (-72.71%) ⬇️
superset-frontend/src/common/components/index.tsx 100.00% <ø> (ø)
...set-frontend/src/common/components/ProgressBar.tsx 16.66% <16.66%> (ø)
...uperset-frontend/src/dashboard/util/dnd-reorder.js 0.00% <0.00%> (-100.00%) ⬇️
...rset-frontend/src/dashboard/util/getEmptyLayout.js 0.00% <0.00%> (-100.00%) ⬇️
...dashboard/components/resizable/ResizableHandle.jsx 0.00% <0.00%> (-100.00%) ⬇️
.../src/dashboard/util/getFilterScopeFromNodesTree.js 0.00% <0.00%> (-93.48%) ⬇️
...src/dashboard/components/gridComponents/Header.jsx 10.52% <0.00%> (-86.85%) ⬇️
...rc/dashboard/components/gridComponents/Divider.jsx 13.33% <0.00%> (-86.67%) ⬇️
... and 779 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0728878...ab1d52c. Read the comment docs.

@geido geido changed the title Move ProgressBar to Antd refactor: Move ProgressBar to Antd Dec 1, 2020
@junlincc junlincc requested review from rusackas and junlincc December 1, 2020 16:00
@junlincc
Copy link
Member

junlincc commented Dec 1, 2020

Screen Shot 2020-12-01 at 8 18 28 AM

LGTM @rusackas thanks @geido !

*/
import React from 'react';
import { styled } from '@superset-ui/core';
import { Progress as AntdProgress } from 'src/common/components';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to nudge superset devs toward using only this styled ProgressBar and not the one from Antd directly - just to keep things consistent. What do you think about importing from antd directly here, and NOT export Progress from common/components/index.tsx?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... you could even import this component from common/components/index.tsx and export it as Progress - then people could import { Progress } from 'src/common/components' as it if were the AntD one, but it'd really be this enhanced/styled one.

Copy link
Member Author

@geido geido Dec 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather go with your first suggestion and import the Antd Progress directly into the enhanced component. From src/common/components only export the enhanced Progress so that accessing the Antd one directly becomes unlikely/harder.

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great... just had one question/suggestion about enforcing best practices by having only one export for progress bars in the codebase (your enhanced one, rather than AntD's).

Really appreciate the storybook entry. Trying to fill in more of those!

@rusackas rusackas merged commit 5b19398 into apache:master Dec 3, 2020
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.0.0 labels Mar 12, 2024
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/M 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants