bito-code-review[bot] commented on PR #43139:
URL: https://github.com/apache/superset/pull/43139#issuecomment-5332583993
<!-- Bito Reply -->
The flagged issue is correct. The current implementation uses a ternary
operator that resets `arrow` to an empty string if the column-specific
formatter entry is missing, even if a previous value was already assigned. To
resolve this, you should only update `arrow` if the formatter entry exists, or
preserve the existing value otherwise.
Here is the corrected logic for the `arrow` assignment:
```tsx
const columnFormatter = basicColorColumnFormatters[row.index]?.[column.key];
if (columnFormatter) {
backgroundColor = columnFormatter.backgroundColor || backgroundColor;
if (column.label === comparisonLabels[0]) {
arrow = columnFormatter.mainArrow || arrow;
}
}
```
This approach ensures that `arrow` is only updated when a valid formatter is
found, preventing the silent removal of existing arrows. I have not found any
other comments on this PR to address.
**superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx**
```
const columnFormatter = basicColorColumnFormatters[row.index]?.[column.key];
if (columnFormatter) {
backgroundColor = columnFormatter.backgroundColor || backgroundColor;
if (column.label === comparisonLabels[0]) {
arrow = columnFormatter.mainArrow || arrow;
}
}
```
--
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]