You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/01/15 06:01:39 UTC
(superset) branch chore/ts-migration-non-dashboard updated (cac2ae0a07 -> e2a75392a5)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a change to branch chore/ts-migration-non-dashboard
in repository https://gitbox.apache.org/repos/asf/superset.git
from cac2ae0a07 fix(types): resolve TypeScript errors in Chart and chartActions tests
new f8701f4b5d fix(types): add chartRenderingSucceeded to Actions type
new e2a75392a5 fix(types): use ContextMenuFilters from core and fix FeatureFlagMap type
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
superset-frontend/src/components/Chart/Chart.tsx | 1 +
.../src/components/Chart/ChartRenderer.test.tsx | 7 ++++---
superset-frontend/src/components/Chart/ChartRenderer.tsx | 12 +++---------
3 files changed, 8 insertions(+), 12 deletions(-)
(superset) 02/02: fix(types): use ContextMenuFilters from core and fix FeatureFlagMap type
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch chore/ts-migration-non-dashboard
in repository https://gitbox.apache.org/repos/asf/superset.git
commit e2a75392a5ddb0d5a4de98141369fdbdc304bcb9
Author: Evan Rusackas <ev...@rusackas.com>
AuthorDate: Wed Jan 14 22:01:26 2026 -0800
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 <no...@anthropic.com>
---
.../src/components/Chart/ChartRenderer.test.tsx | 7 ++++---
superset-frontend/src/components/Chart/ChartRenderer.tsx | 12 +++---------
2 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/superset-frontend/src/components/Chart/ChartRenderer.test.tsx b/superset-frontend/src/components/Chart/ChartRenderer.test.tsx
index 1d362f084a..c54b40f5f3 100644
--- a/superset-frontend/src/components/Chart/ChartRenderer.test.tsx
+++ b/superset-frontend/src/components/Chart/ChartRenderer.test.tsx
@@ -22,6 +22,7 @@ import {
getChartMetadataRegistry,
VizType,
JsonObject,
+ FeatureFlagMap,
} from '@superset-ui/core';
import ChartRenderer, {
ChartRendererProps,
@@ -93,15 +94,15 @@ const requiredProps: Partial<ChartRendererProps> = {
declare global {
interface Window {
- featureFlags: Record<string, boolean>;
+ featureFlags: FeatureFlagMap;
}
}
beforeAll(() => {
- window.featureFlags = { DRILL_TO_DETAIL: true };
+ window.featureFlags = { DRILL_TO_DETAIL: true } as FeatureFlagMap;
});
afterAll(() => {
- window.featureFlags = {};
+ window.featureFlags = {} as FeatureFlagMap;
});
test('should render SuperChart', () => {
diff --git a/superset-frontend/src/components/Chart/ChartRenderer.tsx b/superset-frontend/src/components/Chart/ChartRenderer.tsx
index a2c66662ea..4cc57617fb 100644
--- a/superset-frontend/src/components/Chart/ChartRenderer.tsx
+++ b/superset-frontend/src/components/Chart/ChartRenderer.tsx
@@ -32,6 +32,7 @@ import {
JsonObject,
LatestQueryFormData,
AgGridChartState,
+ ContextMenuFilters,
} from '@superset-ui/core';
import { logging } from '@apache-superset/core';
import { t } from '@apache-superset/core/ui';
@@ -52,13 +53,6 @@ interface LegendState {
[name: string]: boolean;
}
-// Types for context menu filters
-interface ContextMenuFilter {
- col: string;
- val: FilterValue | FilterValue[];
- op?: string;
-}
-
// Types for chart actions
interface ChartActions {
chartRenderingSucceeded: (chartId: number) => Dispatch;
@@ -153,7 +147,7 @@ interface ChartHooks {
onContextMenu?: (
offsetX: number,
offsetY: number,
- filters?: ContextMenuFilter[],
+ filters?: ContextMenuFilters,
) => void;
onError: (error: Error, info: { componentStack: string } | null) => void;
setControlValue: (name: string, value: unknown) => void;
@@ -379,7 +373,7 @@ class ChartRenderer extends Component<ChartRendererProps, ChartRendererState> {
handleOnContextMenu(
offsetX: number,
offsetY: number,
- filters?: ContextMenuFilter[],
+ filters?: ContextMenuFilters,
): void {
this.contextMenuRef.current?.open(offsetX, offsetY, filters);
this.setState({ inContextMenu: true });
(superset) 01/02: fix(types): add chartRenderingSucceeded to Actions type
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch chore/ts-migration-non-dashboard
in repository https://gitbox.apache.org/repos/asf/superset.git
commit f8701f4b5d6d901f32138abc49943cebbc5984a8
Author: Evan Rusackas <ev...@rusackas.com>
AuthorDate: Wed Jan 14 20:34:38 2026 -0800
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 <no...@anthropic.com>
---
superset-frontend/src/components/Chart/Chart.tsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/superset-frontend/src/components/Chart/Chart.tsx b/superset-frontend/src/components/Chart/Chart.tsx
index a597a8f9db..3eca196a80 100644
--- a/superset-frontend/src/components/Chart/Chart.tsx
+++ b/superset-frontend/src/components/Chart/Chart.tsx
@@ -100,6 +100,7 @@ export type Actions = {
chartId: number,
arg2: string | null,
): Dispatch;
+ chartRenderingSucceeded(chartId: number): Dispatch;
postChartFormData(
formData: SqlaFormData,
arg1: boolean,