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(viz): Show zero percent changes in Big Number Viz #20946

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

Antonio-RiveroMartnez
Copy link
Member

@Antonio-RiveroMartnez Antonio-RiveroMartnez commented Aug 2, 2022

SUMMARY

When preventing the division by zero we totally skipped zero percent changes to show. So, now if zero is present we avoid diving but still display zero.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
error

After:
test

TESTING INSTRUCTIONS

  1. Create a KPI with trendline
  2. Write "0" in Metrics / Custom SQL
  3. Chose time comparison period = 1

Expected results:
+0.0% and suffix displays.

ADDITIONAL INFORMATION

- When the value is zero we still render the percent change and suffix if present
@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #20946 (a0f6db9) into master (bfd2a3d) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #20946      +/-   ##
==========================================
- Coverage   66.38%   66.38%   -0.01%     
==========================================
  Files        1766     1766              
  Lines       67207    67222      +15     
  Branches     7129     7136       +7     
==========================================
+ Hits        44617    44622       +5     
- Misses      20766    20774       +8     
- Partials     1824     1826       +2     
Flag Coverage Δ
javascript 52.11% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...BigNumber/BigNumberWithTrendline/transformProps.ts 45.45% <0.00%> (-1.52%) ⬇️
...charts/src/Timeseries/Regular/Bar/controlPanel.tsx 31.25% <0.00%> (-4.47%) ⬇️
...gin-chart-echarts/src/Timeseries/transformProps.ts 54.65% <0.00%> (-1.31%) ⬇️
...mponents/controls/AnnotationLayerControl/index.jsx 9.67% <0.00%> (-0.50%) ⬇️
...end/src/components/Datasource/DatasourceEditor.jsx 65.87% <0.00%> (+0.13%) ⬆️
...tend/src/components/Datasource/CollectionTable.tsx 81.35% <0.00%> (+0.48%) ⬆️
...rc/explore/components/controls/TextAreaControl.jsx 81.81% <0.00%> (+1.81%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@stephenLYZ stephenLYZ left a comment

Choose a reason for hiding this comment

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

LGTM

@stephenLYZ stephenLYZ merged commit aa53c10 into apache:master Aug 3, 2022
eschutho pushed a commit that referenced this pull request Sep 20, 2022
- When the value is zero we still render the percent change and suffix if present

(cherry picked from commit aa53c10)
Fahrenheit35 pushed a commit to Fahrenheit35/superset that referenced this pull request Nov 11, 2022
- When the value is zero we still render the percent change and suffix if present

(cherry picked from commit aa53c10)
@mistercrunch mistercrunch added 🍒 2.0.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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 size/XS v2.0 v2.0.1 🍒 2.0.1 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants