Add test coverage for 5 components that were converted from class to
function components but lacked tests: TTestTable, SpatialControl,
FilterValue, TableRenderers, and FilterScopeSelector (56 new tests).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Return 'NaN' when the control sum is 0 instead of producing Infinity.
The downstream getLiftStatus already handles NaN/Infinity values, but
guarding at the source is safer.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Changed from @react-icons/all-files to react-icons/fa to match the
installed package and other usages in the codebase.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add `theme={supersetTheme}` prop to all SuperChart components in story
files to fix TypeScript errors about missing required `theme` property.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- TTestTable: convert string values to numbers before Number.isFinite checks
- Chart: update renderStartTimeRef on each render for accurate timing
- Dashboard: add beforeunload listener cleanup on unmount
- Markdown: add key to ErrorBoundary to reset error state
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The tableRenders.test.tsx tests were testing class instance methods
(sortData, sortAndCacheData, getAggregatedData, setState, state)
which no longer exist on the function component version of TableRenderer.
Added a placeholder test with a TODO comment explaining that these tests
need to be rewritten to either export helper functions or test through
component rendering.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add supersetTheme import and theme prop to all 44 storybook story files
that use SuperChart to satisfy the required ChartPropsConfig.theme property.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- ChartDataProvider: fix useEffect to only refetch on formData/sliceId changes
- reactify: preserve legacy `this` context for componentWillUnmount callbacks
- HorizonRow: add empty array guard for colorScale="change"
- TTestTable: clamp control index when data shrinks
- TableRenderers: fix sorting state reset to only trigger on structural props
- Chart: initialize renderStartTimeRef with Logger.getTimestamp()
- DatasourceEditor: pass fresh validation errors to onChange callback
- Dashboard: use event parameter instead of window.event in beforeunload
- SliceAdder: use refs to track latest values in cleanup effect
- Markdown: add ErrorBoundary and error handler to enable error message
- SaveModal: add isLoading check to "Save & go to dashboard" button
- CollectionControl: forward header props to ControlHeader
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Convert all remaining React class components to function components
using hooks (useState, useCallback, useEffect, useRef, useMemo) to
satisfy the react-prefer-function-component ESLint rule.
Key changes:
- Converted components in dashboard, explore, SqlLab, and Chart areas
- Updated associated test files with proper typing
- Fixed JSX.Element return types for components used as JSX
- Added explicit ControlHeader props where needed
- Fixed shouldFocus callback signature in WithPopoverMenu usage
Notable exceptions (not converted):
- ErrorBoundary (uses componentDidCatch)
- DragDroppable (react-dnd requires class instances)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>