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: Replace usages of Popover from react-bootstrap with Antd #11163

Merged
merged 23 commits into from
Oct 20, 2020

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Oct 5, 2020

SUMMARY

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

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 Oct 7, 2020

Codecov Report

Merging #11163 into master will decrease coverage by 4.27%.
The diff coverage is 51.78%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11163      +/-   ##
==========================================
- Coverage   65.66%   61.39%   -4.28%     
==========================================
  Files         835      836       +1     
  Lines       39656    39676      +20     
  Branches     3604     3607       +3     
==========================================
- Hits        26042    24359    -1683     
- Misses      13505    15136    +1631     
- Partials      109      181      +72     
Flag Coverage Δ
#cypress ?
#javascript 62.68% <51.78%> (+0.01%) ⬆️
#python 60.62% <ø> (-0.28%) ⬇️

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

Impacted Files Coverage Δ
...rontend/src/SqlLab/components/ShareSqlLabQuery.jsx 93.54% <ø> (ø)
...rontend/src/SqlLab/components/SqlEditorLeftBar.jsx 41.66% <ø> (-6.34%) ⬇️
...-frontend/src/common/components/common.stories.tsx 0.00% <0.00%> (ø)
...set-frontend/src/components/URLShortLinkButton.jsx 88.23% <ø> (-11.77%) ⬇️
...rc/explore/components/controls/AnnotationLayer.jsx 0.00% <ø> (-51.41%) ⬇️
...ore/components/controls/AnnotationLayerControl.jsx 8.82% <0.00%> (-72.13%) ⬇️
...explore/components/controls/ColorPickerControl.jsx 85.00% <ø> (ø)
...rc/explore/components/controls/ViewportControl.jsx 82.60% <ø> (ø)
...ntend/src/explore/components/AdhocFilterOption.jsx 51.61% <25.00%> (-33.01%) ⬇️
...explore/components/AdhocMetricEditPopoverTitle.jsx 65.62% <44.44%> (-19.00%) ⬇️
... and 196 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 735123d...4b1dfb7. Read the comment docs.

@@ -21,10 +21,6 @@
@import '~antd/lib/style/mixins/index';
@import '~antd/lib/style/core/base';

*[class*='ant-'] {
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 this import, because [class='ant-'] selector gives global antd styles higher specifity than our styles and margins, font sizes etc. for some components were overriden. For example the margins of button components were reset to 0 when placed inside of popovers. I haven't found a valid use case of these styles so it seems to me that it's safe to delete them. However, I would appreciate a confirmation or a comment if we can't simply remove them.

Copy link
Member

Choose a reason for hiding this comment

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

I think the reason this was included is so that the color variables below it in the code are inserted into the global styles. Can you confirm whether or not these colors are still being applied to elements correctly?

That said, I'm really hoping to kill off LESS variables at some point, so everything uses variables pulled in from the Emotion Theme... maybe this is the time to start looking at a better way (Emotion or otherwise) to import/use the Theme colors for all the AntD components we're now using. Thoughts?

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 global styles don't seem to use the colour variables we have defined below and it appears that the components are styled correctly.
As for moving on from LESS variables to Emotion, it sounds good, but I'd suggest creating a separate task/issue and refactoring it in a separate PR. This one is far too big already...

@kgabryje
Copy link
Member Author

kgabryje commented Oct 7, 2020

@suddjian Could you please take a look?

@kgabryje kgabryje changed the title refactor: Replace usages of Popover from react-bootstrap with Antd [WIP] refactor: Replace usages of Popover from react-bootstrap with Antd Oct 7, 2020
Copy link
Member

@suddjian suddjian left a comment

Choose a reason for hiding this comment

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

LGTM, though I'm not really sure what's the deal with that *[class*='ant-'] CSS. If everything seems fine without it then I'd be okay with getting rid of it.

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

LGTM, happy to merge as checks pass

@mistercrunch
Copy link
Member

E2E tests still failing here :(

@kgabryje kgabryje closed this Oct 19, 2020
@kgabryje kgabryje reopened this Oct 19, 2020
@kgabryje kgabryje closed this Oct 19, 2020
@kgabryje kgabryje reopened this Oct 19, 2020
@kgabryje kgabryje closed this Oct 19, 2020
@kgabryje kgabryje reopened this Oct 19, 2020
@kgabryje kgabryje closed this Oct 19, 2020
@kgabryje kgabryje reopened this Oct 19, 2020
@kgabryje
Copy link
Member Author

@mistercrunch I fixed the tests, they should pass now. However, this PR might have some changes conflicting with the Tabs PRs, so depending which feature we merge first, the tests in the other might start failing again. I'll keep an eye on that!

@kgabryje
Copy link
Member Author

@mistercrunch Python / pre-commit has failed several times in a row, though no changes were done to Python codebase. Is it possible that a faulty code was merged to master? Can we get a fix for that?

superset/config.py:959: error: Incompatible import of "CeleryConfig" (imported name has type "Type[superset_config.CeleryConfig]", local name has type "Type[superset.config.CeleryConfig]")
superset/config.py:959: error: Incompatible import of "CELERY_CONFIG" (imported name has type "Type[superset_config.CeleryConfig]", local name has type "Type[superset.config.CeleryConfig]")
Found 2 errors in 1 file (checked 529 source files)

@kgabryje kgabryje closed this Oct 19, 2020
@kgabryje kgabryje reopened this Oct 19, 2020
@kgabryje kgabryje closed this Oct 19, 2020
@kgabryje kgabryje reopened this Oct 19, 2020
@rusackas rusackas merged commit 901a42b into apache:master Oct 20, 2020
serenajiang added a commit to airbnb/superset-fork that referenced this pull request Oct 23, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
…pache#11163)

* New popover component

* LimitControl

* Moar components migrated

* TimeSeriesColumnControl

* Hotkeys

* ColorPicker

* FilterBoxItemCOntrol

* AdhocFilterEditPopover

* AdhocMetric

* AnnotationLayerControl

* DateFilterControl

* Tests fix

* Fix linting issue

* Fix tests

* Bug fix

* Test fix

* Remove Antd global stylesheet

* Fix linting

* Fix test

* Fix test

* Fix test

* Fix test

* Fix test
@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/XXL 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants