Commit Graph

18761 Commits

Author SHA1 Message Date
Evan Rusackas
e2a566d72f fix(types): remove invalid sqlLabMode prop from TableSelector
TableSelector doesn't accept sqlLabMode - this prop belongs to
DatabaseSelector. The prop was silently ignored in the original JS
code and correctly flagged as a type error after TypeScript migration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 14:21:44 +01:00
Evan Rusackas
7deff1c791 fix(types): remove unnecessary as any cast on server_pagination
The `LatestQueryFormData` type inherits `[key: string]: any` from
`FormDataResidual`, so `server_pagination: false` type-checks without
a cast.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:41 +01:00
Evan Rusackas
a387df5651 fix(types): add explanatory comment for type cast in AnnotationLayerControl
The cast from Annotation to RunAnnotationQueryParams is necessary because
of a pre-existing type mismatch between the local Annotation interface
(which has annotation: string) and what runAnnotationQuery expects
(annotation: AnnotationLayerWithOverrides). This preserves the existing
runtime behavior while documenting the technical debt.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:41 +01:00
Evan Rusackas
d494f44720 fix(types): fix column type mismatch in ResultSet prepareCopyToClipboardTabularData
Map QueryColumn[] to string[] (column names) to match the function's
expected parameter type of (string | ColumnDefinition)[].

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:41 +01:00
Evan Rusackas
8c7a967857 fix(types): remove unnecessary else branch in ChartRenderer setDataMask
Address code review feedback - the else branch with setDataMask fallback
was new logic that didn't exist in the original JavaScript version.
Now uses double optional chaining to match the original behavior while
satisfying TypeScript.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:41 +01:00
Evan Rusackas
f34286454e fix(types): remove unsafe Response cast in chartAction catch block
Address Bito code review suggestion to remove the unnecessary type
annotation and unsafe Response cast in the annotation query catch
block. The getClientErrorObject function handles response typing
internally.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:41 +01:00
Evan Rusackas
c3c73415f8 fix(types): use TabularDataRow[] instead of Record<string, any>[]
More type-safe alternative that avoids 'any' type.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:40 +01:00
Evan Rusackas
989a4ad6a6 fix(reports): use report.id as key for alerts_reports in reducer
For alerts_reports, neither dashboard nor chart is set, so we need to
use the report's own id as the key instead of dashboard/chart id.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:40 +01:00
Evan Rusackas
b7b5739645 fix(types): remove invalid getErrorMessage import from FallbackComponent
The getErrorMessage function doesn't exist in react-error-boundary.
Use error?.message directly instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:40 +01:00
Evan Rusackas
653a635d1f style: format ExploreViewContainer with prettier
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:40 +01:00
Evan Rusackas
42d1536c80 fix(types): correct ExploreViewContainer export type and MatrixifyFormData cast
- Change ExploreViewContainer export to ComponentType<Record<string, never>>
  since withToasts provides OwnProps and connect provides StateProps/DispatchProps
- Cast formData to MatrixifyFormData when calling isMatrixifyEnabled
  to satisfy the function's type signature

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:40 +01:00
Evan Rusackas
3e4f9e7fbb fix(types): use callable type for actions to fix build
Changed from Record<string, unknown> to Record<string, (...args: any[]) => any>
so TypeScript understands the action properties are callable functions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:40 +01:00
Evan Rusackas
3fed820f3f fix(types): simplify action types to fix build errors
The previous BoundActions<CombinedExploreActions> type failed because
action modules export both action creators AND action type constants
(e.g., UPDATE_FORM_DATA_BY_DATASOURCE = 'UPDATE_FORM_DATA_BY_DATASOURCE').

Simplified to Record<string, unknown> which properly represents the
mixed nature of these exports while maintaining type safety elsewhere.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:40 +01:00
Evan Rusackas
c27bf8da53 fix(types): improve type safety in ExploreViewContainer
- Create CombinedExploreActions type for combined action creators
- Add BoundActions<T> utility type for bound action creators
- Update ControlPanelsContainer to use Pick<ExploreActions, 'setControlValue'>
- Change datasource_type from string to DatasourceType enum
- Change exploreState to use ExplorePageState['explore']
- Replace control.label() as any with as unknown as ControlPanelState
- Add eslint-disable comments for remaining necessary casts
- Remove unnecessary as any casts from connect() and SaveModal

