Skip to content

Commit a339bd9

Browse files
committed
fix: any changed to type
1 parent 3a82246 commit a339bd9

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

superset-frontend/src/explore/components/SaveModal.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ import {
4343
} from '@superset-ui/core';
4444
import { css, styled, Alert } from '@apache-superset/core/ui';
4545
import { Radio } from '@superset-ui/core/components/Radio';
46+
import { Layout } from 'src/dashboard/types';
4647
import { canUserEditDashboard } from 'src/dashboard/util/permissionUtils';
4748
import { setSaveChartModalVisibility } from 'src/explore/actions/saveModalActions';
4849
import { SaveActionType } from 'src/explore/types';
4950
import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes';
5051
import { Dashboard } from 'src/types/Dashboard';
52+
import { TabNode, TreeDataNode } from '../types';
5153

5254
// Session storage key for recent dashboard
5355
const SK_DASHBOARD_ID = 'save_chart_recent_dashboard';
@@ -395,7 +397,7 @@ class SaveModal extends Component<SaveModalProps, SaveModalState> {
395397
}
396398
};
397399

398-
findNextRowPosition = (layout: any): number => {
400+
findNextRowPosition = (layout: Layout): number => {
399401
const rowIndices: number[] = [];
400402

401403
Object.keys(layout).forEach(key => {
@@ -460,7 +462,7 @@ class SaveModal extends Component<SaveModalProps, SaveModalState> {
460462
const { result } = response.json;
461463
const tabTree = result.tab_tree || [];
462464

463-
const convertToTreeData = (nodes: any[]): any[] =>
465+
const convertToTreeData = (nodes: TabNode[]): TreeDataNode[] =>
464466
nodes.map(node => ({
465467
value: node.value,
466468
title: node.title,
@@ -483,7 +485,7 @@ class SaveModal extends Component<SaveModalProps, SaveModalState> {
483485

484486
onTabChange = (value: string) => {
485487
if (value) {
486-
const findTabInTree = (data: any[]): any => {
488+
const findTabInTree = (data: TabNode[]): TabNode | null => {
487489
for (const item of data) {
488490
if (item.value === value) {
489491
return item;

superset-frontend/src/explore/types.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,16 @@ export interface ExplorePageState {
123123
};
124124
sliceEntities?: JsonObject; // propagated from Dashboard view
125125
}
126+
127+
export interface TabNode {
128+
value: string;
129+
title: string;
130+
children?: TabNode[];
131+
}
132+
133+
export interface TreeDataNode {
134+
value: string;
135+
title: string;
136+
key: string;
137+
children?: TreeDataNode[];
138+
}

0 commit comments

Comments
 (0)