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(explore): DndColumnSelect sometimes not working with multi: false #15731

Merged
merged 2 commits into from
Jul 16, 2021

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Jul 16, 2021

SUMMARY

Due to incorrect handling of multi: false prop in DndColumnSelect, we sometimes passed an array of arrays of column names, when the chart was expecting an array of column names. Moreover, I noticed that sometimes when we create a chart and then change dataset, chart still tries to use some column names from the old dataset.
This PR fixes both issues.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: see #15532
After:
https://user-images.githubusercontent.com/15073128/125910050-317b3f22-8ccd-4a42-b14d-06c01cb38421.mov

TESTING INSTRUCTIONS

  1. Set ENABLE_EXPLORE_DRAG_AND_DROP to True
  2. Create a chart that uses controls that accept only single column, e.g. Chord
  3. Verify that chart is created correctly
  4. Change dataset and try to create a chart again
  5. Verify that there are no "leftovers" from previous dataset (before, sometimes chart tried to use column names from previous dataset even though they were removed from controls)

ADDITIONAL INFORMATION

CC: @junlincc

@codecov
Copy link

codecov bot commented Jul 16, 2021

Codecov Report

Merging #15731 (6160881) into master (0721f54) will increase coverage by 0.00%.
The diff coverage is 60.71%.

❗ Current head 6160881 differs from pull request most recent head 48d9596. Consider uploading reports for the commit 48d9596 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master   #15731   +/-   ##
=======================================
  Coverage   76.91%   76.92%           
=======================================
  Files         983      983           
  Lines       51602    51609    +7     
  Branches     6980     6988    +8     
=======================================
+ Hits        39688    39698   +10     
+ Misses      11691    11688    -3     
  Partials      223      223           
Flag Coverage Δ
javascript 71.36% <60.71%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
...ontrols/DndColumnSelectControl/DndColumnSelect.tsx 64.44% <59.09%> (+4.44%) ⬆️
...ols/DndColumnSelectControl/utils/optionSelector.ts 46.15% <66.66%> (+11.67%) ⬆️

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 0721f54...48d9596. Read the comment docs.

Copy link
Member

@zhaoyongjie zhaoyongjie 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 the fix.

@geido
Copy link
Member

geido commented Jul 16, 2021

/testenv up FEATURE_ENABLE_EXPLORE_DRAG_AND_DROP=true

@github-actions
Copy link
Contributor

@geido Ephemeral environment spinning up at http://34.220.91.236:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@kgabryje kgabryje merged commit 66c28d6 into apache:master Jul 16, 2021
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
…apache#15731)

* fix(explore): DndColumnSelect not working with multi: false

* fix values not synchronized when dataset changes
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
…apache#15731)

* fix(explore): DndColumnSelect not working with multi: false

* fix values not synchronized when dataset changes
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
…apache#15731)

* fix(explore): DndColumnSelect not working with multi: false

* fix values not synchronized when dataset changes
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.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 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Explore-drag&drop ]DnD control returns an array of columns when it’s a single selection
4 participants