Reduces 'as any' casts from ~12 to 5, with remaining casts
documented with eslint-disable comments explaining why they're needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:39 +01:00
Evan Rusackas
5fb917e07f style: format with prettier
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:39 +01:00
Evan Rusackas
f6cbc58407 fix(tests): resolve test failures in chartActions, EmbedCodeContent, ExploreChartHeader, and logger
- chartActions.test.ts: Add viz_type to formData for legacy API tests so
  getQuerySettings returns correct useLegacyApi value
- EmbedCodeContent.test.tsx: Add formData with datasource prop so the
  component can fetch the permalink URL
- ExploreChartHeader.test.tsx: Add await to userEvent calls and waitFor
  for modal close to fix timing issues with modal state
- logger.test.ts: Set window.location.href to include /dashboard/ so the
  middleware correctly adds dashboard context to events

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:39 +01:00
Evan Rusackas
0ec29bdd67 fix(tests): exclude compiled esm/lib directories from jest
Add modulePathIgnorePatterns to exclude compiled output directories
(esm/ and lib/) in packages and plugins from being tested by jest.
These directories contain transpiled build artifacts that have issues
with _jsx references in jest.mock() calls.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:39 +01:00
Evan Rusackas
4f1da90bc0 style: format with prettier
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:39 +01:00
Evan Rusackas
14092b5609 style: format with prettier
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:39 +01:00
Evan Rusackas
7d0d97bae7 fix(tests): fix test failures in ChartRenderer, ExploreChartHeader, and Chart
- ChartRenderer.test.tsx: Remove viz_type from formData to allow vizType
  prop to take precedence for suppressContextMenu test, use as unknown
  for test data type assertions
- ExploreChartHeader.test.tsx: Fix placeholder text assertion - use
  findByDisplayValue instead of findByText since chart has a title
- ExploreViewContainer: Pass exploreState prop to ExploreChartPanel
  to match original behavior of spread props
- ExploreChartPanel: Add exploreState to props interface

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:39 +01:00
Evan Rusackas
8ff65607e6 fix(types): add missing properties to DatasourceEditor types after rebase
- Add type_generic to Column interface for string column filtering
- Add currency_code_column to DatasourceObject interface for currency
  code column selection
- Fix theme possibly undefined errors with optional chaining and
  fallback values
