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): metric label disappearing in some scenarios #16190

Merged
merged 1 commit into from
Aug 11, 2021

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Aug 11, 2021

SUMMARY

When user added an adhoc metric, then opened a popover to edit that metric and clicked "Save" without doing any changes, the metric label would disappear. This PR adds a check if old and edited metric are equal - if they are, no actions are taken.

Basically what happened was that when we saved a metric without any changes, we didn't call coerceAdhocMetrics (which converts an object to AdhocMetric), but we did call onChange. The result was that we passed a normal object instead of AdhocMetric instance to value renderer, and in value renderer we checked for instanceof AdhocMetric

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: see linked issue
After:
https://user-images.githubusercontent.com/15073128/129003100-1701671f-b658-49ad-bb2e-3ed13c0e5207.mov

TESTING INSTRUCTIONS

  1. Enable dnd
  2. Create a chart and add an adhoc metric
  3. Open a popover to edit that metric and click save without doing any changes
  4. The metric label should stay as it was, no changes should happen

ADDITIONAL INFORMATION

CC @jinghua-qa @junlincc

@codecov
Copy link

codecov bot commented Aug 11, 2021

Codecov Report

Merging #16190 (0885ebb) into master (4df3672) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

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

@@            Coverage Diff             @@
##           master   #16190      +/-   ##
==========================================
- Coverage   76.83%   76.82%   -0.01%     
==========================================
  Files         996      996              
  Lines       53060    53062       +2     
  Branches     6766     6767       +1     
==========================================
  Hits        40766    40766              
- Misses      12066    12068       +2     
  Partials      228      228              
Flag Coverage Δ
javascript 71.16% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...ontrols/DndColumnSelectControl/DndMetricSelect.tsx 41.21% <0.00%> (-0.57%) ⬇️

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 4df3672...b8345d6. Read the comment docs.

@kgabryje
Copy link
Member Author

/testenv up FEATURE_ENABLE_EXPLORE_DRAG_AND_DROP=true

@github-actions
Copy link
Contributor

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

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM and tested to work well!

@kgabryje kgabryje merged commit 98fc29c into apache:master Aug 11, 2021
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@rosemarie-chiu
Copy link
Contributor

🏷 2021.31

stevenuray pushed a commit to preset-io/superset that referenced this pull request Aug 13, 2021
@villebro villebro added the v1.3 label Aug 16, 2021
villebro pushed a commit that referenced this pull request Aug 16, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🍒 1.3.0 🍒 1.3.1 🍒 1.3.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.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 preset:2021.31 size/XS v1.3 🍒 1.3.0 🍒 1.3.1 🍒 1.3.2 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants