Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: local warning in the frontend development #17727

Merged
merged 1 commit into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
import React from 'react';
import { useTheme, css } from '@superset-ui/core';
import { Tooltip as BaseTooltip } from 'antd';
import { TooltipProps } from 'antd/lib/tooltip';
import type { TooltipProps } from 'antd/lib/tooltip';
import { Global } from '@emotion/react';

export { TooltipProps } from 'antd/lib/tooltip';
export type { TooltipProps } from 'antd/lib/tooltip';

export const Tooltip = ({ overlayStyle, color, ...props }: TooltipProps) => {
const theme = useTheme();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* under the License.
*/
import React, { ReactNode, ReactText, ReactElement } from 'react';
import {
import type {
AdhocColumn,
Column,
DatasourceType,
Expand All @@ -29,9 +29,9 @@ import {
import { sharedControls } from './shared-controls';
import sharedControlComponents from './shared-controls/components';

export { Metric } from '@superset-ui/core';
export { ControlFormItemSpec } from './components/ControlForm';
export { ControlComponentProps } from './shared-controls/components/types';
export type { Metric } from '@superset-ui/core';
export type { ControlFormItemSpec } from './components/ControlForm';
export type { ControlComponentProps } from './shared-controls/components/types';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AnyDict = Record<string, any>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export { default as getChartComponentRegistry } from './registries/ChartComponen
export { default as getChartControlPanelRegistry } from './registries/ChartControlPanelRegistrySingleton';
export { default as getChartMetadataRegistry } from './registries/ChartMetadataRegistrySingleton';
export { default as getChartTransformPropsRegistry } from './registries/ChartTransformPropsRegistrySingleton';
export { BuildQuery } from './registries/ChartBuildQueryRegistrySingleton';
export type { BuildQuery } from './registries/ChartBuildQueryRegistrySingleton';

export { default as ChartDataProvider } from './components/ChartDataProvider';

Expand Down
18 changes: 11 additions & 7 deletions superset-frontend/src/common/components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,17 @@ export {
Input as AntdInput,
} from 'antd';
export { Card as AntdCard } from 'antd';
export { default as Modal, ModalProps } from 'antd/lib/modal';
export { FormInstance } from 'antd/lib/form';
export { RadioChangeEvent } from 'antd/lib/radio';
export { TreeProps } from 'antd/lib/tree';
export { default as Alert, AlertProps } from 'antd/lib/alert';
export { default as Select, SelectProps } from 'antd/lib/select';
export { default as List, ListItemProps } from 'antd/lib/list';
export { default as Modal } from 'antd/lib/modal';
export type { ModalProps } from 'antd/lib/modal';
export type { FormInstance } from 'antd/lib/form';
export type { RadioChangeEvent } from 'antd/lib/radio';
export type { TreeProps } from 'antd/lib/tree';
export { default as Alert } from 'antd/lib/alert';
export { default as Select } from 'antd/lib/select';
export { default as List } from 'antd/lib/list';
export type { AlertProps } from 'antd/lib/alert';
export type { SelectProps } from 'antd/lib/select';
export type { ListItemProps } from 'antd/lib/list';

export { default as Collapse } from 'src/components/Collapse';
export { default as Badge } from 'src/components/Badge';
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ export default function Form(props: FormProps) {
return <StyledForm {...props} />;
}

export { FormProps };
export type { FormProps };
3 changes: 2 additions & 1 deletion superset-frontend/src/components/Form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ import FormItem from './FormItem';
import FormLabel from './FormLabel';
import LabeledErrorBoundInput from './LabeledErrorBoundInput';

export { Form, FormItem, FormLabel, LabeledErrorBoundInput, FormProps };
export { Form, FormItem, FormLabel, LabeledErrorBoundInput };
export type { FormProps };
2 changes: 1 addition & 1 deletion superset-frontend/src/components/Icons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ IconFileNames.forEach(fileName => {
);
});

export { IconType };
export type { IconType };

export default {
...AntdEnhancedIcons,
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/Select/NativeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import React from 'react';
import { styled } from '@superset-ui/core';
import Select, { SelectProps } from 'antd/lib/select';

export {
export type {
OptionType as NativeSelectOptionType,
SelectProps as NativeSelectProps,
} from 'antd/lib/select';
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/Slider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import AntDSlider, {
SliderRangeProps,
} from 'antd/lib/slider';

export { SliderSingleProps, SliderRangeProps };
export type { SliderSingleProps, SliderRangeProps };

export default function Slider(props: SliderSingleProps | SliderRangeProps) {
return <AntDSlider {...props} css={{ marginLeft: 0, marginRight: 0 }} />;
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/Switch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ const StyledSwitch = styled(BaseSwitch)`
`;

export const Switch = (props: SwitchProps) => <StyledSwitch {...props} />;
export { SwitchProps };
export type { SwitchProps };
3 changes: 2 additions & 1 deletion superset-frontend/src/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*/
import { FeatureFlagMap, FeatureFlag } from '@superset-ui/core';

export { FeatureFlagMap, FeatureFlag } from '@superset-ui/core';
export { FeatureFlag } from '@superset-ui/core';
export type { FeatureFlagMap } from '@superset-ui/core';

export function initFeatureFlags(featureFlags: FeatureFlagMap) {
if (!window.featureFlags) {
Expand Down