Commit Graph

4373 Commits

Author SHA1 Message Date
Evan Rusackas
db03fb10e6 test(DatasourceControl): mock DatasourceEditor to fix CI OOM crashes
DatasourceControl.test.tsx consistently OOM-crashes Jest workers in CI
(shard 7) because the last 4 tests render the full DatasourceEditor
(2,500+ lines, 150+ imports) without mocking. Each test mounts this
massive tree, compounding memory until crash.

Mock DatasourceEditor with a lightweight stub since these tests only
verify DatasourceControl's callback wiring through the modal save flow,
not editor internals. Also remove stale SupersetClientGet.mockImplementationOnce
calls from 2 earlier tests that leaked unconsumed mocks into subsequent
tests (jest.clearAllMocks doesn't clear mock implementations).

Results: heap 615MB→501MB, test time 33s→20s, heavy tests 5500ms→118ms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 12:08:36 -08:00
Evan Rusackas
52758b36ff style: fix prettier formatting in FilterScopeSelector test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 08:18:33 -08:00
Evan Rusackas
8d4e5a91f1 style: fix prettier formatting in SpatialControl test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 21:45:45 -08:00
Evan Rusackas
2a7af9a237 test: add tests for high-risk class-to-function component conversions
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>
2026-03-01 19:04:38 -08:00
Evan Rusackas
354004ec10 fix(SaveModal): guard against empty tab_tree in loadTabs
Prevent runtime error when the API returns an empty tab_tree array
by checking treeData.length before accessing treeData[0].

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 15:19:23 -08:00
Evan Rusackas
d36248460e style: fix prettier formatting in DatasourceEditor and SaveModal
Fix indentation and line-wrapping issues from conflict resolution
during rebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 20:04:12 -08:00
Evan Rusackas
bedf0a47a6 fix(types): add ChartRendererProps type assertion to test props
The test props objects spread from `requiredProps` (typed as
`Partial<ChartRendererProps>`), making `actions` optional. Add type
assertions to match the pattern used by other tests in the same file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 15:39:59 -08:00
Evan Rusackas
ae13b10ce3 fix(DatasourceEditor): break infinite re-render loop in function component conversion
The class-to-function conversion of DatasourceEditor introduced an infinite
re-render loop that prevented the edit dataset modal from becoming interactive,
causing 30s timeouts in Playwright tests.

Root cause: Multiple useEffect hooks fired on mount and triggered
validateAndChange() -> parent onChange() -> parent re-renders with new
propsDatasource reference -> useEffect fires again -> infinite loop.

Fixes:
- Add isInitialMount ref to skip validation effects on first render
  (matching original componentDidMount which never called validateAndChange)
- Remove setTimeout(callback, 0) from onDatasourceChange (redundant with
  the useEffect that already watches datasource changes)
- Add prevPropsDatasourceRef to prevent useEffect([propsDatasource]) from
  re-processing unchanged prop references
- Add isSyncingColumnsFromProps ref to distinguish prop-sync column updates
  (which should NOT trigger validation) from user-initiated column changes
  (matching original class behavior where componentDidUpdate called setState
  without a validation callback)

Also restores missing props in CollectionTable function component:
- filterTerm/filterFields: Client-side collection filtering
- pagination: Controlled pagination config passthrough

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 15:39:59 -08:00
Evan Rusackas
f37fab8a2d fix: apply linter auto-fixes and add missing closing div
- Fix missing </div> in renderMetricCollection
- Apply linter indentation fixes in DatasourceEditor
- Convert .find() to .some() for boolean checks (linter preference)
- Add missing `new` keyword in Error() call

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 15:39:59 -08:00
Evan Rusackas
bf97203bc9 fix: resolve rebase conflict residue in DatasourceEditor
- Remove duplicate CollectionTable block from auto-merge
- Fix this.onDatasourcePropChange reference to function component style
- Add metricSearchTerm to renderMetricCollection dependency array

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 15:39:50 -08:00
Evan Rusackas
f29094d6a7 fix(lint): resolve no-use-before-define errors and restore Chart test behavior
- Move unload function before onBeforeUnload in Dashboard.tsx
- Move FormContainer function before ColumnCollectionTable in DatasourceEditor.tsx
- Add backend error check to prevent loading spinner from hiding actual errors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-27 15:39:10 -08:00
Evan Rusackas
4d8c3efd50 fix: address bot review comments for function component conversion
- 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>
2026-02-27 15:39:10 -08:00
Evan Rusackas
07a063df50 style: apply prettier formatting fixes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-27 15:39:10 -08:00
Evan Rusackas
7de8453dec fix(tests): remove unused dashboardStateActions import
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-27 15:39:10 -08:00
Evan Rusackas
d783b7e68b fix(tests): update SaveModal tests for function component conversion
SaveModal was converted from a class component to a function component,
which broke tests that were instantiating it with `new TestSaveModal()`.

Changes:
- Extract `createRedirectParams` and `addChartToDashboard` as exported
  utility functions that can be tested directly
- Update tests to use the exported functions instead of trying to
  instantiate the component as a class
- Add placeholder tests with TODO comments for tests that require
  component rendering (onDashboardChange, onTabChange, saveOrOverwrite)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-27 15:39:10 -08:00
Evan Rusackas
1e5493bb49 fix: add theme prop to SuperChart instances in src/ files
Add theme prop to SuperChart components in:
- ChartRenderer.tsx
- DrillByChart.tsx
- FilterValue.tsx
- DefaultValue.tsx
- RangeFilterPlugin.stories.tsx
- SelectFilterPlugin.stories.tsx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-27 15:38:44 -08:00
Evan Rusackas
0879c8cddc fix: address code review comments from bot
- 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>
2026-02-27 15:38:44 -08:00
Evan Rusackas
5dffbc26ed chore(lint): convert class components to function components
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>
2026-02-27 15:38:10 -08:00
Kamil Gabryjelski
63f1d9eb98 feat(folders-editor): drag entire folder block as single unit (#38122)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 20:02:21 +01:00
Kamil Gabryjelski
5e890a8cf7 fix(folders): remove stale column/metric refs from folders on delete (#38302)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:25:06 +01:00
Alexandru Soare
761cee2d85 fix(componentParent): Newly created tabs don't show up in Scoping tab (#37807) 2026-02-27 11:34:32 +02:00
Alexandru Soare
7743183401 fix(bugs): fixing bugs for world map chart (#38030) 2026-02-27 11:33:35 +02:00
Kamil Gabryjelski
11dfda11d3 fix(folders): expand collapsed folders on Select All and add selection counter (#38270)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 07:28:07 +01:00
Kamil Gabryjelski
0827ec3811 fix(dataset-modal): include nested folders when dragging all their children (#38275)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 07:27:37 +01:00
Kamil Gabryjelski
8a053bbe07 fix(dataset-modal): fix drag overlay shift caused by modal transform containing block (#38274)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 20:48:48 +01:00
Enzo Martellucci
bbafae5f62 fix(save-chart): fix info icon alignment in save chart modal (#37708)
Co-authored-by: Diego Pucci <diegopucci.me@gmail.com>
2026-02-26 18:11:07 +01:00
Enzo Martellucci
c1c012fb52 fix(chart): make chart error banners non-dismissible (#38014) 2026-02-26 17:01:02 +01:00
jaymasiwal
f5d489da29 fix(actionlog): restore full name display in Action Logs user column (#37985) 2026-02-26 16:36:24 +01:00
Kamil Gabryjelski
660357c76b feat: Persist default folders location when repositioned in folders editor (#38105)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:58:25 +01:00
Kamil Gabryjelski
7f72c747f5 fix(dataset-modal): prevent shift-select from selecting search-hidden items (#38255)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:07:02 +01:00
Kamil Gabryjelski
2ecfb3406c fix(dataset-modal): show warning toast when dropping items outside folders (#38257)
Co-authored-by: Claude Opus 4 <noreply@anthropic.com>
2026-02-26 15:06:41 +01:00
Enzo Martellucci
26053a8b5d fix(alert-modal): show the add filter button on firefox (#38093) 2026-02-25 23:42:05 +01:00
Richard Fogaca Nienkotter
fca8a49561 feat: auto refresh dashboard (#37459)
Co-authored-by: Richard <richard@ip-192-168-1-32.sa-east-1.compute.internal>
Co-authored-by: richard <richard@richards-MacBook-Pro-2.local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Evan Rusackas <evan@preset.io>
2026-02-24 11:37:28 -03:00
madhushreeag
8f070169a5 perf(datasource): add pagination to datasource editor tables to prevent browser freeze (#37555)
Co-authored-by: madhushree agarwal <madhushree_agarwal@apple.com>
2026-02-23 15:19:33 -08:00
Richard Fogaca Nienkotter
e06427d1ef feat(embedded): add feature flag to disable logout button in embedded contexts (#37537)
Co-authored-by: richard <richard@richards-MacBook-Pro-2.local>
2026-02-23 17:56:02 -03:00
Ville Brofeldt
40f609fdce fix(extensions): enforce correct naming conventions (#38167) 2026-02-23 08:21:35 -08:00
Michael S. Molina
cbb80f0462 refactor(extensions): simplify registerEditorProvider API (#38127) 2026-02-23 09:04:31 -03:00
Evan Rusackas
3f64ad3da5 fix(i18n): wrap untranslated frontend strings and add i18n lint rule (#37776)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-22 21:27:37 -08:00
Evan Rusackas
672a380587 chore(frontend): enable additional oxlint rules for better code hygiene (#38145) 2026-02-23 10:36:24 +07:00
Enzo Martellucci
b565128fe7 fix(charts): improve error display for failed charts in dashboards (#37939) 2026-02-20 15:14:48 -08:00
madhushreeag
b290f71245 fix(explore): prevent theme object from being passed to ReactAce in TextAreaControl (#38117)
Co-authored-by: madhushree agarwal <madhushree_agarwal@apple.com>
2026-02-20 14:16:07 -08:00
dependabot[bot]
cff854b06e chore(deps-dev): bump oxlint from 1.48.0 to 1.49.0 in /superset-frontend (#38115)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hainenber <dotronghai96@gmail.com>
2026-02-20 14:13:37 -08:00
Manoj S
44d6b6a513 fix(table): preserve line breaks in cell content modal (#37036) 2026-02-20 14:12:14 -08:00
Damian Pendrak
1a77e17179 fix(chart-customizations): support migration of dynamic group by (#37176) 2026-02-20 13:11:07 -08:00
Gabriel Torres Ruiz
6fdaa8e9b3 fix(crud): reorder table actions + improve react memoization + improve hooks (#37897) 2026-02-20 08:58:28 -08:00
Kamil Gabryjelski
e30a9caba5 fix(dataset-modal): fix folders tab scrollbar by establishing proper flex chain (#38123)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:54:23 +01:00
Richard Fogaca Nienkotter
5278deaf63 fix(metrics): normalize legacy currency strings (#37455) 2026-02-19 21:25:44 -03:00
Joe Li
6a61baf5be fix(alerts): show friendly filter names in report edit modal (#38054)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 10:33:33 -08:00
Michael S. Molina
1f76944c2b fix: Add editors to ContributionConfig and additional properties to EditorKeyword (#38098) 2026-02-19 15:00:21 -03:00
Kamil Gabryjelski
f049d3e34a fix: Search in folders editor with verbose names (#38101) 2026-02-19 18:45:22 +01:00