- Fix SelectValue type assignments with proper type casts
- Change fontWeightMedium to fontWeightStrong (fontWeightMedium
  doesn't exist in theme)

These fixes address TypeScript errors introduced after rebasing on
master which included the Dynamic currency feature.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:38 +01:00
Evan Rusackas
121e4960a3 fix(types): resolve TypeScript errors in explore and report components
- Fix ExploreViewContainer type assertions for props passing
- Fix ExploreChartHeader.test.tsx with proper type imports
- Fix logger.test.ts with correct middleware typing
- Fix exploreReducer.ts with proper control state and function parameter types
- Fix test files (getChartDataUri, getChartKey, getExploreUrl, getSimpleSQLExpression)
- Fix HeaderReportDropdown and ReportModal type issues
- Fix useExploreAdditionalActionsMenu menu item literal types
- Update ExploreState interface to match expected types

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:38 +01:00
Evan Rusackas
1b406e2134 fix(types): address CI type errors in explore components
- Fix ExploreChartHeader.test.tsx: add missing ChartState properties to test props
- Fix ResultSet/index.tsx: use 'base' for mountExploreUrl, map columns to names
- Fix CopyToClipboardButton.test.tsx: pass data as array instead of object
- Fix ExploreChartPanel/index.tsx: use undefined instead of null, add form_data check,
  wrap setControlValue to adapt signature
- Fix ExploreViewContainer/index.tsx: remove unused KeyboardEvent import, fix history
  state types, cast form_data for isMatrixifyEnabled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:38 +01:00
Evan Rusackas
9d082798c7 fix(types): improve type safety in explore components
- Fix embedded/utils.ts: use `as unknown as QueryFormData` for proper type cast
- Fix SaveDatasetModal: use 'base' instead of null for mountExploreUrl
- Fix ExploreChartHeader: add color_namespace to metadata type, fix FaveStar props,
  cast report to ReportObject, fix AlteredSliceTag formData types
- Fix useExploreAdditionalActionsMenu: fix StreamingProgress import, add ExploreSlice
  interface, fix onClick handlers with proper React.MouseEvent types, fix getChartPermalink
  datasource checks, fix VizType casts, fix exportType cast
- Fix FilterValue.tsx and FiltersConfigForm.tsx: use correct type for waitForAsyncData
  parameter in 202 response handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:38 +01:00
Evan Rusackas
8ba307b9d0 fix(types): fix TypeScript errors across multiple files
- DrillDetailPane: Cast datasourceType to DatasourceType enum
- FilterValue: Cast result types to ChartDataResponseResult
- FiltersConfigForm: Cast result types to ChartDataResponseResult
- embedded/utils: Change null to undefined and add QueryFormData cast
- embedded/utils.test: Add any casts for mock resolved values
- saveModalActions: Change null to undefined
- DataTableControl: Fix data prop type to array
- DataTableControls: Filter undefined from formattedTimeColumns
- useResultsPane: Cast ensureIsArray result to QueryResultInterface
- EmbedCodeContent: Use LatestQueryFormData type and guard datasource
- AnnotationLayerControl: Use Payload type and cast parameters
- ViewQueryModal: Cast ensureIsArray result to Result type

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:38 +01:00
Evan Rusackas
b03b68c342 fix(types): fix hooks and queriesData type issues in ChartRenderer
- Cast hooks to any to bypass onAddFilter signature mismatch
- Convert null to undefined for queriesData

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:38 +01:00
Evan Rusackas
d705549bc4 fix(types): fix remaining type mismatches in Chart components
- Use DataRecordFilters for initialValues type
- Fix postTransformProps type to match ChartRenderer
- Fix contextMenuRef type to use RefObject<ChartContextMenuRef>
- Use 'as unknown as' pattern for AnnotationLayer casts in tests
- Fix SUPERSET_WEBSERVER_TIMEOUT cast in test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:38 +01:00
Evan Rusackas
5f023db487 fix(types): fix setControlValue type and thunk dispatch cast
- Change setControlValue type from Function to proper signature
- Use simpler 'as any' cast for thunk dispatch in mock store tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:37 +01:00
Evan Rusackas
b35866a863 fix(types): resolve remaining TypeScript errors in chartActions tests
- Use Awaited<ReturnType<...>> for async stub return type
- Fix SupersetClient.post mock implementations with proper type casting
- Use AnnotationSourceType.Native enum instead of string literal
- Add thunk action type assertion for store.dispatch calls

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:37 +01:00
Evan Rusackas
b3d99a2811 fix(types): align initialValues type and declare webpack globals
- Change initialValues type from object to Record<string, unknown>
- Add declaration for __webpack_require__ webpack global

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:37 +01:00
Evan Rusackas
dc009447de fix(types): use ContextMenuFilters from core and fix FeatureFlagMap type
- Import ContextMenuFilters from @superset-ui/core instead of local interface
- Update handleOnContextMenu to use ContextMenuFilters type
- Import and use FeatureFlagMap for window.featureFlags declaration in tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:37 +01:00
Evan Rusackas
aebca03533 fix(types): add chartRenderingSucceeded to Actions type
Add missing chartRenderingSucceeded method to Actions type in Chart.tsx
to match the ChartActions interface expected by ChartRenderer.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:37 +01:00
Evan Rusackas
c2c50a2afc fix(types): resolve TypeScript errors in Chart and chartActions tests
- Use ChartSource enum instead of string literals in Chart.tsx
- Add proper type casting for mock return types in chartActions.test.ts
- Add missing third argument (undefined) to ThunkAction calls
- Use AnnotationType/SourceType/Style enums instead of string literals
- Add `as unknown as` casting where mock types don't match actual types

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:37 +01:00
Evan Rusackas
b0b45cca04 fix(tests): add type casting for mock return types in chartActions tests
Add `as unknown as` casting to mock implementations to satisfy TypeScript's
strict type checking while preserving the original test behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:37 +01:00
Evan Rusackas
5048433eab fix(types): widen onCellChange id parameter to string | number
Collection item IDs can be either string or number.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:36 +01:00
Evan Rusackas
eca23a1277 fix: address code review feedback
- Add safety check for empty json.result array in chartAction.ts
- Fix grammar: "active" -> "activate" in ReportModal error message
- Fix error message to be generic: remove "attached to this dashboard"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:36 +01:00
Evan Rusackas
0afbc3ea3d fix(types): address code review feedback
- Add default value `inline = false` for Field component
- Fix onCellChange type from `boolean` to `unknown` in CollectionTable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:36 +01:00
Evan Rusackas
8ccf4dfb75 fix(types): add type safety to DatasourceEditor and related components
- Add proper type definitions for DatabaseState and QueryResult interfaces
- Fix SpatialControl value type to use proper SpatialType union
- Fix DatabaseSelector and TableSelector db prop types
- Add proper type casts for itemRenderers in CollectionTable
- Remove non-existent props (controlId, canEdit, dbId, inline)
- Add missing sortColumns prop to CollectionTable
- Fix ResultTable props with proper defaults
- Add setCachedChanges to exploreUtils buildV1ChartDataPayload

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:36 +01:00
Evan Rusackas
9c3759a65d fix(types): address code review feedback for TypeScript migrations
- Fix filterField type mismatch in ReportModal reducer - map 'dashboard_id'/'chart_id' to 'dashboard'/'chart' properties
- Fix chartAction.ts type errors: properly type getExploreUrl params, handle null URLs, fix waitForAsyncData types
- Fix SliceUpdatedAction owners type mismatch - handle both number[] and {value, label}[] formats

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:36 +01:00
Evan Rusackas
c6da8acbc7 fix: resolve remaining TypeScript errors and code review feedback
- actions.ts: add error handling to editReport, guard against empty charts
- chartAction.ts: fix RootState type, cast SupersetClient calls, add AnnotationLayerWithOverrides type

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:36 +01:00
Evan Rusackas
0a3babf41a fix: resolve TypeScript errors in migrated files
- common.ts: wrap return in Boolean() for proper boolean type
- logger.test.ts: add dispatch property to MockStore interface
- exploreReducer.ts: use flexible ExtendedControlState interface, fix SliceUpdatedAction owners type
- ReportModal/actions.ts: use ThunkDispatch for thunk actions, add error handling to addReport
- ReportModal/reducer.ts: cast through unknown for dynamic property access

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:36 +01:00
Evan Rusackas
ff3b98e388 fix(chart): use setDataMask prop as fallback when actions.updateDataMask is absent
Ensures custom setDataMask handlers work in non-dashboard/embedded contexts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:35 +01:00
Evan Rusackas
bef90c6283 fix(chart): remove unused POST_CHART_FORM_DATA constant
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:35 +01:00
Evan Rusackas
0da6adefa3 fix(chart): use derived vizType for drill-to-detail behavior check
Use vizType (derived from currentFormData) instead of formData.viz_type
so drill-to-detail props are correctly enabled/disabled when the user
changes visualization type without re-running the query.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:35 +01:00
Evan Rusackas
2a39dcfe16 fix(reports): only show success toast when delete succeeds
Move DELETE_REPORT dispatch and success toast from .finally() to .then()
so they only execute on successful deletion, not on failure.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:35 +01:00
Evan Rusackas
599e46ee21 fix: remove unused ChartDataResponse interface
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:35 +01:00
Evan Rusackas
574afe41c8 chore(frontend): migrate non-dashboard JS/JSX files to TypeScript
Migrates 15 core JavaScript/JSX files and 11 test files to TypeScript
as part of the ongoing frontend modernization effort.

Files migrated:
- src/utils/common.js → common.ts
- src/middleware/loggerMiddleware.js → loggerMiddleware.ts
- src/visualizations/presets/MainPreset.js → MainPreset.ts
- src/features/reports/ReportModal/actions.js → actions.ts
- src/features/reports/ReportModal/reducer.js → reducer.ts
- src/explore/exploreUtils/index.js → index.ts
- src/explore/reducers/exploreReducer.js → exploreReducer.ts
- src/explore/components/EmbedCodeContent.jsx → EmbedCodeContent.tsx
- src/explore/components/ExploreChartHeader/index.jsx → index.tsx
- src/explore/components/ExploreViewContainer/index.jsx → index.tsx
- src/explore/components/useExploreAdditionalActionsMenu/index.jsx → index.tsx
- src/components/Chart/chartAction.js → chartAction.ts
- src/components/Chart/ChartRenderer.jsx → ChartRenderer.tsx
- src/components/Datasource/components/DatasourceEditor/DatasourceEditor.jsx → DatasourceEditor.tsx
- src/components/Datasource/utils/index.js → index.ts

Key improvements:
- Added proper TypeScript interfaces for all components and functions
- Replaced PropTypes with TypeScript interfaces
- Added typed Redux actions and state interfaces
- Zero `any` types used throughout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:07:35 +01:00
Evan Rusackas
ae10e105c2 fix(chart): enable cross-filter on bar charts without dimensions (#37407)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:14:24 -08:00
dependabot[bot]
901dca58f7 chore(deps): bump JustinBeckwith/linkinator-action from 2.3 to 2.4 (#37562)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-31 03:06:30 -08:00
dependabot[bot]
d95a3d8426 chore(deps-dev): bump @applitools/eyes-storybook from 3.63.9 to 3.63.10 in /superset-frontend (#37566)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-31 03:06:09 -08:00