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 react-bootstrap Modals with Antd in Datasource #11390

Merged
merged 12 commits into from
Oct 28, 2020

Conversation

kgabryje
Copy link
Member

SUMMARY

Replaces usages of react-bootstrap Modals with Antd in datasource/.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

The Modals look almost the same as before. The difference is the colour of the Title bar and that the new modals are placed a bit lower. Example below.

Before:
image

After:
image

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

@kgabryje
Copy link
Member Author

@rusackas @etr2460 Can you please take a look?

@codecov-io
Copy link

codecov-io commented Oct 23, 2020

Codecov Report

Merging #11390 into master will decrease coverage by 9.72%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11390      +/-   ##
==========================================
- Coverage   66.59%   56.86%   -9.73%     
==========================================
  Files         863      407     -456     
  Lines       40986    13647   -27339     
  Branches     3694     3476     -218     
==========================================
- Hits        27295     7761   -19534     
+ Misses      13594     5724    -7870     
- Partials       97      162      +65     
Flag Coverage Δ
#cypress 56.86% <0.00%> (-0.04%) ⬇️
#javascript ?
#python ?

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

Impacted Files Coverage Δ
...set-frontend/src/common/components/Modal/Modal.tsx 100.00% <ø> (ø)
superset-frontend/src/components/DeleteModal.tsx 100.00% <ø> (ø)
...-frontend/src/datasource/ChangeDatasourceModal.tsx 8.92% <0.00%> (-65.27%) ⬇️
...perset-frontend/src/datasource/DatasourceModal.tsx 76.74% <ø> (-16.12%) ⬇️
...nd/src/views/CRUD/data/dataset/AddDatasetModal.tsx 12.00% <ø> (-45.58%) ⬇️
...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%) ⬇️
...et-frontend/src/components/Menu/LanguagePicker.tsx 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%) ⬇️
... and 685 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 eecabf9...3df3112. Read the comment docs.

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.

One main nit to address about skipped tests, and a couple other questions, but generally looking good!

@kgabryje
Copy link
Member Author

kgabryje commented Oct 28, 2020

@rusackas I did a rebase and I was forced to add data-test to Modal that won't be removed by the babel plugin - Antd Modals don't accept data-test prop normally, I had to pass it through wrapProps. However I don't think it's a major problem as the modals are lazy rendered, so that data-test would show up in HTML only after a user opens a modal.
Here's a discussion: ant-design/ant-design#8561. It seems that most of Antd components accept a data-test attribute, but not Modal (see the last comment)

I also changed a data-test name from modal-delete-button to modal-confirm-button, as "delete" would only make sense for 1 specific use case of our Modal component. "Confirm" sounds more generic.

@rusackas rusackas merged commit 52294c8 into apache:master Oct 28, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
…che#11390)

* ChangeDatasourceModal

* DatasourceModal

* DeleteModal, AddDatasetModal

* Fix tests

* Remove unused file

* Fix e2e tests

* Fix test

* Remove it.only

* Fix after rebase

* Fix e2e tests

* Fix data-test in modal

* Lint fix
@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/L 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants