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): "Customize" tab rendering behavior #15841

Merged
merged 2 commits into from
Jul 26, 2021
Merged

fix(Explore): "Customize" tab rendering behavior #15841

merged 2 commits into from
Jul 26, 2021

Conversation

geido
Copy link
Member

@geido geido commented Jul 22, 2021

SUMMARY

The bug was the consequence of different issues.

Issue with getDerivedStateFromProps:

This PR removes the getDerivedStateFromProps introduced by PR #14493 that was causing the Collapse to not re-render when changing viz type as the new props were not propagated down to the render phase. The removal does not seem to affect the functionality for which that PR was made. @villebro your confirmation will be appreciated here.

Issue with the Antdesign Collapse:

This problem seems related to a bug with Antdesign when multiple re-renders happen while the Collapse is opening up, causing the Collapse to render invisible (0 height). By forcing the rendering of a Loading component after changing the viz type/datasource, Antdesign is then able to properly render the Collapse.

Fixes: #15829

BEFORE

126574252-c1fb3e64-712e-4dc9-abf0-fd4306b36b44.mov

AFTER

DEV.Number.of.mp4

TESTING INSTRUCTIONS

  1. Open a chart in Explore
  2. Go to the Customize tab and make sure it opens correctly
  3. Change viz type
  4. Go again to the Customize tab and make sure it opens correctly

ADDITIONAL INFORMATION

  • Has associated issue: [explore] customize tab is broken #15829
  • 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

@geido
Copy link
Member Author

geido commented Jul 22, 2021

@geido geido changed the title fix(Explore): Customize tab rendering behavior fix(Explore): "Customize" tab rendering behavior Jul 22, 2021
@codecov
Copy link

codecov bot commented Jul 22, 2021

Codecov Report

Merging #15841 (de18a0f) into master (f6fe29d) will decrease coverage by 0.24%.
The diff coverage is 63.54%.

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

@@            Coverage Diff             @@
##           master   #15841      +/-   ##
==========================================
- Coverage   77.13%   76.88%   -0.25%     
==========================================
  Files         984      984              
  Lines       51706    51796      +90     
  Branches     6995     7032      +37     
==========================================
- Hits        39882    39825      -57     
- Misses      11600    11746     +146     
- Partials      224      225       +1     
Flag Coverage Δ
hive ?
javascript 71.80% <63.54%> (-0.02%) ⬇️
presto ?

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

Impacted Files Coverage Δ
...frontend/src/dashboard/components/Header/index.jsx 66.42% <0.00%> (-0.97%) ⬇️
...nfigModal/FiltersConfigForm/getControlItemsMap.tsx 87.50% <ø> (+1.53%) ⬆️
...-frontend/src/views/CRUD/welcome/ActivityTable.tsx 81.00% <ø> (+2.15%) ⬆️
superset/config.py 91.24% <ø> (ø)
...ontrols/DndColumnSelectControl/DndMetricSelect.tsx 41.48% <16.66%> (-2.97%) ⬇️
.../src/explore/components/ControlPanelsContainer.tsx 76.19% <25.00%> (-2.98%) ⬇️
...tersConfigModal/FiltersConfigForm/DefaultValue.tsx 25.00% <50.00%> (+4.16%) ⬆️
...onfigModal/FiltersConfigForm/FiltersConfigForm.tsx 74.34% <61.53%> (+0.58%) ⬆️
...set-frontend/src/views/CRUD/welcome/ChartTable.tsx 72.83% <63.63%> (-5.11%) ⬇️
...frontend/src/views/CRUD/welcome/DashboardTable.tsx 64.51% <63.63%> (-1.74%) ⬇️
... and 25 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 f6fe29d...548aace. Read the comment docs.

@geido
Copy link
Member Author

geido commented Jul 22, 2021

/testenv up

@github-actions
Copy link
Contributor

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

@rosemarie-chiu
Copy link
Contributor

rosemarie-chiu commented Jul 22, 2021

@geido I'm not sure if this is related to this fix, but see my video

Steps:

  1. Select bar chart and go to customize tab and collapse charts option
  2. Go back to data tab and select pie chart
  3. Go to customize tab and observe that the charts option is in expand mode (up arrow) but UI still blank
  4. Only after clicking collapse and expand again UI shows

If we to save the state of collapse, then I think UI should also reflect that it is currently in collapse (down arrow)

CleanShot.2021-07-22.at.10.13.58.mp4

@geido
Copy link
Member Author

geido commented Jul 22, 2021

@rosemarie-chiu thanks for spotting that one. From a first look, it appears to be a problem related to the original one. I will try to fix this issue as well with this PR. I'll ping you once I am done with this additional change.

@junlincc junlincc added the hold:testing! On hold for testing label Jul 22, 2021
@geido
Copy link
Member Author

geido commented Jul 22, 2021

@junlincc @rosemarie-chiu this should be good to go for another round of testing. I have updated the description as well.

@geido
Copy link
Member Author

geido commented Jul 22, 2021

/testenv up

@junlincc junlincc removed the hold:testing! On hold for testing label Jul 22, 2021
@github-actions
Copy link
Contributor

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

Copy link
Contributor

@rosemarie-chiu rosemarie-chiu left a comment

Choose a reason for hiding this comment

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

nice! Customize tab always have all section expanded. LGTM!

CleanShot 2021-07-22 at 16 23 09

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.

LGTM

@rusackas rusackas merged commit e6a3702 into apache:master Jul 26, 2021
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* Remove getDerivedStateFromProps

* Set loading
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* Remove getDerivedStateFromProps

* Set loading
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* Remove getDerivedStateFromProps

* Set loading
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* Remove getDerivedStateFromProps

* Set loading
@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 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 release:1.3.0 size/M 🚢 1.3.0
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

[explore] customize tab is broken
5 participants