RaghunandanKumar commented on code in PR #40386:
URL: https://github.com/apache/superset/pull/40386#discussion_r3307493215
##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx:
##########
@@ -1073,7 +1073,7 @@ export function TableRenderer(props: TableRendererProps) {
true,
)}
>
- {t('Subtotal')}
+ {t('Subvalue')}
Review Comment:
Thanks. This is already covered in the current renderer: both subtotal label
paths now render `Subvalue` in `TableRenderers.tsx` (column subtotal header and
row subtotal padding label). I also pushed an updated regression test that
exercises real subtotal rendering with multi-level row/column dimensions so the
terminology stays covered.
##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx:
##########
@@ -1073,7 +1073,7 @@ export function TableRenderer(props: TableRendererProps) {
true,
)}
>
- {t('Subtotal')}
+ {t('Subvalue')}
Review Comment:
Thanks. This thread is stale against current branch state: the renderer
already uses `Subvalue` for both subtotal label paths. I pushed a follow-up
test update as well so the check covers an actual subtotal-rendering case
instead of only the renamed string.
##########
superset-frontend/plugins/plugin-chart-pivot-table/test/react-pivottable/tableRenders.test.tsx:
##########
@@ -159,6 +159,26 @@ test('TableRenderer renders grand total when both totals
are enabled', () => {
expect(grandTotalCells[0]).toHaveTextContent('4');
});
+test('TableRenderer renders subvalue labels for row and column subtotals', ()
=> {
+ const props = buildDefaultProps({
+ tableRenderer: 'Table With Subtotal',
+ tableOptions: {
+ rowSubtotalPosition: true,
+ colSubtotalPosition: true,
+ },
+ });
+ renderWithTheme(<TableRenderer {...props} />);
+
+ const subtotalLabels = Array.from(
+ document.querySelectorAll('.pvtSubtotalLabel'),
+ )
+ .map(cell => cell.textContent?.trim())
+ .filter(Boolean);
+
+ expect(subtotalLabels).toContain('Subvalue');
+ expect(subtotalLabels).not.toContain('Subtotal');
Review Comment:
Fixed. The test now uses the actual subtotal flags (`rowSubTotals` /
`colSubTotals`) and multi-level dimensions so subtotal labels are rendered in
the test case. Change is in commit `88b8168a80`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]