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(modal): add primary button loading state to modals #20018

Merged
merged 1 commit into from
May 18, 2022

Conversation

kgopal492
Copy link
Contributor

@kgopal492 kgopal492 commented May 10, 2022

SUMMARY

  • Rationale: Saving a resource is not always instantaneous. In the AddDatasetModal, while a dataset is being saved, the primary "Add" button is not disabled - allowing user to click on the "Add" button multiple times while the resource is being saved. This allows the user to add duplicate datasets
  • This PR adds a primaryButtonLoading prop to the Modal component
  • The AddDatasetModal passes a loading prop to the Modal component while the resource creation is loading

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2022-05-10.at.12.53.15.PM.mov

TESTING INSTRUCTIONS

  • Add delay to superset.datasets.api.py in the POST function on the \ path (dataset creation path)
  • Add a new dataset and verify that the button is disabled & loading while the dataset is being created

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

@rusackas
Copy link
Member

@jess-dillard pinging for any design feedback you see fit.

@ghost
Copy link

ghost commented May 11, 2022

@rusackas Looks good to me!

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

This is great, thank you!

@codecov
Copy link

codecov bot commented May 18, 2022

Codecov Report

Merging #20018 (3770e6f) into master (1f0daa9) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master   #20018   +/-   ##
=======================================
  Coverage   66.29%   66.29%           
=======================================
  Files        1712     1712           
  Lines       63974    63975    +1     
  Branches     6731     6732    +1     
=======================================
+ Hits        42410    42411    +1     
  Misses      19853    19853           
  Partials     1711     1711           
Flag Coverage Δ
javascript 51.27% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset-frontend/src/components/Modal/Modal.tsx 86.15% <100.00%> (+0.21%) ⬆️
...nd/src/views/CRUD/data/dataset/AddDatasetModal.tsx 41.66% <100.00%> (ø)

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 1f0daa9...3770e6f. Read the comment docs.

@eschutho eschutho merged commit 63702c4 into apache:master May 18, 2022
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 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/XS 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants