rusackas commented on code in PR #40681:
URL: https://github.com/apache/superset/pull/40681#discussion_r3605321418
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts:
##########
@@ -86,8 +86,8 @@ const processComparisonTotals = (
totals.map((totalRecord: DataRecord) =>
Object.keys(totalRecord).forEach(key => {
if (totalRecord[key] !== undefined && !key.includes(comparisonSuffix)) {
- transformedTotals[`Main ${key}`] =
- parseInt(transformedTotals[`Main ${key}`]?.toString() || '0', 10) +
+ transformedTotals[`${t('Main')} ${key}`] =
+ parseInt(transformedTotals[`${t('Main')} ${key}`]?.toString() ||
'0', 10) +
Review Comment:
Good catch, hoisted `t('Main')` into a single `mainLabel` before the loop
instead of calling it three times per key.
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts:
##########
@@ -193,7 +195,7 @@ const processComparisonDataRecords = memoizeOne(
comparisonValue as number,
);
- transformedItem[`Main ${origCol.key}`] = originalValue;
+ transformedItem[`${t('Main')} ${origCol.key}`] = originalValue;
Review Comment:
Good catch, this one could actually break the Value column after a runtime
language switch. Passed `t('Main')` into `processComparisonDataRecords` as an
arg so the memoized cache busts when locale changes.
--
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]