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(dashboard): fixed FullSize charts broken #13986

Closed
wants to merge 2 commits into from
Closed

Conversation

toop
Copy link
Contributor

@toop toop commented Apr 7, 2021

SUMMARY

When you click the “Maximize chart” option of the chart in the dashboard, the chart is incomplete。

BEFORE:

image

AFTER:

image

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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
    @junlincc @zhaoyongjie

@codecov
Copy link

codecov bot commented Apr 7, 2021

Codecov Report

Merging #13986 (095c0fb) into master (a82d72f) will increase coverage by 0.08%.
The diff coverage is 70.00%.

❗ Current head 095c0fb differs from pull request most recent head 1d40d3c. Consider uploading reports for the commit 1d40d3c to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13986      +/-   ##
==========================================
+ Coverage   79.12%   79.21%   +0.08%     
==========================================
  Files         936      936              
  Lines       47411    47408       -3     
  Branches     5939     5940       +1     
==========================================
+ Hits        37516    37553      +37     
+ Misses       9768     9728      -40     
  Partials      127      127              
Flag Coverage Δ
cypress 56.04% <62.50%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...ashboard/components/gridComponents/ChartHolder.jsx 80.48% <0.00%> (ø)
...src/explore/components/controls/VizTypeControl.jsx 92.06% <83.33%> (+1.29%) ⬆️
...tend/src/views/CRUD/annotation/AnnotationModal.tsx 62.96% <100.00%> (-0.28%) ⬇️
superset/models/core.py 89.37% <0.00%> (+0.27%) ⬆️
superset/connectors/sqla/models.py 90.76% <0.00%> (+1.43%) ⬆️
superset/db_engine_specs/presto.py 88.30% <0.00%> (+5.42%) ⬆️

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 a82d72f...1d40d3c. Read the comment docs.

@zhaoyongjie
Copy link
Member

zhaoyongjie commented Apr 7, 2021

LGTM, thanks for this fix.

before screen recording

zoom.in.out.in.dashboard.before.mov

after screen recording

zoom.in.out.in.dashboard.after.mov

@zhaoyongjie zhaoyongjie self-requested a review April 7, 2021 12:43
@toop
Copy link
Contributor Author

toop commented Apr 7, 2021 via email

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

@zhaoyongjie zhaoyongjie changed the title fix: fixed FullSize charts broken #13600 fix: fixed FullSize charts broken Apr 7, 2021
Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

since this was a regression, is there any way we could add a test for it? If not, lgtm, but ideally we could prevent this happening again (since this isn't a commonly tested feature)

@junlincc
Copy link
Member

junlincc commented Apr 7, 2021

@toop please do add test. 🙏

@junlincc junlincc changed the title fix: fixed FullSize charts broken fix(dashboard): fixed FullSize charts broken Apr 8, 2021
@amitmiran137 amitmiran137 removed the v1.2 label Apr 19, 2021
@@ -245,8 +245,8 @@ class ChartHolder extends React.Component {
let chartHeight = 0;

if (this.state.isFullSize) {
chartWidth = document.body.clientWidth - CHART_MARGIN;
chartHeight = document.body.clientHeight - CHART_MARGIN;
chartWidth = window.screen.width - CHART_MARGIN;
Copy link
Member

@zhaoyongjie zhaoyongjie Apr 27, 2021

Choose a reason for hiding this comment

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

Hi there, why we use window.screen.width instead of window.innerWidth(previous implementation for you). The window.screen.width looks like it always gets the whole screen width instead of the browser width.

Thanks again for your contribution!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I 'm sorry! It's not thoughtful. I change it back

@zhaoyongjie
Copy link
Member

zhaoyongjie commented Apr 27, 2021

@toop Could you fix the CI? thanks

@toop toop closed this Apr 30, 2021
@toop toop deleted the toop branch May 7, 2021 01:12
@toop toop restored the toop branch May 7, 2021 01:13
@toop toop deleted the toop branch May 7, 2021 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants