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: Bootstrap to AntD - Collapse #12920

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

michael-s-molina
Copy link
Member

SUMMARY

  • Migrates Collapse component from Bootstrap to AntD.
  • Unifies all Collapse stories into a single one with controls support.
  • Moves Collapse component to own folder.
  • Fixes padding and border in storybook gallery examples.
  • Increases clickable area in SQL Lab collapsable tables.

See: #10254

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen Shot 2021-02-02 at 4 23 50 PM

Screen Shot 2021-02-02 at 4 21 34 PM

Screen Shot 2021-02-02 at 4 24 15 PM

Screen Shot 2021-02-02 at 4 21 01 PM

Screen Shot 2021-02-02 at 4 24 53 PM

Screen Shot 2021-02-02 at 4 19 04 PM

Screen Shot 2021-02-02 at 4 25 29 PM

Screen Shot 2021-02-02 at 4 20 28 PM

Screen Shot 2021-02-02 at 4 26 02 PM

Screen Shot 2021-02-02 at 4 17 25 PM

@rusackas @junlincc @geido

TEST PLAN

1 - Open any screen that contains a Collapse (explore, welcome, dashboards, etc.)
2 - All collapse components should have the same theme and behavior
3 - Additional testing can be done using Storybook

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

@codecov-io
Copy link

codecov-io commented Feb 3, 2021

Codecov Report

Merging #12920 (5b62a9c) into master (9b5e66b) will decrease coverage by 13.73%.
The diff coverage is 10.34%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #12920       +/-   ##
===========================================
- Coverage   72.29%   58.55%   -13.74%     
===========================================
  Files         864      478      -386     
  Lines       44883    15977    -28906     
  Branches     5403     4121     -1282     
===========================================
- Hits        32450     9356    -23094     
+ Misses      12224     6621     -5603     
+ Partials      209        0      -209     
Flag Coverage Δ
cypress 58.55% <10.34%> (?)
javascript ?
python ?

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

Impacted Files Coverage Δ
...et-frontend/src/SqlLab/components/TableElement.jsx 5.88% <0.00%> (-80.64%) ⬇️
...-frontend/src/common/components/Collapse/index.tsx 94.73% <ø> (ø)
...t-frontend/src/common/components/Tooltip/index.tsx 100.00% <ø> (ø)
superset-frontend/src/common/components/index.tsx 100.00% <ø> (ø)
superset-frontend/src/components/Button/index.tsx 100.00% <ø> (ø)
...dashboard/components/FiltersBadge/DetailsPanel.tsx 54.05% <ø> (-0.50%) ⬇️
.../src/explore/components/ControlPanelsContainer.jsx 86.73% <ø> (+11.22%) ⬆️
...frontend/src/explore/components/DataTablesPane.tsx 56.52% <ø> (+32.47%) ⬆️
...rontend/src/explore/components/DatasourcePanel.tsx 68.29% <ø> (-10.88%) ⬇️
...plore/components/controls/FixedOrMetricControl.jsx 9.25% <0.00%> (-43.47%) ⬇️
... and 787 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 9b5e66b...5b62a9c. Read the comment docs.

@michael-s-molina michael-s-molina force-pushed the bootstrap-to-antd-collapse branch 2 times, most recently from 9f1538e to 2561ba3 Compare February 8, 2021 19:38
@rusackas rusackas added the hold! On hold label Feb 16, 2021
@rusackas rusackas added hold:testing! On hold for testing and removed hold! On hold labels Feb 18, 2021
> .ant-collapse-item.ant-collapse-no-arrow
> .ant-collapse-header {
border: 0px;
padding: 0px 0px 8px 0px;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
padding: 0px 0px 8px 0px;
padding: 0px 0px 8px 0px;

Nit, but would be nice to use gridUnits here and in the .well selector below.

Also, I think this deep selector is definitely better than !important, but now I'm just curious if we can tack on an id to the element itself, and use &#someID.ant-... to to throw a little more value at the selector weighting.

Copy link
Member Author

Choose a reason for hiding this comment

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

Applied gridUnit.

About the ID the & is transformed into a unique class name by emotion giving the appropriate weighting value.

)}
{this.state.type === controlTypes.metric && (
<span>
<span style={{ fontWeight: 'normal' }}>metric: </span>
Copy link
Member

Choose a reason for hiding this comment

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

This looks like it would be normal font weight, and not need this style prop. But if it does need an override, it might be nice to use the css prop and pull in theme.typography.weights.normal here.

Copy link
Member

Choose a reason for hiding this comment

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

I realize this is just stuff carried over... no need to worry here I suppose, as we'll probably audit all style attributes at some point.

Copy link
Member Author

Choose a reason for hiding this comment

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

We didn't need that style. Fixed.

>
<div className="well">
<PopoverSection
title="Fixed"
Copy link
Member

Choose a reason for hiding this comment

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

Another out-of-scope item since it's not pertinent to the intent of this PR, but maybe worth adding a t() here and the "Based on a metric" title below?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

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 PR is looking great in general. Most of my comments are either small nits, or tangential things I noticed that aren't part of the PR's intended effort.

The only thing holding up my approval is the export of the AntD component we don't want people using, if we're to favor the customized one.

@michael-s-molina
Copy link
Member Author

@rusackas I tackled your comments and also added tests for Collapse.

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.

LGTM, thanks for all the touch-ups! Looks like a minor rebase is needed, and I'll merge it.

@michael-s-molina
Copy link
Member Author

LGTM, thanks for all the touch-ups! Looks like a minor rebase is needed, and I'll merge it.

Rebased.

@rusackas rusackas merged commit 9a05d6a into apache:master Feb 23, 2021
@junlincc junlincc removed the hold:testing! On hold for testing label Mar 15, 2021
@junlincc
Copy link
Member

junlincc commented Mar 16, 2021

@michael-s-molina
I know we standardize the collapsing behavior, but previously in SQL, table metadata (column) used to be expanded by default. Let's change it back, only for this case? thanks.🙏

@michael-s-molina
Copy link
Member Author

@michael-s-molina
I know we standardize the collapsing behavior, but previously in SQL, table metadata (column) used to be expanded by default. Let's change it back, only for this case? thanks.🙏

Fixed in #13624

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.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/XL 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants