You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/08/24 16:21:28 UTC

[superset] 03/04: fix(table): condition formatting can't formate 0 values (#24008)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/superset.git

commit f5d2075aceee0f7be463b0dcd0766b6a8f8ce9ef
Author: Stepan <66...@users.noreply.github.com>
AuthorDate: Thu Aug 24 17:01:40 2023 +0300

    fix(table): condition formatting can't formate 0 values (#24008)
    
    (cherry picked from commit 0d5be8e3f6c0b1ca62bf52fe933bc516d2f509e0)
---
 superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
index fd5ce8aa3e..72bcb71d29 100644
--- a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
+++ b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
@@ -461,9 +461,10 @@ export default function TableChart<D extends DataRecord = DataRecord>(
             columnColorFormatters!
               .filter(formatter => formatter.column === column.key)
               .forEach(formatter => {
-                const formatterResult = value
-                  ? formatter.getColorFromValue(value as number)
-                  : false;
+                const formatterResult =
+                  value || value === 0
+                    ? formatter.getColorFromValue(value as number)
+                    : false;
                 if (formatterResult) {
                   backgroundColor = formatterResult;
                 }