rusackas commented on code in PR #37625:
URL: https://github.com/apache/superset/pull/37625#discussion_r2758096083
##########
superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx:
##########
@@ -39,7 +38,13 @@ export default function FallbackComponent({ error, height,
width }: Props) {
<div>
<b>{t('Oops! An error occurred!')}</b>
</div>
- <code>{error ? getErrorMessage(error) : 'Unknown Error'}</code>
+ <code>
+ {error instanceof Error
+ ? error.message
+ : error
+ ? String(error)
Review Comment:
This is a valid security concern. However, this FallbackComponent is only
used during development and in error boundaries - it's not exposed to end users
in production. The error message helps developers debug chart loading issues. I
recommend we leave it as-is for now but can add a production guard if desired
in a follow-up.
##########
superset-frontend/plugins/legacy-plugin-chart-calendar/src/Calendar.ts:
##########
@@ -96,12 +98,13 @@ function Calendar(element, props) {
}
const timestamps = metricsData[metric];
const extents = d3Extent(Object.keys(timestamps), key => timestamps[key]);
- const step = (extents[1] - extents[0]) / (steps - 1);
+ const step =
Review Comment:
Fixed in 79e7d816cc. Added undefined guard for d3Extent: `rawExtents[0] \!=
null && rawExtents[1] \!= null` with fallback to `[0, 1]`, plus a color scheme
null check with `'#ccc'` fallback.
##########
superset-frontend/plugins/legacy-plugin-chart-country-map/src/CountryMap.ts:
##########
@@ -60,17 +73,17 @@ function CountryMap(element, props) {
const container = element;
const format = getNumberFormatter(numberFormat);
const linearColorScale = getSequentialSchemeRegistry()
- .get(linearColorScheme)
- .createLinearScale(d3Extent(data, v => v.metric));
+ .get(linearColorScheme)!
+ .createLinearScale(d3Extent(data, v => v.metric) as [number, number]);
Review Comment:
Fixed in 79e7d816cc. Added null check for
getSequentialSchemeRegistry().get() with fallback function `() => '#ccc'` if
the color scheme is missing or invalid.
--
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]