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(sql lab): MultiSelector component render twice #20706

Merged
merged 2 commits into from
Jul 19, 2022

Conversation

diegomedina248
Copy link
Contributor

SUMMARY

As explained in #20702, when you select more than one table in SQL Lab and try to clear them all, then the component appears to be rerendering twice (or more).

The issue is that the tables are being removed one by one and, specially if the backend persistence is enabled, then, as the backend responds, the value of the select is updated only by that single table.

This PR ensures all tables are deleted at once, preventing the issue.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screen.Recording.2022-07-14.at.02.15.18.mov

After:

new.mov

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

Fixes #20702

  • 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

@codecov
Copy link

codecov bot commented Jul 14, 2022

Codecov Report

Merging #20706 (55a29d8) into master (6b0bb80) will increase coverage by 0.00%.
The diff coverage is 88.88%.

❗ Current head 55a29d8 differs from pull request most recent head 74aece8. Consider uploading reports for the commit 74aece8 to get more accurate results

@@           Coverage Diff           @@
##           master   #20706   +/-   ##
=======================================
  Coverage   66.83%   66.83%           
=======================================
  Files        1750     1750           
  Lines       65894    65898    +4     
  Branches     7017     7017           
=======================================
+ Hits        44041    44045    +4     
  Misses      20067    20067           
  Partials     1786     1786           
Flag Coverage Δ
javascript 51.94% <88.88%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...d/src/SqlLab/components/SqlEditorLeftBar/index.tsx 49.20% <0.00%> (ø)
superset-frontend/src/SqlLab/actions/sqlLab.js 60.44% <100.00%> (+0.22%) ⬆️
...ntend/src/SqlLab/components/TableElement/index.tsx 72.30% <100.00%> (ø)
superset-frontend/src/SqlLab/reducers/sqlLab.js 33.33% <100.00%> (+0.71%) ⬆️

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 6b0bb80...74aece8. Read the comment docs.

endpoint: encodeURI(`/tableschemaview/${table.id}`),
})
? Promise.all(
tables.map(table =>

Choose a reason for hiding this comment

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

Could tables be null or undefined at some point?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In theory no, but added a check there

@EugeneTorap
Copy link
Contributor

@diegomedina248 Thank you for this hot fix!
@michael-s-molina Can we merge it?

@michael-s-molina michael-s-molina merged commit 115ab70 into apache:master Jul 19, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.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/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SQL Lab] MultiSelector component render twice
5 participants