rusackas commented on code in PR #37625:
URL: https://github.com/apache/superset/pull/37625#discussion_r2770111621


##########
superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx:
##########
@@ -390,25 +440,29 @@ const Chart = props => {
   const formData = useMemo(
     () =>
       getFormDataWithExtraFilters({
-        chart: { id: chart.id, form_data: chart.form_data }, // avoid passing 
the whole chart object
+        chart: { id: chart?.id ?? props.id, form_data: chart?.form_data }, // 
avoid passing the whole chart object
         chartConfiguration,
-        chartCustomizationItems,
+        chartCustomizationItems:
+          chartCustomizationItems as 
import('@superset-ui/core').ChartCustomization[],

Review Comment:
   ~~The inline `import('...')` syntax is used here because the type is only 
needed in this one cast expression. Moving it to a top-level import would work 
too but is a stylistic preference — both are valid TypeScript. The cast itself 
is needed because `chartCustomizationItems` comes from a selector that returns 
a loosely typed array. Aligning the selector's return type would be part of the 
broader RootState typing effort.~~
   
   Addressed in 7156274517 — moved `ChartCustomization` to a top-level type 
import. The cast itself remains because `useChartCustomizationFromRedux()` 
returns a loosely typed array; properly typing that hook would require changes 
to the native filters state selectors.



-- 
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]

Reply via email to