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: chart disappears in standalone slice when resizing #12606

Merged

Conversation

duynguyenhoang
Copy link
Contributor

SUMMARY

Add ref to standalone chart render

TEST PLAN

  • Go to standalone chart url; verify that chart is rendered properly
  • Go to explore window; resize panels and verify everything is rendered properly

ADDITIONAL INFORMATION

@codecov-io
Copy link

codecov-io commented Jan 19, 2021

Codecov Report

Merging #12606 (b1ccd69) into master (c347ddb) will decrease coverage by 2.50%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12606      +/-   ##
==========================================
- Coverage   65.69%   63.18%   -2.51%     
==========================================
  Files        1015      486     -529     
  Lines       49651    29982   -19669     
  Branches     4839        0    -4839     
==========================================
- Hits        32618    18945   -13673     
+ Misses      16889    11037    -5852     
+ Partials      144        0     -144     
Flag Coverage Δ
cypress ?
javascript ?
python 63.18% <100.00%> (-0.81%) ⬇️

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

Impacted Files Coverage Δ
superset/charts/api.py 82.68% <100.00%> (ø)
superset/db_engines/hive.py 0.00% <0.00%> (-85.72%) ⬇️
superset/sql_validators/postgres.py 50.00% <0.00%> (-50.00%) ⬇️
superset/db_engine_specs/hive.py 54.61% <0.00%> (-29.24%) ⬇️
superset/db_engine_specs/sqlite.py 65.62% <0.00%> (-9.38%) ⬇️
superset/databases/commands/create.py 83.67% <0.00%> (-8.17%) ⬇️
superset/databases/commands/update.py 85.71% <0.00%> (-8.17%) ⬇️
superset/connectors/sqla/models.py 84.31% <0.00%> (-6.28%) ⬇️
superset/databases/commands/test_connection.py 84.78% <0.00%> (-4.35%) ⬇️
superset/utils/celery.py 96.42% <0.00%> (-3.58%) ⬇️
... and 540 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 c347ddb...b1ccd69. Read the comment docs.

@duynguyenhoang duynguyenhoang force-pushed the fix/chart-disappear-standalone-mode branch from b05ff76 to b1ccd69 Compare January 19, 2021 18:45
Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

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

LGTM

if (props.standalone) {
// dom manipulation hack to get rid of the boostrap theme's body background
const standaloneClass = 'background-transparent';
const bodyClasses = document.body.className.split(' ');
if (!bodyClasses.includes(standaloneClass)) {
document.body.className += ` ${standaloneClass}`;
}
return renderChart();
return standaloneChartBody;
Copy link
Member

Choose a reason for hiding this comment

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

I understand it is for consistency, but memorization is probably not needed here.

Copy link
Member

Choose a reason for hiding this comment

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

Rendering a single <div> element should be fairly efficient.

@ktmud ktmud merged commit 862ddd9 into apache:master Jan 19, 2021
@ktmud ktmud changed the title fix: chart disappears in standalone slice fix: chart disappears in standalone slice when resizing Jan 19, 2021
@duynguyenhoang duynguyenhoang deleted the fix/chart-disappear-standalone-mode branch January 20, 2021 05:31
dpgaspar pushed a commit to preset-io/superset that referenced this pull request Jan 20, 2021
@mistercrunch mistercrunch added 🍒 1.0.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.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 size/XS v1.0.1 🍒 1.0.1 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants