Skip to content

Commit f686891

Browse files
authored
fix: Remove totals table rows from displayed row count (#1492)
Fixes #1407. When aggregations were added, both the table and column tooltips displayed an increased row count to account for the totals table. Rows from the totals table are now subtracted from the row count displayed to users.
1 parent 02841b5 commit f686891

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

packages/dashboard-core-plugins/src/panels/IrisGridPanelTooltip.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ interface IrisGridPanelTooltipProps {
1515
function IrisGridPanelTooltip(props: IrisGridPanelTooltipProps): ReactElement {
1616
const { model, widgetName, glContainer, description } = props;
1717

18-
const rowCount = (model?.rowCount ?? 0) - (model?.pendingRowCount ?? 0);
18+
const rowCount =
19+
(model?.rowCount ?? 0) -
20+
(model?.pendingRowCount ?? 0) -
21+
(model?.floatingBottomRowCount ?? 0) -
22+
(model?.floatingTopRowCount ?? 0);
1923
const formattedRowCount = model?.displayString(rowCount, 'long');
2024

2125
const columnCount = model?.columnCount ?? 0;

packages/iris-grid/src/ColumnStatistics.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ class ColumnStatistics extends Component<
8686
maybeGenerateStatistics(): void {
8787
const { model } = this.props;
8888

89-
const numRows = model.rowCount - model.pendingRowCount;
89+
const numRows =
90+
model.rowCount -
91+
model.pendingRowCount -
92+
model.floatingBottomRowCount -
93+
model.floatingTopRowCount;
9094
this.setState({ numRows });
9195
if (!model.isColumnStatisticsAvailable) {
9296
this.setState({ loading: false });
@@ -133,7 +137,11 @@ class ColumnStatistics extends Component<
133137
this.setState({
134138
loading: false,
135139
statistics,
136-
numRows: model.rowCount - model.pendingRowCount,
140+
numRows:
141+
model.rowCount -
142+
model.pendingRowCount -
143+
model.floatingBottomRowCount -
144+
model.floatingTopRowCount,
137145
});
138146

139147
onStatistics();

0 commit comments

Comments
 (0)