rusackas commented on code in PR #37625:
URL: https://github.com/apache/superset/pull/37625#discussion_r2770108058
##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx:
##########
@@ -936,13 +1085,13 @@ export class TableRenderer extends Component {
) : null;
const rowClickHandlers = cellCallbacks[flatRowKey] || {};
- const valueCells = visibleColKeys.map(colKey => {
+ const valueCells = visibleColKeys!.map((colKey: string[]) => {
const flatColKey = flatKey(colKey);
const agg = pivotData.getAggregator(rowKey, colKey);
const aggValue = agg.value();
const keys = [...rowKey, ...colKey];
- let backgroundColor;
+ let backgroundColor: string | undefined;
Review Comment:
The `backgroundColor` variable is initialized as `let backgroundColor:
string | undefined` and is only set when a formatter returns a truthy result.
If no formatter matches, it stays `undefined`, which is handled at the usage
site (the `style` prop accepts `undefined`). A fallback isn't needed here —
`undefined` is the correct default.
##########
superset-frontend/spec/fixtures/mockNativeFilters.ts:
##########
@@ -132,7 +132,7 @@ export const NATIVE_FILTER_ID = 'NATIVE_FILTER-p4LImrSgA';
export const singleNativeFiltersState = {
filters: {
[NATIVE_FILTER_ID]: {
- id: [NATIVE_FILTER_ID],
+ id: NATIVE_FILTER_ID,
Review Comment:
Yes, intentional. The original JS file didn't have an `id` property in the
filter object. During migration, I added `id: NATIVE_FILTER_ID` to match the
`NativeFiltersState` interface which requires the `id` field. The value is the
same constant already used as the key, so the mock data is now self-consistent.
--
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]