diff --git a/packages/iris-grid/src/sidebar/RollupRows.test.tsx b/packages/iris-grid/src/sidebar/RollupRows.test.tsx new file mode 100644 index 0000000000..296809f7b9 --- /dev/null +++ b/packages/iris-grid/src/sidebar/RollupRows.test.tsx @@ -0,0 +1,21 @@ +import { type dh as DhType } from '@deephaven/jsapi-types'; +import { TestUtils } from '@deephaven/test-utils'; +import RollupRows from './RollupRows'; + +it('should allow all column types to be groupable', () => { + function testType(type: string, expected = true) { + const column = TestUtils.createMockProxy({ type }); + expect(RollupRows.isGroupable(column)).toBe(expected); + } + + testType('string'); + testType('int'); + testType('long'); + testType('float'); + testType('double'); + testType('java.lang.String'); + testType('java.lang.Integer'); + testType('java.lang.Long'); + testType('java.math.BigDecimal', false); + testType('java.math.BigInteger', false); +}); diff --git a/packages/iris-grid/src/sidebar/RollupRows.tsx b/packages/iris-grid/src/sidebar/RollupRows.tsx index d31f5e5544..b93c8aa479 100644 --- a/packages/iris-grid/src/sidebar/RollupRows.tsx +++ b/packages/iris-grid/src/sidebar/RollupRows.tsx @@ -115,7 +115,10 @@ class RollupRows extends Component { } static isGroupable(column: dh.Column): boolean { - return !TableUtils.isDecimalType(column.type); + return ( + !TableUtils.isBigDecimalType(column.type) && + !TableUtils.isBigIntegerType(column.type) + ); } constructor(props: RollupRowsProps) { diff --git a/tests/table-operations.spec.ts b/tests/table-operations.spec.ts index 8f2f9bbfe7..566c4ad168 100644 --- a/tests/table-operations.spec.ts +++ b/tests/table-operations.spec.ts @@ -470,6 +470,18 @@ test('rollup rows and aggregrate columns', async ({ page }) => { await expect(page.locator('.iris-grid-column')).toHaveScreenshot(); }); + await test.step('Rollup a double column', async () => { + const doubleColumn = page.getByRole('button', { + name: 'Double', + exact: true, + }); + expect(doubleColumn).toBeTruthy(); + await doubleColumn.dblclick(); + + await waitForLoadingDone(page); + await expect(page.locator('.iris-grid-column')).toHaveScreenshot(); + }); + await test.step('Aggregate columns', async () => { await page.getByText('Constituents').click(); await page.getByText('Non-Aggregated Columns').click(); diff --git a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-5-chromium-linux.png b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-5-chromium-linux.png index 4aa27d04be..49a01e3536 100644 Binary files a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-5-chromium-linux.png and b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-5-chromium-linux.png differ diff --git a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-5-firefox-linux.png b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-5-firefox-linux.png index 1bd5a66d25..b2efbc893b 100644 Binary files a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-5-firefox-linux.png and b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-5-firefox-linux.png differ diff --git a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-5-webkit-linux.png b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-5-webkit-linux.png index 0447ed68c4..9ece761e62 100644 Binary files a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-5-webkit-linux.png and b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-5-webkit-linux.png differ diff --git a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-6-chromium-linux.png b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-6-chromium-linux.png index 7dfc72c5a5..39f390ab43 100644 Binary files a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-6-chromium-linux.png and b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-6-chromium-linux.png differ diff --git a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-6-firefox-linux.png b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-6-firefox-linux.png index 7f5b771b20..fa4fc20279 100644 Binary files a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-6-firefox-linux.png and b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-6-firefox-linux.png differ diff --git a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-6-webkit-linux.png b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-6-webkit-linux.png index 8881068269..bc71420263 100644 Binary files a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-6-webkit-linux.png and b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-6-webkit-linux.png differ diff --git a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-7-chromium-linux.png b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-7-chromium-linux.png index 0ef9cb72a1..2bd5575657 100644 Binary files a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-7-chromium-linux.png and b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-7-chromium-linux.png differ diff --git a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-7-firefox-linux.png b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-7-firefox-linux.png index 851328bf80..79a768aa8a 100644 Binary files a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-7-firefox-linux.png and b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-7-firefox-linux.png differ diff --git a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-7-webkit-linux.png b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-7-webkit-linux.png index 31f5c84147..c9f5831eac 100644 Binary files a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-7-webkit-linux.png and b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-7-webkit-linux.png differ diff --git a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-8-chromium-linux.png b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-8-chromium-linux.png new file mode 100644 index 0000000000..048db59aa0 Binary files /dev/null and b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-8-chromium-linux.png differ diff --git a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-8-firefox-linux.png b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-8-firefox-linux.png new file mode 100644 index 0000000000..1cc5438416 Binary files /dev/null and b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-8-firefox-linux.png differ diff --git a/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-8-webkit-linux.png b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-8-webkit-linux.png new file mode 100644 index 0000000000..ebeb9439da Binary files /dev/null and b/tests/table-operations.spec.ts-snapshots/rollup-rows-and-aggregrate-columns-8-webkit-linux.png differ