From fe9e96a3d8a423d39fe05a74477fa584546c40e3 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" Date: Tue, 25 Jun 2024 08:57:41 -0300 Subject: [PATCH] fix: Rename Totals to Summary --- .../src/plugin/controls/metrics.tsx | 2 +- .../plugin-chart-table/src/TableChart.tsx | 30 +++++++++++++++---- .../plugin-chart-table/src/controlPanel.tsx | 2 +- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/metrics.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/metrics.tsx index 67a55cff0d3af..dd1516098a53c 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/metrics.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/metrics.tsx @@ -102,7 +102,7 @@ export const showTotalsControlSetItem: ControlSetItem = { name: 'show_totals', config: { type: 'CheckboxControl', - label: t('Show totals'), + label: t('Show summary'), default: false, description: t( 'Show total aggregations of selected metrics. Note that row limit does not apply to the result.', diff --git a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx index e82d63d2f1b78..37bdbed9d1c78 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx @@ -52,16 +52,16 @@ import { tn, useTheme, } from '@superset-ui/core'; -import { Dropdown, Menu } from '@superset-ui/chart-controls'; +import { Dropdown, Menu, Tooltip } from '@superset-ui/chart-controls'; import { CheckOutlined, + InfoCircleOutlined, DownOutlined, MinusCircleOutlined, PlusCircleOutlined, TableOutlined, } from '@ant-design/icons'; - -import { isEmpty } from 'lodash'; +import { isEmpty, isNumber } from 'lodash'; import { ColorSchemeEnum, DataColumnMeta, @@ -891,7 +891,7 @@ export default function TableChart( /* The following classes are added to support custom CSS styling */ className={cx( 'cell-bar', - value && value < 0 ? 'negative' : 'positive', + isNumber(value) && value < 0 ? 'negative' : 'positive', )} css={cellBarStyles} role="presentation" @@ -965,7 +965,27 @@ export default function TableChart( ), Footer: totals ? ( i === 0 ? ( - {t('Totals')} + +
+ {t('Summary')} + + + +
+ ) : ( {formatColumnValue(column, totals[key])[1]} diff --git a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx index 1e541a4436b10..91e2c5143a5bc 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx @@ -368,7 +368,7 @@ const config: ControlPanelConfig = { name: 'show_totals', config: { type: 'CheckboxControl', - label: t('Show totals'), + label: t('Show summary'), default: false, description: t( 'Show total aggregations of selected metrics. Note that row limit does not apply to the result.',