superset icon indicating copy to clipboard operation
superset copied to clipboard

fix: don't color empty cells in table chart with color formatters

Open mayurnewase opened this issue 3 years ago • 1 comments

SUMMARY

If cell value is null don't color it in table chart with conditional formatting, will fix pivot table later if it has similar issue. fixes: https://github.com/apache/superset/issues/21341

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screenshot from 2022-09-17 14-47-47

After:

Screenshot from 2022-09-17 14-48-23

TESTING INSTRUCTIONS

  1. create virtual dataset with following query SELECT 34523.323 as gmv, 24523.323 as fm, '1' as shem, '1' as gr UNION all SELECT 325323543.323 as gmv, 125323543.323 as fm, '2' as shem, '1' as gr UNION all SELECT null as gmv, 4764545.323 as fm, '3' as shem, '2' as gr UNION all SELECT -10 as gmv, 35254525.323 as fm, '4' as shem, '2' as gr

  2. create table chart with raw records, and from the customize tab set the conditional color formatter on columngmv with condition < 1

  3. test only colored cell is -10 in gmv column.

ADDITIONAL INFORMATION

  • [x] Has associated issue: https://github.com/apache/superset/issues/21341
  • [ ] Required feature flags:
  • [ ] 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

mayurnewase avatar Sep 17 '22 09:09 mayurnewase

Codecov Report

Merging #21501 (e4cf266) into master (6e8cad3) will increase coverage by 0.14%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #21501      +/-   ##
==========================================
+ Coverage   66.59%   66.74%   +0.14%     
==========================================
  Files        1791     1793       +2     
  Lines       68554    68450     -104     
  Branches     7319     7276      -43     
==========================================
+ Hits        45653    45685      +32     
+ Misses      21008    20890     -118     
+ Partials     1893     1875      -18     
Flag Coverage Δ
javascript 53.01% <100.00%> (+0.24%) :arrow_up:

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

Impacted Files Coverage Δ
...tend/plugins/plugin-chart-table/src/TableChart.tsx 45.08% <100.00%> (+4.62%) :arrow_up:
.../legacy-plugin-chart-histogram/src/controlPanel.ts 40.00% <0.00%> (-10.00%) :arrow_down:
superset-frontend/src/hooks/apiResources/tables.ts 80.00% <0.00%> (-1.25%) :arrow_down:
...gin-chart-echarts/src/Timeseries/transformProps.ts 52.38% <0.00%> (-1.20%) :arrow_down:
...rontend/src/visualizations/FilterBox/FilterBox.jsx 49.61% <0.00%> (ø)
.../src/dashboard/components/RefreshIntervalModal.tsx 80.00% <0.00%> (ø)
.../plugin-chart-echarts/src/Timeseries/buildQuery.ts 66.66% <0.00%> (ø)
.../superset-ui-core/src/query/normalizeTimeColumn.ts 100.00% <0.00%> (ø)
...e/components/controls/SelectAsyncControl/index.tsx 54.83% <0.00%> (ø)
...et-ui-chart-controls/src/operators/sortOperator.ts 100.00% <0.00%> (ø)
... and 35 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Sep 17 '22 11:09 codecov[bot]