Skip to content

Commit

Permalink
chore: Rename Totals to Summary in table chart (#29360)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored and eschutho committed Jul 24, 2024
1 parent 7e3a273 commit fdabe2e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
30 changes: 25 additions & 5 deletions superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -891,7 +891,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
/* 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"
Expand Down Expand Up @@ -965,7 +965,27 @@ export default function TableChart<D extends DataRecord = DataRecord>(
),
Footer: totals ? (
i === 0 ? (
<th>{t('Totals')}</th>
<th>
<div
css={css`
display: flex;
align-items: center;
& svg {
margin-left: ${theme.gridUnit}px;
color: ${theme.colors.grayscale.dark1} !important;
}
`}
>
{t('Summary')}
<Tooltip
overlay={t(
'Show total aggregations of selected metrics. Note that row limit does not apply to the result.',
)}
>
<InfoCircleOutlined />
</Tooltip>
</div>
</th>
) : (
<td style={sharedStyle}>
<strong>{formatColumnValue(column, totals[key])[1]}</strong>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down

0 comments on commit fdabe2e

Please sign in to comment.