From 5ec3093deb0d7c7a0b99fa753789ae50d90b0b8b Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Mon, 19 Aug 2024 20:15:34 -0600 Subject: [PATCH] chore(antd): straightening out button import paths (#29969) --- superset-frontend/src/components/Button/index.tsx | 2 +- superset-frontend/src/components/index.ts | 2 +- superset-frontend/src/dashboard/components/Header/index.jsx | 6 +++--- .../DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/superset-frontend/src/components/Button/index.tsx b/superset-frontend/src/components/Button/index.tsx index 69c566663..d8e24420f 100644 --- a/superset-frontend/src/components/Button/index.tsx +++ b/superset-frontend/src/components/Button/index.tsx @@ -26,7 +26,7 @@ import { import { mix } from 'polished'; import cx from 'classnames'; -import { AntdButton } from 'src/components'; +import { Button as AntdButton } from 'antd'; import { useTheme } from '@superset-ui/core'; import { Tooltip } from 'src/components/Tooltip'; import { ButtonProps as AntdButtonProps } from 'antd/lib/button'; diff --git a/superset-frontend/src/components/index.ts b/superset-frontend/src/components/index.ts index 9e50f5e71..f59a8c2f4 100644 --- a/superset-frontend/src/components/index.ts +++ b/superset-frontend/src/components/index.ts @@ -24,6 +24,7 @@ */ export { default as Select } from './Select/Select'; export { default as AsyncSelect } from './Select/AsyncSelect'; +export { default as Button } from './Button'; /* * Components that don't conflict with the ones in src/components. @@ -57,7 +58,6 @@ export { */ export { Breadcrumb as AntdBreadcrumb, - Button as AntdButton, Card as AntdCard, Checkbox as AntdCheckbox, Collapse as AntdCollapse, diff --git a/superset-frontend/src/dashboard/components/Header/index.jsx b/superset-frontend/src/dashboard/components/Header/index.jsx index d9f5dbd6d..0c5b7a3dc 100644 --- a/superset-frontend/src/dashboard/components/Header/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/index.jsx @@ -35,8 +35,7 @@ import { LOG_ACTIONS_TOGGLE_EDIT_DASHBOARD, } from 'src/logger/LogUtils'; import Icons from 'src/components/Icons'; -import Button from 'src/components/Button'; -import { AntdButton } from 'src/components/'; +import { Button } from 'src/components/'; import { findPermission } from 'src/utils/findPermission'; import { Tooltip } from 'src/components/Tooltip'; import { safeStringify } from 'src/utils/safeStringify'; @@ -138,7 +137,8 @@ const actionButtonsStyle = theme => css` } `; -const StyledUndoRedoButton = styled(AntdButton)` +const StyledUndoRedoButton = styled(Button)` + // TODO: check if we need this. padding: 0; &:hover { background: transparent; diff --git a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx index 9601ff64d..2b9223141 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx @@ -18,7 +18,7 @@ */ import { useState } from 'react'; import { SupersetTheme, t } from '@superset-ui/core'; -import { AntdButton, AntdSelect } from 'src/components'; +import { Button, AntdSelect } from 'src/components'; import InfoTooltip from 'src/components/InfoTooltip'; import FormLabel from 'src/components/Form/FormLabel'; import Icons from 'src/components/Icons'; @@ -142,14 +142,14 @@ export const EncryptedField = ({ {!fileToUpload && ( - document?.getElementById('selectedFile')?.click() } > {t('Choose File')} - + )} {fileToUpload && (