Skip to content

Commit 201b34d

Browse files
richardfogacaclaude
andcommitted
fix: restore DashboardInfo types and update test expectations for CI
The DashboardInfo type improvements (TagType[], Role[]) were mistakenly reverted as noise but are required by the Header's save logic. Also updates legend test expectations for the legendState ?? {} fix and applies prettier formatting to FiltersBadge.test.tsx. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0b03ec4 commit 201b34d

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import { NULL_STRING } from '../../src/constants';
5353

5454
const expectedThemeProps = {
5555
selector: ['all', 'inverse'],
56-
selected: undefined,
56+
selected: {},
5757
selectorLabel: {
5858
fontFamily: theme.fontFamily,
5959
fontSize: theme.fontSizeSM,

superset-frontend/src/dashboard/actions/dashboardState.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ interface DashboardSaveData extends JsonObject {
412412
css?: string;
413413
dashboard_title?: string;
414414
owners?: { id: number }[] | number[];
415-
roles?: { id: number }[] | number[];
415+
roles?: JsonObject[];
416416
slug?: string | null;
417-
tags?: { id: number }[] | number[];
417+
tags?: JsonObject[];
418418
metadata?: JsonObject;
419419
positions?: JsonObject;
420420
duplicate_slices?: boolean;

superset-frontend/src/dashboard/components/FiltersBadge/FiltersBadge.test.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,9 @@ test('auto-refresh: preserves indicator count during loading state', () => {
163163
store.dispatch({ type: CHART_RENDERING_SUCCEEDED, key: sliceId });
164164

165165
// Render with filters applied
166-
const { getByTestId, rerender } = render(
167-
<FiltersBadge chartId={sliceId} />,
168-
{ store },
169-
);
166+
const { getByTestId, rerender } = render(<FiltersBadge chartId={sliceId} />, {
167+
store,
168+
});
170169

171170
// Verify badge is visible with count 1
172171
expect(getByTestId('applied-filter-count')).toHaveTextContent('1');

superset-frontend/src/dashboard/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ import { UrlParamEntries } from 'src/utils/urlUtils';
3838
import { ResourceStatus } from 'src/hooks/apiResources/apiResources';
3939
import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes';
4040
import Owner from 'src/types/Owner';
41+
import Role from 'src/types/Role';
42+
import { TagType } from 'src/components/Tag/TagType';
4143
import { ChartState } from '../explore/types';
4244
import { AutoRefreshStatus } from './types/autoRefresh';
4345

@@ -213,8 +215,8 @@ export type DashboardInfo = {
213215
last_modified_time: number;
214216
certified_by?: string;
215217
certification_details?: string;
216-
roles?: { id: number }[] | number[];
217-
tags?: { type?: string | number }[];
218+
roles?: Role[];
219+
tags?: TagType[];
218220
is_managed_externally?: boolean;
219221
dash_share_perm?: boolean;
220222
dash_save_perm?: boolean;

0 commit comments

Comments
 (0)