diff --git a/superset-frontend/plugins/plugin-chart-table/src/buildQuery.ts b/superset-frontend/plugins/plugin-chart-table/src/buildQuery.ts index 7068ab11930..5b9cb684ed4 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/buildQuery.ts +++ b/superset-frontend/plugins/plugin-chart-table/src/buildQuery.ts @@ -198,11 +198,6 @@ const buildQuery: BuildQuery = ( (ownState.currentPage ?? 0) * (ownState.pageSize ?? 0); } - if (!temporalColumn) { - // This query is not using temporal column, so it doesn't need time grain - extras.time_grain_sqla = undefined; - } - let queryObject = { ...baseQueryObject, columns, diff --git a/superset-frontend/plugins/plugin-chart-table/test/buildQuery.test.ts b/superset-frontend/plugins/plugin-chart-table/test/buildQuery.test.ts index f110b424c9b..4badcc673ac 100644 --- a/superset-frontend/plugins/plugin-chart-table/test/buildQuery.test.ts +++ b/superset-frontend/plugins/plugin-chart-table/test/buildQuery.test.ts @@ -148,14 +148,5 @@ describe('plugin-chart-table', () => { expect(queries[1].extras?.time_grain_sqla).toEqual(TimeGranularity.MONTH); expect(queries[1].extras?.where).toEqual("(status IN ('In Process'))"); }); - it('should not include time_grain_sqla in extras if temporal colum is not used and keep the rest', () => { - const { queries } = buildQuery(extraQueryFormData); - // Extras in regular query - expect(queries[0].extras?.time_grain_sqla).toBeUndefined(); - expect(queries[0].extras?.where).toEqual("(status IN ('In Process'))"); - // Extras in summary query - expect(queries[1].extras?.time_grain_sqla).toBeUndefined(); - expect(queries[1].extras?.where).toEqual("(status IN ('In Process'))"); - }); }); }); diff --git a/superset-frontend/spec/helpers/shim.tsx b/superset-frontend/spec/helpers/shim.tsx index 151351c2aef..af5ea846815 100644 --- a/superset-frontend/spec/helpers/shim.tsx +++ b/superset-frontend/spec/helpers/shim.tsx @@ -92,7 +92,7 @@ jest.mock('rehype-raw', () => () => jest.fn()); // Mocks the Icon component due to its async nature // Tests should override this when needed -jest.mock('src/components/Icons/Icon', () => ({ +jest.mock('src/components/Icons/AsyncIcon', () => ({ __esModule: true, default: ({ fileName, diff --git a/superset-frontend/src/SqlLab/components/QueryLimitSelect/index.tsx b/superset-frontend/src/SqlLab/components/QueryLimitSelect/index.tsx index c7dd67910c0..6098f5f92bb 100644 --- a/superset-frontend/src/SqlLab/components/QueryLimitSelect/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryLimitSelect/index.tsx @@ -20,7 +20,7 @@ import { useDispatch } from 'react-redux'; import { t } from '@superset-ui/core'; import { Dropdown } from 'src/components/Dropdown'; import { Menu } from 'src/components/Menu'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { queryEditorSetQueryLimit } from 'src/SqlLab/actions/sqlLab'; import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor'; import Button from 'src/components/Button'; diff --git a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx index 66ccddc2ab1..f283a47df72 100644 --- a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx @@ -32,7 +32,7 @@ import { import TableView from 'src/components/TableView'; import Button from 'src/components/Button'; import { fDuration, extendedDayjs } from 'src/utils/dates'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Label from 'src/components/Label'; import { Tooltip } from 'src/components/Tooltip'; import { SqlLabRootState } from 'src/SqlLab/types'; diff --git a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx index 53df0a4ba72..3b497d37865 100644 --- a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx +++ b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx @@ -79,7 +79,7 @@ import { LOG_ACTIONS_SQLLAB_CREATE_CHART, LOG_ACTIONS_SQLLAB_DOWNLOAD_CSV, } from 'src/logger/LogUtils'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { findPermission } from 'src/utils/findPermission'; import ExploreCtasResultsButton from '../ExploreCtasResultsButton'; import ExploreResultsButton from '../ExploreResultsButton'; diff --git a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx index 9f138244322..95a4c3bea99 100644 --- a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx @@ -21,7 +21,7 @@ import { useMemo, FC, ReactElement } from 'react'; import { t, styled, useTheme, SupersetTheme } from '@superset-ui/core'; import Button from 'src/components/Button'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { DropdownButton } from 'src/components/DropdownButton'; import { detectOS } from 'src/utils/common'; import { QueryButtonProps } from 'src/SqlLab/types'; diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx index c9ebb58468f..990299ccb16 100644 --- a/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { t, useTheme } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { DropdownButton } from 'src/components/DropdownButton'; import Button from 'src/components/Button'; diff --git a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx index 7f0402868b9..a6e26bc48d9 100644 --- a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx +++ b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx @@ -23,7 +23,7 @@ import { css, } from '@superset-ui/core'; import Button from 'src/components/Button'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import withToasts from 'src/components/MessageToasts/withToasts'; import CopyToClipboard from 'src/components/CopyToClipboard'; import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor'; diff --git a/superset-frontend/src/SqlLab/components/ShowSQL/index.tsx b/superset-frontend/src/SqlLab/components/ShowSQL/index.tsx index 525baa7b0b3..409cd5af464 100644 --- a/superset-frontend/src/SqlLab/components/ShowSQL/index.tsx +++ b/superset-frontend/src/SqlLab/components/ShowSQL/index.tsx @@ -21,7 +21,7 @@ import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql'; import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github'; import { IconTooltip } from 'src/components/IconTooltip'; import ModalTrigger from 'src/components/ModalTrigger'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; SyntaxHighlighter.registerLanguage('sql', sql); diff --git a/superset-frontend/src/SqlLab/components/SouthPane/index.tsx b/superset-frontend/src/SqlLab/components/SouthPane/index.tsx index d31852a4446..ebd26b2d70c 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/index.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/index.tsx @@ -25,7 +25,7 @@ import { css, styled, t, useTheme } from '@superset-ui/core'; import { removeTables, setActiveSouthPaneTab } from 'src/SqlLab/actions/sqlLab'; import Label from 'src/components/Label'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { SqlLabRootState } from 'src/SqlLab/types'; import QueryHistory from '../QueryHistory'; import { diff --git a/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx index 6eebe5d6ce8..0d3ef505c97 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx @@ -61,7 +61,7 @@ import { Skeleton } from 'src/components'; import { Switch } from 'src/components/Switch'; import { Input } from 'src/components/Input'; import { Menu } from 'src/components/Menu'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { detectOS } from 'src/utils/common'; import { addNewQueryEditor, diff --git a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx index 100beb13594..b6d00e3a67d 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx @@ -36,7 +36,7 @@ import { import Button from 'src/components/Button'; import { t, styled, css, SupersetTheme } from '@superset-ui/core'; import Collapse from 'src/components/Collapse'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { TableSelectorMultiple } from 'src/components/TableSelector'; import { IconTooltip } from 'src/components/IconTooltip'; import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor'; diff --git a/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx index ebcd3899780..e9311e7b4a2 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx @@ -38,7 +38,7 @@ import { toggleLeftBar, } from 'src/SqlLab/actions/sqlLab'; import { QueryEditor, SqlLabRootState } from 'src/SqlLab/types'; -import Icons, { IconType } from 'src/components/Icons'; +import { Icons, IconType } from 'src/components/Icons'; const TabTitleWrapper = styled.div` display: flex; diff --git a/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx b/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx index b7dff0c1a71..5857deb42e1 100644 --- a/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx +++ b/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx @@ -36,7 +36,7 @@ import * as Actions from 'src/SqlLab/actions/sqlLab'; import { EmptyState } from 'src/components/EmptyState'; import getBootstrapData from 'src/utils/getBootstrapData'; import { locationContext } from 'src/pages/SqlLab/LocationContext'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import SqlEditor from '../SqlEditor'; import SqlEditorTabHeader from '../SqlEditorTabHeader'; diff --git a/superset-frontend/src/SqlLab/components/TableElement/index.tsx b/superset-frontend/src/SqlLab/components/TableElement/index.tsx index 162cc257dba..061d67dcc76 100644 --- a/superset-frontend/src/SqlLab/components/TableElement/index.tsx +++ b/superset-frontend/src/SqlLab/components/TableElement/index.tsx @@ -45,7 +45,7 @@ import ModalTrigger from 'src/components/ModalTrigger'; import Loading from 'src/components/Loading'; import useEffectEvent from 'src/hooks/useEffectEvent'; import { ActionType } from 'src/types/Action'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import ColumnElement, { ColumnKeyTypeType } from '../ColumnElement'; import ShowSQL from '../ShowSQL'; @@ -263,7 +263,10 @@ const TableElement = ({ table, ...props }: TableElementProps) => { className="pull-left m-l-2" tooltip={t('View keys & indexes (%s)', tableData.indexes.length)} > - + } /> diff --git a/superset-frontend/src/SqlLab/components/TablePreview/index.tsx b/superset-frontend/src/SqlLab/components/TablePreview/index.tsx index b4b5b2fee26..d367819ce2f 100644 --- a/superset-frontend/src/SqlLab/components/TablePreview/index.tsx +++ b/superset-frontend/src/SqlLab/components/TablePreview/index.tsx @@ -30,7 +30,7 @@ import { t, } from '@superset-ui/core'; import AutoSizer from 'react-virtualized-auto-sizer'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import type { SqlLabRootState } from 'src/SqlLab/types'; import { Skeleton, AntdBreadcrumb as Breadcrumb, Button } from 'src/components'; import { Dropdown } from 'src/components/Dropdown'; diff --git a/superset-frontend/src/assets/images/icons/big-number-chart-tile.svg b/superset-frontend/src/assets/images/icons/big_number_chart_tile.svg similarity index 100% rename from superset-frontend/src/assets/images/icons/big-number-chart-tile.svg rename to superset-frontend/src/assets/images/icons/big_number_chart_tile.svg diff --git a/superset-frontend/src/assets/images/icons/checkbox-half.svg b/superset-frontend/src/assets/images/icons/checkbox_half.svg similarity index 100% rename from superset-frontend/src/assets/images/icons/checkbox-half.svg rename to superset-frontend/src/assets/images/icons/checkbox_half.svg diff --git a/superset-frontend/src/assets/images/icons/checkbox-off.svg b/superset-frontend/src/assets/images/icons/checkbox_off.svg similarity index 100% rename from superset-frontend/src/assets/images/icons/checkbox-off.svg rename to superset-frontend/src/assets/images/icons/checkbox_off.svg diff --git a/superset-frontend/src/assets/images/icons/checkbox-on.svg b/superset-frontend/src/assets/images/icons/checkbox_on.svg similarity index 100% rename from superset-frontend/src/assets/images/icons/checkbox-on.svg rename to superset-frontend/src/assets/images/icons/checkbox_on.svg diff --git a/superset-frontend/src/components/AlteredSliceTag/index.tsx b/superset-frontend/src/components/AlteredSliceTag/index.tsx index a12d035e964..d433fe53267 100644 --- a/superset-frontend/src/components/AlteredSliceTag/index.tsx +++ b/superset-frontend/src/components/AlteredSliceTag/index.tsx @@ -23,7 +23,7 @@ import { QueryFormData, t } from '@superset-ui/core'; import { sanitizeFormData } from 'src/explore/exploreUtils/formData'; import getControlsForVizType from 'src/utils/getControlsForVizType'; import Label from 'src/components/Label'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { safeStringify } from 'src/utils/safeStringify'; import { Tooltip } from 'src/components/Tooltip'; import ModalTrigger from '../ModalTrigger'; diff --git a/superset-frontend/src/components/CertifiedBadge/index.tsx b/superset-frontend/src/components/CertifiedBadge/index.tsx index 5dc5ded10f3..8eb14f26469 100644 --- a/superset-frontend/src/components/CertifiedBadge/index.tsx +++ b/superset-frontend/src/components/CertifiedBadge/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { t, useTheme } from '@superset-ui/core'; -import Icons, { IconType } from 'src/components/Icons'; +import { Icons, IconType } from 'src/components/Icons'; import { Tooltip } from 'src/components/Tooltip'; export interface CertifiedBadgeProps { diff --git a/superset-frontend/src/components/Chart/DisabledMenuItemTooltip.tsx b/superset-frontend/src/components/Chart/DisabledMenuItemTooltip.tsx index f66580d7429..93fac5cb6f0 100644 --- a/superset-frontend/src/components/Chart/DisabledMenuItemTooltip.tsx +++ b/superset-frontend/src/components/Chart/DisabledMenuItemTooltip.tsx @@ -19,7 +19,7 @@ import { ReactNode } from 'react'; import { css, SupersetTheme } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Tooltip } from 'src/components/Tooltip'; export const MenuItemTooltip = ({ diff --git a/superset-frontend/src/components/Chart/DrillBy/DrillByMenuItems.tsx b/superset-frontend/src/components/Chart/DrillBy/DrillByMenuItems.tsx index 6cc2c1ada0e..4a65f7f281c 100644 --- a/superset-frontend/src/components/Chart/DrillBy/DrillByMenuItems.tsx +++ b/superset-frontend/src/components/Chart/DrillBy/DrillByMenuItems.tsx @@ -45,7 +45,7 @@ import { import rison from 'rison'; import { debounce } from 'lodash'; import { FixedSizeList as List } from 'react-window'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Input } from 'src/components/Input'; import { useToasts } from 'src/components/MessageToasts/withToasts'; import Loading from 'src/components/Loading'; diff --git a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx index a56cafd9213..b79f187864b 100644 --- a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx +++ b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx @@ -27,7 +27,7 @@ import { useTheme, } from '@superset-ui/core'; import RowCountLabel from 'src/explore/components/RowCountLabel'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; export type TableControlsProps = { filters: BinaryQueryObjectFilterClause[]; diff --git a/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.stories.tsx b/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.stories.tsx index 73880a7ac98..bd82ec84a43 100644 --- a/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.stories.tsx +++ b/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ import Button from 'src/components/Button'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import ToastContainer from 'src/components/MessageToasts/ToastContainer'; import CopyToClipboard from '.'; diff --git a/superset-frontend/src/components/Datasource/CollectionTable.tsx b/superset-frontend/src/components/Datasource/CollectionTable.tsx index 6b90ab933db..6c105fa425f 100644 --- a/superset-frontend/src/components/Datasource/CollectionTable.tsx +++ b/superset-frontend/src/components/Datasource/CollectionTable.tsx @@ -29,7 +29,7 @@ import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls'; import { t, styled } from '@superset-ui/core'; import Button from 'src/components/Button'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Fieldset from './Fieldset'; import { recurseReactClone } from './utils'; diff --git a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx index 6f25dc6d416..5a3b9508424 100644 --- a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx +++ b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx @@ -51,7 +51,7 @@ import TextControl from 'src/explore/components/controls/TextControl'; import TextAreaControl from 'src/explore/components/controls/TextAreaControl'; import SpatialControl from 'src/explore/components/controls/SpatialControl'; import withToasts from 'src/components/MessageToasts/withToasts'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import CurrencyControl from 'src/explore/components/controls/CurrencyControl'; import CollectionTable from './CollectionTable'; import Fieldset from './Fieldset'; diff --git a/superset-frontend/src/components/Datasource/DatasourceModal.tsx b/superset-frontend/src/components/Datasource/DatasourceModal.tsx index a93c611b258..3e6b349f4ab 100644 --- a/superset-frontend/src/components/Datasource/DatasourceModal.tsx +++ b/superset-frontend/src/components/Datasource/DatasourceModal.tsx @@ -31,7 +31,7 @@ import { css, } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Modal from 'src/components/Modal'; import AsyncEsmComponent from 'src/components/AsyncEsmComponent'; import ErrorMessageWithStackTrace from 'src/components/ErrorMessage/ErrorMessageWithStackTrace'; diff --git a/superset-frontend/src/components/Dropdown/index.tsx b/superset-frontend/src/components/Dropdown/index.tsx index 6b23b4be0cb..95a60eab459 100644 --- a/superset-frontend/src/components/Dropdown/index.tsx +++ b/superset-frontend/src/components/Dropdown/index.tsx @@ -29,7 +29,7 @@ import { DropdownProps as AntdDropdownProps, } from 'antd-v5'; import { styled } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; const MenuDots = styled.div` width: ${({ theme }) => theme.sizeUnit * 0.75}px; diff --git a/superset-frontend/src/components/DropdownContainer/DropdownContainer.test.tsx b/superset-frontend/src/components/DropdownContainer/DropdownContainer.test.tsx index d5475c01d5e..7833a1313be 100644 --- a/superset-frontend/src/components/DropdownContainer/DropdownContainer.test.tsx +++ b/superset-frontend/src/components/DropdownContainer/DropdownContainer.test.tsx @@ -18,7 +18,7 @@ */ import { screen, render, userEvent } from 'spec/helpers/testing-library'; import Button from '../Button'; -import Icons from '../Icons'; +import { Icons } from '../Icons'; import DropdownContainer from '.'; const generateItems = (n: number) => diff --git a/superset-frontend/src/components/DropdownContainer/index.tsx b/superset-frontend/src/components/DropdownContainer/index.tsx index e54b7537686..86a367a568e 100644 --- a/superset-frontend/src/components/DropdownContainer/index.tsx +++ b/superset-frontend/src/components/DropdownContainer/index.tsx @@ -35,7 +35,7 @@ import { Global } from '@emotion/react'; import { css, t, useTheme, usePrevious } from '@superset-ui/core'; import { useResizeDetector } from 'react-resize-detector'; import Badge from '../Badge'; -import Icons from '../Icons'; +import { Icons } from '../Icons'; import Button from '../Button'; import Popover from '../Popover'; import { Tooltip } from '../Tooltip'; diff --git a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx index 48ce1ff670d..ad0a97b0116 100644 --- a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx +++ b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx @@ -22,7 +22,7 @@ import { ErrorLevel, supersetTheme } from '@superset-ui/core'; import BasicErrorAlert from './BasicErrorAlert'; jest.mock( - 'src/components/Icons/Icon', + 'src/components/Icons/AsyncIcon', () => ({ fileName }: { fileName: string }) => ( diff --git a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx index 1129683b755..6f915442b06 100644 --- a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx +++ b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx @@ -17,7 +17,7 @@ * under the License. */ import { ErrorLevel, styled, themeObject, useTheme } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; const StyledContent = styled.div` display: flex; diff --git a/superset-frontend/src/components/ErrorMessage/DatabaseErrorMessage.test.tsx b/superset-frontend/src/components/ErrorMessage/DatabaseErrorMessage.test.tsx index ec63048197f..b9a98b7ced3 100644 --- a/superset-frontend/src/components/ErrorMessage/DatabaseErrorMessage.test.tsx +++ b/superset-frontend/src/components/ErrorMessage/DatabaseErrorMessage.test.tsx @@ -22,7 +22,7 @@ import { render, screen, userEvent } from 'spec/helpers/testing-library'; import DatabaseErrorMessage from './DatabaseErrorMessage'; jest.mock( - 'src/components/Icons/Icon', + 'src/components/Icons/AsyncIcon', () => ({ fileName }: { fileName: string }) => ( diff --git a/superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx b/superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx index d7e08dce1e5..f54e29272cc 100644 --- a/superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx +++ b/superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx @@ -22,7 +22,7 @@ import { render, screen } from 'spec/helpers/testing-library'; import DatasetNotFoundErrorMessage from './DatasetNotFoundErrorMessage'; jest.mock( - 'src/components/Icons/Icon', + 'src/components/Icons/AsyncIcon', () => ({ fileName }: { fileName: string }) => ( diff --git a/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx b/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx index 85e90598a1f..f1d31ba928a 100644 --- a/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx +++ b/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx @@ -19,7 +19,7 @@ import { useState } from 'react'; import { Tooltip } from 'src/components/Tooltip'; import Modal from 'src/components/Modal'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Alert from 'src/components/Alert'; import { t, useTheme } from '@superset-ui/core'; diff --git a/superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.test.tsx b/superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.test.tsx index fb4ca8430b9..f9a3415ace2 100644 --- a/superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.test.tsx +++ b/superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.test.tsx @@ -22,6 +22,14 @@ import { render, screen, userEvent } from 'spec/helpers/testing-library'; import ErrorMessageWithStackTrace from './ErrorMessageWithStackTrace'; import BasicErrorAlert from './BasicErrorAlert'; +jest.mock( + 'src/components/Icons/AsyncIcon', + () => + ({ fileName }: { fileName: string }) => ( + + ), +); + const mockedProps = { level: 'warning' as ErrorLevel, link: 'https://sample.com', diff --git a/superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.test.tsx b/superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.test.tsx index bebed79bbe2..c364501c67d 100644 --- a/superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.test.tsx +++ b/superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.test.tsx @@ -22,7 +22,7 @@ import { render, screen, userEvent } from 'spec/helpers/testing-library'; import FrontendNetworkErrorMessage from './FrontendNetworkErrorMessage'; jest.mock( - 'src/components/Icons/Icon', + 'src/components/Icons/AsyncIcon', () => ({ fileName }: { fileName: string }) => ( diff --git a/superset-frontend/src/components/ErrorMessage/IssueCode.tsx b/superset-frontend/src/components/ErrorMessage/IssueCode.tsx index 35cf3ec8d9b..af8ab9c7910 100644 --- a/superset-frontend/src/components/ErrorMessage/IssueCode.tsx +++ b/superset-frontend/src/components/ErrorMessage/IssueCode.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { useTheme } from '@superset-ui/core'; interface IssueCodeProps { diff --git a/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.test.tsx b/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.test.tsx index cbc193a59c0..e2fc8b92e80 100644 --- a/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.test.tsx +++ b/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.test.tsx @@ -22,7 +22,7 @@ import { render, screen, userEvent } from 'spec/helpers/testing-library'; import ParameterErrorMessage from './ParameterErrorMessage'; jest.mock( - 'src/components/Icons/Icon', + 'src/components/Icons/AsyncIcon', () => ({ fileName }: { fileName: string }) => ( diff --git a/superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.test.tsx b/superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.test.tsx index f9fe89c5df1..8fb2e3d041d 100644 --- a/superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.test.tsx +++ b/superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.test.tsx @@ -22,7 +22,7 @@ import { render, screen, userEvent } from 'spec/helpers/testing-library'; import TimeoutErrorMessage from './TimeoutErrorMessage'; jest.mock( - 'src/components/Icons/Icon', + 'src/components/Icons/AsyncIcon', () => ({ fileName }: { fileName: string }) => ( diff --git a/superset-frontend/src/components/FaveStar/index.tsx b/superset-frontend/src/components/FaveStar/index.tsx index 90eeda128fd..d349640ba97 100644 --- a/superset-frontend/src/components/FaveStar/index.tsx +++ b/superset-frontend/src/components/FaveStar/index.tsx @@ -21,7 +21,7 @@ import { useCallback, useEffect, MouseEvent } from 'react'; import { css, t, styled, useTheme } from '@superset-ui/core'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; export interface FaveStarProps { itemId: number; diff --git a/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx b/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx index 4578db2d98e..73ab7ad28ce 100644 --- a/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx +++ b/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx @@ -20,7 +20,7 @@ import { styled, css, SupersetTheme, t } from '@superset-ui/core'; import { Tooltip } from 'src/components/Tooltip'; import { Input } from 'src/components/Input'; import InfoTooltip from 'src/components/InfoTooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Button from 'src/components/Button'; import errorIcon from 'src/assets/images/icons/error.svg'; import FormItem from './FormItem'; diff --git a/superset-frontend/src/components/GridTable/Header.test.tsx b/superset-frontend/src/components/GridTable/Header.test.tsx index 7657dbe7b4a..47b16115ff4 100644 --- a/superset-frontend/src/components/GridTable/Header.test.tsx +++ b/superset-frontend/src/components/GridTable/Header.test.tsx @@ -26,9 +26,11 @@ jest.mock('src/components/Dropdown', () => ({ })); jest.mock('src/components/Icons', () => ({ - Sort: () =>
, - SortAsc: () =>
, - SortDesc: () =>
, + Icons: { + Sort: jest.fn(() =>
), + SortAsc: jest.fn(() =>
), + SortDesc: jest.fn(() =>
), + }, })); class MockApi extends EventTarget { diff --git a/superset-frontend/src/components/GridTable/Header.tsx b/superset-frontend/src/components/GridTable/Header.tsx index 8279fa1a49e..3de3eac5071 100644 --- a/superset-frontend/src/components/GridTable/Header.tsx +++ b/superset-frontend/src/components/GridTable/Header.tsx @@ -20,7 +20,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import { styled, useTheme, t } from '@superset-ui/core'; import type { Column, GridApi } from 'ag-grid-community'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { PIVOT_COL_ID } from './constants'; import HeaderMenu from './HeaderMenu'; diff --git a/superset-frontend/src/components/GridTable/HeaderMenu.test.tsx b/superset-frontend/src/components/GridTable/HeaderMenu.test.tsx index 65f486c34da..2b8dbc11abb 100644 --- a/superset-frontend/src/components/GridTable/HeaderMenu.test.tsx +++ b/superset-frontend/src/components/GridTable/HeaderMenu.test.tsx @@ -58,17 +58,6 @@ jest.mock('src/components/Menu', () => { return { Menu }; }); -jest.mock('src/components/Icons', () => ({ - DownloadOutlined: () =>
, - CopyOutlined: () =>
, - UnlockOutlined: () =>
, - VerticalRightOutlined: () =>
, - VerticalLeftOutlined: () =>
, - EyeInvisibleOutlined: () =>
, - EyeOutlined: () =>
, - ColumnWidthOutlined: () =>
, -})); - jest.mock('src/components/Dropdown', () => ({ MenuDotsDropdown: ({ overlay }: { overlay: React.ReactChild }) => (
{overlay}
diff --git a/superset-frontend/src/components/GridTable/HeaderMenu.tsx b/superset-frontend/src/components/GridTable/HeaderMenu.tsx index 5d327104b5c..c9e14c4b1a8 100644 --- a/superset-frontend/src/components/GridTable/HeaderMenu.tsx +++ b/superset-frontend/src/components/GridTable/HeaderMenu.tsx @@ -20,7 +20,7 @@ import { useCallback } from 'react'; import { styled, t } from '@superset-ui/core'; import type { Column, ColumnPinnedType, GridApi } from 'ag-grid-community'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { MenuDotsDropdown, DropdownProps } from 'src/components/Dropdown'; import { Menu } from 'src/components/Menu'; import copyTextToClipboard from 'src/utils/copy'; diff --git a/superset-frontend/src/components/IconButton/index.tsx b/superset-frontend/src/components/IconButton/index.tsx index 64950abc355..e1edfaa0d9f 100644 --- a/superset-frontend/src/components/IconButton/index.tsx +++ b/superset-frontend/src/components/IconButton/index.tsx @@ -18,7 +18,7 @@ */ import { styled } from '@superset-ui/core'; import Button, { ButtonProps as AntdButtonProps } from 'src/components/Button'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import LinesEllipsis from 'react-lines-ellipsis'; export interface IconButtonProps extends AntdButtonProps { diff --git a/superset-frontend/src/components/IconTooltip/IconTooltip.stories.tsx b/superset-frontend/src/components/IconTooltip/IconTooltip.stories.tsx index e673bc8c788..7e165a2fab8 100644 --- a/superset-frontend/src/components/IconTooltip/IconTooltip.stories.tsx +++ b/superset-frontend/src/components/IconTooltip/IconTooltip.stories.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { css, useTheme } from '@superset-ui/core'; import { IconTooltip, Props } from '.'; diff --git a/superset-frontend/src/components/Icons/AntdEnhanced.tsx b/superset-frontend/src/components/Icons/AntdEnhanced.tsx index 6c2e338e628..a8997e0d5b5 100644 --- a/superset-frontend/src/components/Icons/AntdEnhanced.tsx +++ b/superset-frontend/src/components/Icons/AntdEnhanced.tsx @@ -112,9 +112,13 @@ import { UnorderedListOutlined, WarningOutlined, } from '@ant-design/icons'; +import { FC } from 'react'; import { IconType } from './types'; import { BaseIconComponent } from './BaseIcon'; +// partial name matches work too +const EXCLUDED_ICONS = ['TwoTone']; + const AntdIcons = { AlignCenterOutlined, AlignLeftOutlined, @@ -207,19 +211,25 @@ const AntdIcons = { FilterOutlined, UnorderedListOutlined, WarningOutlined, -}; +} as const; -const AntdEnhancedIcons = Object.keys(AntdIcons) - .filter(k => !k.includes('TwoTone')) - .map(k => ({ - [k]: (props: IconType) => ( - - ), - })) - .reduce((l, r) => ({ ...l, ...r })); +type AntdIconNames = keyof typeof AntdIcons; -export default AntdEnhancedIcons; +export const antdEnhancedIcons: Record< + AntdIconNames, + FC +> = Object.keys(AntdIcons) + .filter(key => !EXCLUDED_ICONS.some(excluded => key.includes(excluded))) + .reduce( + (acc, key) => { + acc[key as AntdIconNames] = (props: IconType) => ( + + ); + return acc; + }, + {} as Record>, + ); diff --git a/superset-frontend/src/components/Icons/Icon.tsx b/superset-frontend/src/components/Icons/AsyncIcon.tsx similarity index 96% rename from superset-frontend/src/components/Icons/Icon.tsx rename to superset-frontend/src/components/Icons/AsyncIcon.tsx index 3c27ca64707..1ce39c25bd6 100644 --- a/superset-frontend/src/components/Icons/Icon.tsx +++ b/superset-frontend/src/components/Icons/AsyncIcon.tsx @@ -22,7 +22,7 @@ import TransparentIcon from 'src/assets/images/icons/transparent.svg'; import { IconType } from './types'; import { BaseIconComponent } from './BaseIcon'; -export const Icon = (props: IconType) => { +const AsyncIcon = (props: IconType) => { const [, setLoaded] = useState(false); const ImportedSVG = useRef>>(); const { fileName } = props; @@ -51,4 +51,4 @@ export const Icon = (props: IconType) => { ); }; -export default Icon; +export default AsyncIcon; diff --git a/superset-frontend/src/components/Icons/Icons.stories.tsx b/superset-frontend/src/components/Icons/Icons.stories.tsx index aced4637da4..285e7845bae 100644 --- a/superset-frontend/src/components/Icons/Icons.stories.tsx +++ b/superset-frontend/src/components/Icons/Icons.stories.tsx @@ -19,13 +19,13 @@ import { useState } from 'react'; import { styled, supersetTheme } from '@superset-ui/core'; import { Input } from 'antd-v5'; -import Icons from '.'; +import { Icons, IconNameType } from '.'; import IconType from './types'; -import Icon from './Icon'; +import { BaseIconComponent } from './BaseIcon'; export default { title: 'Icons', - component: Icon, + component: BaseIconComponent, }; const palette: Record = { Default: null }; @@ -86,7 +86,7 @@ export const InteractiveIcons = ({ /> {filteredIcons.map(k => { - const IconComponent = Icons[k]; + const IconComponent = Icons[k as IconNameType]; return ( diff --git a/superset-frontend/src/components/Icons/index.tsx b/superset-frontend/src/components/Icons/index.tsx index eb3fa51605b..0651d529d34 100644 --- a/superset-frontend/src/components/Icons/index.tsx +++ b/superset-frontend/src/components/Icons/index.tsx @@ -18,51 +18,62 @@ */ import { FC } from 'react'; -import { startCase } from 'lodash'; -import AntdEnhancedIcons from './AntdEnhanced'; -import Icon from './Icon'; +import { antdEnhancedIcons } from './AntdEnhanced'; +import AsyncIcon from './AsyncIcon'; import IconType from './types'; -const IconFileNames = [ - // to keep custom - 'ballot', - 'big-number-chart-tile', - 'binoculars', - 'category', - 'certified', - 'checkbox-half', - 'checkbox-off', - 'checkbox-on', - 'circle_solid', - 'drag', - 'error_solid_small_red', - 'error', - 'full', - 'layers', - 'queued', - 'redo', - 'running', - 'slack', - 'square', - 'sort_asc', - 'sort_desc', - 'sort', - 'transparent', - 'triangle_down', - 'undo', -]; +export type { IconType }; +/** + * Filename is going to be inferred from the icon name. + * i.e. BigNumberChartTile => assets/images/icons/big_number_chart_tile + */ +const customIcons = [ + 'Ballot', + 'BigNumberChartTile', + 'Binoculars', + 'Category', + 'Certified', + 'CheckboxHalf', + 'CheckboxOff', + 'CheckboxOn', + 'CircleSolid', + 'Drag', + 'ErrorSolidSmallRed', + 'Error', + 'Full', + 'Layers', + 'Queued', + 'Redo', + 'Running', + 'Slack', + 'Square', + 'SortAsc', + 'SortDesc', + 'Sort', + 'Transparent', + 'TriangleDown', + 'Undo', +] as const; -const iconOverrides: Record> = {}; -IconFileNames.forEach(fileName => { - const keyName = startCase(fileName).replace(/ /g, ''); - iconOverrides[keyName] = (props: IconType) => ( - +type CustomIconType = Record<(typeof customIcons)[number], FC>; + +const iconOverrides: CustomIconType = {} as CustomIconType; +customIcons.forEach(customIcon => { + const fileName = customIcon + .replace(/([a-z0-9])([A-Z])/g, '$1_$2') + .toLowerCase(); + iconOverrides[customIcon] = (props: IconType) => ( + ); }); -export type { IconType }; +export type IconNameType = + | keyof typeof antdEnhancedIcons + | keyof typeof iconOverrides; -export default { - ...AntdEnhancedIcons, +type IconComponentType = Record>; + +export const Icons: IconComponentType = { + ...antdEnhancedIcons, ...iconOverrides, }; diff --git a/superset-frontend/src/components/IndeterminateCheckbox/index.tsx b/superset-frontend/src/components/IndeterminateCheckbox/index.tsx index ef30eef7672..fda59ca5a1c 100644 --- a/superset-frontend/src/components/IndeterminateCheckbox/index.tsx +++ b/superset-frontend/src/components/IndeterminateCheckbox/index.tsx @@ -26,7 +26,7 @@ import { } from 'react'; import { styled } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; export interface IndeterminateCheckboxProps { indeterminate: boolean; diff --git a/superset-frontend/src/components/InfoTooltip/index.tsx b/superset-frontend/src/components/InfoTooltip/index.tsx index f7d4378b0d7..9c7baf0719c 100644 --- a/superset-frontend/src/components/InfoTooltip/index.tsx +++ b/superset-frontend/src/components/InfoTooltip/index.tsx @@ -19,7 +19,7 @@ import { styled, useTheme, css } from '@superset-ui/core'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { ActionType } from 'src/types/Action'; export interface InfoTooltipProps { diff --git a/superset-frontend/src/components/Label/reusable/DatasetTypeLabel.tsx b/superset-frontend/src/components/Label/reusable/DatasetTypeLabel.tsx index 988b5f88e38..8a475a68d86 100644 --- a/superset-frontend/src/components/Label/reusable/DatasetTypeLabel.tsx +++ b/superset-frontend/src/components/Label/reusable/DatasetTypeLabel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Label from 'src/components/Label'; import { t, useTheme } from '@superset-ui/core'; diff --git a/superset-frontend/src/components/Label/reusable/PublishedLabel.tsx b/superset-frontend/src/components/Label/reusable/PublishedLabel.tsx index ce33a5364a7..349dd649a33 100644 --- a/superset-frontend/src/components/Label/reusable/PublishedLabel.tsx +++ b/superset-frontend/src/components/Label/reusable/PublishedLabel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Label from 'src/components/Label'; import { t, useTheme } from '@superset-ui/core'; diff --git a/superset-frontend/src/components/LastUpdated/index.tsx b/superset-frontend/src/components/LastUpdated/index.tsx index 63886f575b5..5fcad365f41 100644 --- a/superset-frontend/src/components/LastUpdated/index.tsx +++ b/superset-frontend/src/components/LastUpdated/index.tsx @@ -25,7 +25,7 @@ import { import { extendedDayjs } from 'src/utils/dates'; import { t, styled, css } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import dayjs from 'dayjs'; const REFRESH_INTERVAL = 60000; // every minute diff --git a/superset-frontend/src/components/ListView/ActionsBar.tsx b/superset-frontend/src/components/ListView/ActionsBar.tsx index b1184f02877..a7742aca0ee 100644 --- a/superset-frontend/src/components/ListView/ActionsBar.tsx +++ b/superset-frontend/src/components/ListView/ActionsBar.tsx @@ -19,7 +19,7 @@ import { ReactElement } from 'react'; import { styled } from '@superset-ui/core'; import { Tooltip, TooltipPlacement } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons, IconNameType } from 'src/components/Icons'; export type ActionProps = { label: string; @@ -56,7 +56,7 @@ export default function ActionsBar({ actions }: ActionsBarProps) { return ( {actions.map((action, index) => { - const ActionIcon = Icons[action.icon]; + const ActionIcon = Icons[action.icon as IconNameType]; if (action.tooltip) { return ( css` diff --git a/superset-frontend/src/components/Popover/Popover.test.tsx b/superset-frontend/src/components/Popover/Popover.test.tsx index eda71900c4a..3cb05fd45a3 100644 --- a/superset-frontend/src/components/Popover/Popover.test.tsx +++ b/superset-frontend/src/components/Popover/Popover.test.tsx @@ -23,7 +23,7 @@ import { waitFor, } from 'spec/helpers/testing-library'; import { supersetTheme } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Button from 'src/components/Button'; import Popover from 'src/components/Popover'; diff --git a/superset-frontend/src/components/PopoverDropdown/index.tsx b/superset-frontend/src/components/PopoverDropdown/index.tsx index 5532e210638..8e80c0cb652 100644 --- a/superset-frontend/src/components/PopoverDropdown/index.tsx +++ b/superset-frontend/src/components/PopoverDropdown/index.tsx @@ -21,7 +21,7 @@ import cx from 'classnames'; import { styled, useTheme } from '@superset-ui/core'; import { Dropdown } from 'src/components/Dropdown'; import { Menu } from 'src/components/Menu'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; export interface OptionProps { value: string; diff --git a/superset-frontend/src/components/PopoverSection/index.tsx b/superset-frontend/src/components/PopoverSection/index.tsx index 97537e42f0c..d08a8ce0699 100644 --- a/superset-frontend/src/components/PopoverSection/index.tsx +++ b/superset-frontend/src/components/PopoverSection/index.tsx @@ -19,7 +19,7 @@ import { MouseEventHandler, ReactNode } from 'react'; import { css, useTheme } from '@superset-ui/core'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; export interface PopoverSectionProps { title: string; diff --git a/superset-frontend/src/components/Radio/Radio.stories.tsx b/superset-frontend/src/components/Radio/Radio.stories.tsx index 5155c7d23ca..90b5c9b5a25 100644 --- a/superset-frontend/src/components/Radio/Radio.stories.tsx +++ b/superset-frontend/src/components/Radio/Radio.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ import { Space } from 'src/components/Space'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { css } from '@superset-ui/core'; import { Radio, RadioProps, RadioGroupWrapperProps } from './index'; @@ -121,19 +121,6 @@ RadioGroupWithOptionsStory.args = { ), }, - { - value: 2, - label: ( - - - DotChart - - ), - }, { value: 3, label: ( diff --git a/superset-frontend/src/components/RefreshLabel/index.tsx b/superset-frontend/src/components/RefreshLabel/index.tsx index 0488e5ab7e5..3847c9f5d65 100644 --- a/superset-frontend/src/components/RefreshLabel/index.tsx +++ b/superset-frontend/src/components/RefreshLabel/index.tsx @@ -19,7 +19,7 @@ import { MouseEventHandler, forwardRef } from 'react'; import { SupersetTheme } from '@superset-ui/core'; import { Tooltip } from 'src/components/Tooltip'; -import Icons, { IconType } from 'src/components/Icons'; +import { Icons, IconType } from 'src/components/Icons'; export interface RefreshLabelProps { onClick: MouseEventHandler; diff --git a/superset-frontend/src/components/Select/AsyncSelect.tsx b/superset-frontend/src/components/Select/AsyncSelect.tsx index 29c6fd1283e..4615f934186 100644 --- a/superset-frontend/src/components/Select/AsyncSelect.tsx +++ b/superset-frontend/src/components/Select/AsyncSelect.tsx @@ -40,7 +40,7 @@ import { // eslint-disable-next-line no-restricted-imports import { LabeledValue as AntdLabeledValue } from 'antd/lib/select'; // TODO: Remove antd import { debounce, isEqual, uniq } from 'lodash'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { FAST_DEBOUNCE, SLOW_DEBOUNCE } from 'src/constants'; import { getValue, diff --git a/superset-frontend/src/components/Select/styles.tsx b/superset-frontend/src/components/Select/styles.tsx index 5c9111e8c98..6194367464e 100644 --- a/superset-frontend/src/components/Select/styles.tsx +++ b/superset-frontend/src/components/Select/styles.tsx @@ -17,7 +17,7 @@ * under the License. */ import { styled } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; // eslint-disable-next-line no-restricted-imports import { Spin, Tag } from 'antd'; // TODO: Remove antd // eslint-disable-next-line no-restricted-imports diff --git a/superset-frontend/src/components/Select/utils.tsx b/superset-frontend/src/components/Select/utils.tsx index 0c21ec228ef..7025b7951ad 100644 --- a/superset-frontend/src/components/Select/utils.tsx +++ b/superset-frontend/src/components/Select/utils.tsx @@ -20,7 +20,7 @@ import { ensureIsArray, t } from '@superset-ui/core'; // eslint-disable-next-line no-restricted-imports import AntdSelect, { LabeledValue as AntdLabeledValue } from 'antd/lib/select'; // TODO: Remove antd import { ReactElement, RefObject } from 'react'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { StyledHelperText, StyledLoadingText, StyledSpin } from './styles'; import { LabeledValue, RawValue, SelectOptionsType, V } from './types'; diff --git a/superset-frontend/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx b/superset-frontend/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx index 7e9b49cd9ad..5e81b9fbcec 100644 --- a/superset-frontend/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx +++ b/superset-frontend/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx @@ -19,7 +19,7 @@ import { useState } from 'react'; import { css, useTheme } from '@superset-ui/core'; import { Radio } from 'src/components/Radio'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Popover from 'src/components/Popover'; export interface HeaderWithRadioGroupProps { diff --git a/superset-frontend/src/components/TableCollection/index.tsx b/superset-frontend/src/components/TableCollection/index.tsx index 2e660aa02d8..dc97a09c02c 100644 --- a/superset-frontend/src/components/TableCollection/index.tsx +++ b/superset-frontend/src/components/TableCollection/index.tsx @@ -20,7 +20,7 @@ import { memo } from 'react'; import cx from 'classnames'; import { TableInstance } from 'react-table'; import { styled } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; interface TableCollectionProps { getTableProps: (userProps?: any) => any; diff --git a/superset-frontend/src/components/TableSelector/index.tsx b/superset-frontend/src/components/TableSelector/index.tsx index 9d4f916032b..bd74b09ca74 100644 --- a/superset-frontend/src/components/TableSelector/index.tsx +++ b/superset-frontend/src/components/TableSelector/index.tsx @@ -34,7 +34,7 @@ import { } from '@superset-ui/core'; import { Select } from 'src/components'; import { FormLabel } from 'src/components/Form'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import DatabaseSelector, { DatabaseObject, } from 'src/components/DatabaseSelector'; diff --git a/superset-frontend/src/components/Tabs/Tabs.tsx b/superset-frontend/src/components/Tabs/Tabs.tsx index 79fee76907e..86e304d6ea5 100644 --- a/superset-frontend/src/components/Tabs/Tabs.tsx +++ b/superset-frontend/src/components/Tabs/Tabs.tsx @@ -19,7 +19,7 @@ import { css, styled } from '@superset-ui/core'; // eslint-disable-next-line no-restricted-imports import AntdTabs, { TabsProps as AntdTabsProps } from 'antd/lib/tabs'; // TODO: Remove antd -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; export interface TabsProps extends AntdTabsProps { fullWidth?: boolean; diff --git a/superset-frontend/src/components/Tags/Tag.tsx b/superset-frontend/src/components/Tags/Tag.tsx index 85983d182da..fe0a43b28fc 100644 --- a/superset-frontend/src/components/Tags/Tag.tsx +++ b/superset-frontend/src/components/Tags/Tag.tsx @@ -22,7 +22,7 @@ import TagType from 'src/types/TagType'; import { Tag as AntdTag } from 'antd-v5'; import { useMemo } from 'react'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; const StyledTag = styled(AntdTag)` ${({ theme }) => ` diff --git a/superset-frontend/src/components/Timer/index.tsx b/superset-frontend/src/components/Timer/index.tsx index 4654d8b5259..e7847b3eb4e 100644 --- a/superset-frontend/src/components/Timer/index.tsx +++ b/superset-frontend/src/components/Timer/index.tsx @@ -19,7 +19,7 @@ import { useEffect, useRef, useState } from 'react'; import { styled, useTheme } from '@superset-ui/core'; import Label, { Type } from 'src/components/Label'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { now, fDuration } from 'src/utils/dates'; diff --git a/superset-frontend/src/components/Tooltip/Tooltip.test.tsx b/superset-frontend/src/components/Tooltip/Tooltip.test.tsx index c58816b9617..264684261f5 100644 --- a/superset-frontend/src/components/Tooltip/Tooltip.test.tsx +++ b/superset-frontend/src/components/Tooltip/Tooltip.test.tsx @@ -18,7 +18,7 @@ */ import { render, screen, userEvent } from 'spec/helpers/testing-library'; import Button from 'src/components/Button'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Tooltip } from '.'; test('starts hidden with default props', () => { diff --git a/superset-frontend/src/components/WarningIconWithTooltip/index.tsx b/superset-frontend/src/components/WarningIconWithTooltip/index.tsx index 123f7086fbd..9aa94a85238 100644 --- a/superset-frontend/src/components/WarningIconWithTooltip/index.tsx +++ b/superset-frontend/src/components/WarningIconWithTooltip/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useTheme, SafeMarkdown } from '@superset-ui/core'; -import Icons, { IconType } from 'src/components/Icons'; +import { Icons, IconType } from 'src/components/Icons'; import { Tooltip } from 'src/components/Tooltip'; export interface WarningIconWithTooltipProps { diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx index 6ab302aefdd..728db94cf73 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx @@ -32,7 +32,7 @@ import { useDispatch, useSelector } from 'react-redux'; import ErrorBoundary from 'src/components/ErrorBoundary'; import BuilderComponentPane from 'src/dashboard/components/BuilderComponentPane'; import DashboardHeader from 'src/dashboard/components/Header'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import IconButton from 'src/dashboard/components/IconButton'; import { Droppable } from 'src/dashboard/components/dnd/DragDroppable'; import DashboardComponent from 'src/dashboard/containers/DashboardComponent'; diff --git a/superset-frontend/src/dashboard/components/DashboardGrid.jsx b/superset-frontend/src/dashboard/components/DashboardGrid.jsx index 8f410625e9a..5a6ba5b2c4a 100644 --- a/superset-frontend/src/dashboard/components/DashboardGrid.jsx +++ b/superset-frontend/src/dashboard/components/DashboardGrid.jsx @@ -22,7 +22,7 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import { addAlpha, css, styled, t } from '@superset-ui/core'; import { EmptyState } from 'src/components/EmptyState'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { componentShape } from '../util/propShapes'; import DashboardComponent from '../containers/DashboardComponent'; import { Droppable } from './dnd/DragDroppable'; diff --git a/superset-frontend/src/dashboard/components/DeleteComponentButton.tsx b/superset-frontend/src/dashboard/components/DeleteComponentButton.tsx index 9c1231c1274..221d544493c 100644 --- a/superset-frontend/src/dashboard/components/DeleteComponentButton.tsx +++ b/superset-frontend/src/dashboard/components/DeleteComponentButton.tsx @@ -18,7 +18,7 @@ */ import { MouseEventHandler, FC } from 'react'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import IconButton from './IconButton'; type DeleteComponentButtonProps = { diff --git a/superset-frontend/src/dashboard/components/FiltersBadge/FilterIndicator/index.tsx b/superset-frontend/src/dashboard/components/FiltersBadge/FilterIndicator/index.tsx index 8eb1cf4c646..9d9509b304e 100644 --- a/superset-frontend/src/dashboard/components/FiltersBadge/FilterIndicator/index.tsx +++ b/superset-frontend/src/dashboard/components/FiltersBadge/FilterIndicator/index.tsx @@ -19,7 +19,7 @@ import { forwardRef } from 'react'; import { css } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { getFilterValueForDisplay } from 'src/dashboard/components/nativeFilters/utils'; import { FilterValue, diff --git a/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx b/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx index 5aaebc4a938..138fb939ecc 100644 --- a/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx +++ b/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx @@ -37,7 +37,7 @@ import { t, usePrevious, } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { setDirectPathToChild } from 'src/dashboard/actions/dashboardState'; import { useChartLayoutItems } from 'src/dashboard/util/useChartLayoutItems'; import Badge from 'src/components/Badge'; diff --git a/superset-frontend/src/dashboard/components/Header/index.jsx b/superset-frontend/src/dashboard/components/Header/index.jsx index 35aa0809c44..edece8b2bbc 100644 --- a/superset-frontend/src/dashboard/components/Header/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/index.jsx @@ -36,7 +36,7 @@ import { LOG_ACTIONS_FORCE_REFRESH_DASHBOARD, LOG_ACTIONS_TOGGLE_EDIT_DASHBOARD, } from 'src/logger/LogUtils'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Button } from 'src/components/'; import { findPermission } from 'src/utils/findPermission'; import { Tooltip } from 'src/components/Tooltip'; diff --git a/superset-frontend/src/dashboard/components/SliceAdder.tsx b/superset-frontend/src/dashboard/components/SliceAdder.tsx index cad502f14f7..f86655112ac 100644 --- a/superset-frontend/src/dashboard/components/SliceAdder.tsx +++ b/superset-frontend/src/dashboard/components/SliceAdder.tsx @@ -27,7 +27,7 @@ import { Input } from 'src/components/Input'; import { Select } from 'src/components'; import Loading from 'src/components/Loading'; import Button from 'src/components/Button'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { LocalStorageKeys, getItem, diff --git a/superset-frontend/src/dashboard/components/SliceHeader/index.tsx b/superset-frontend/src/dashboard/components/SliceHeader/index.tsx index 70268986c34..359c871aee8 100644 --- a/superset-frontend/src/dashboard/components/SliceHeader/index.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeader/index.tsx @@ -32,7 +32,7 @@ import EditableTitle from 'src/components/EditableTitle'; import SliceHeaderControls from 'src/dashboard/components/SliceHeaderControls'; import { SliceHeaderControlsProps } from 'src/dashboard/components/SliceHeaderControls/types'; import FiltersBadge from 'src/dashboard/components/FiltersBadge'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { RootState } from 'src/dashboard/types'; import { getSliceHeaderTooltip } from 'src/dashboard/util/getSliceHeaderTooltip'; import { DashboardPageIdContext } from 'src/dashboard/containers/DashboardPage'; diff --git a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx index 808bfcc61da..af69cc3f621 100644 --- a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx @@ -47,7 +47,7 @@ import ShareMenuItems from 'src/dashboard/components/menu/ShareMenuItems'; import downloadAsImage from 'src/utils/downloadAsImage'; import { getSliceHeaderTooltip } from 'src/dashboard/util/getSliceHeaderTooltip'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import ModalTrigger from 'src/components/ModalTrigger'; import ViewQueryModal from 'src/explore/components/controls/ViewQueryModal'; import { ResultsPaneOnDashboard } from 'src/explore/components/DataTablesPane'; diff --git a/superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx b/superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx index 317fa981138..106e240d627 100644 --- a/superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx +++ b/superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx @@ -24,7 +24,7 @@ import { getDashboardPermalink } from 'src/utils/urlUtils'; import { useToasts } from 'src/components/MessageToasts/withToasts'; import { shallowEqual, useSelector } from 'react-redux'; import { RootState } from 'src/dashboard/types'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; export type URLShortLinkButtonProps = { dashboardId: number; diff --git a/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx b/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx index 7a2acfa0384..4933cf20b59 100644 --- a/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx +++ b/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx @@ -18,7 +18,7 @@ */ import { LegacyRef } from 'react'; import { css, styled } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; interface DragHandleProps { position: 'left' | 'top'; diff --git a/superset-frontend/src/dashboard/components/filterscope/renderFilterScopeTreeNodes.jsx b/superset-frontend/src/dashboard/components/filterscope/renderFilterScopeTreeNodes.jsx index b2bc4a2472c..764f7c531c1 100644 --- a/superset-frontend/src/dashboard/components/filterscope/renderFilterScopeTreeNodes.jsx +++ b/superset-frontend/src/dashboard/components/filterscope/renderFilterScopeTreeNodes.jsx @@ -18,7 +18,7 @@ */ import cx from 'classnames'; import { styled } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { CHART_TYPE } from 'src/dashboard/util/componentTypes'; const ChartIcon = styled(Icons.BarChartOutlined)` diff --git a/superset-frontend/src/dashboard/components/gridComponents/Column.jsx b/superset-frontend/src/dashboard/components/gridComponents/Column.jsx index 1b7bb9c82ca..2593a5906c6 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Column.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Column.jsx @@ -20,7 +20,7 @@ import { Fragment, useCallback, useState, useMemo, memo } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import { css, styled, t } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import DashboardComponent from 'src/dashboard/containers/DashboardComponent'; import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton'; import { diff --git a/superset-frontend/src/dashboard/components/gridComponents/Row.jsx b/superset-frontend/src/dashboard/components/gridComponents/Row.jsx index 92f4be53d06..b38907dbffb 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Row.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Row.jsx @@ -44,7 +44,7 @@ import DragHandle from 'src/dashboard/components/dnd/DragHandle'; import DashboardComponent from 'src/dashboard/containers/DashboardComponent'; import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton'; import HoverMenu from 'src/dashboard/components/menu/HoverMenu'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import IconButton from 'src/dashboard/components/IconButton'; import BackgroundStyleDropdown from 'src/dashboard/components/menu/BackgroundStyleDropdown'; import WithPopoverMenu from 'src/dashboard/components/menu/WithPopoverMenu'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx b/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx index e4d87f7b0fd..722bdcfa89c 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx @@ -21,7 +21,7 @@ import PropTypes from 'prop-types'; import { styled, t, usePrevious, css } from '@superset-ui/core'; import { useSelector } from 'react-redux'; import { LineEditableTabs } from 'src/components/Tabs'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { LOG_ACTIONS_SELECT_DASHBOARD_TAB } from 'src/logger/LogUtils'; import Modal from 'src/components/Modal'; import { DROP_LEFT, DROP_RIGHT } from 'src/dashboard/util/getDropPosition'; diff --git a/superset-frontend/src/dashboard/components/menu/BackgroundStyleDropdown.tsx b/superset-frontend/src/dashboard/components/menu/BackgroundStyleDropdown.tsx index ac6cf8870fc..d2b331ad0dc 100644 --- a/superset-frontend/src/dashboard/components/menu/BackgroundStyleDropdown.tsx +++ b/superset-frontend/src/dashboard/components/menu/BackgroundStyleDropdown.tsx @@ -35,7 +35,6 @@ interface BackgroundStyleDropdownProps { const BackgroundStyleOption = styled.div` ${({ theme }) => css` display: inline-block; - &:before { content: ''; width: 1em; @@ -44,17 +43,14 @@ const BackgroundStyleOption = styled.div` display: inline-block; vertical-align: middle; } - &.background--white { padding-left: 0; background: transparent; - &:before { background: ${theme.colors.grayscale.light5}; border: 1px solid ${theme.colors.grayscale.light2}; } } - /* Create the transparent rect icon */ &.background--transparent:before { background-image: diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx index 1d8845aaa14..dfd5b4533a5 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx @@ -26,7 +26,7 @@ import { } from '@superset-ui/core'; import { Tooltip } from 'src/components/Tooltip'; import { FilterBarOrientation } from 'src/dashboard/types'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { ellipsisCss } from './styles'; const StyledCrossFilterTitle = styled.div` diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.tsx index 41d9b0cb53c..526820a767a 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.tsx @@ -27,7 +27,7 @@ import { } from 'src/dashboard/types'; import { useSelector } from 'react-redux'; import { CHART_TYPE } from 'src/dashboard/util/componentTypes'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Button from 'src/components/Button'; import { FilterTitle } from 'src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer'; import { NEW_CHART_SCOPING_ID } from './constants'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx index ea3dee75537..2e43866fc95 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx @@ -37,7 +37,7 @@ import { } from 'src/dashboard/types'; import { CHART_TYPE } from 'src/dashboard/util/componentTypes'; import { SelectOptionsType } from 'src/components/Select/types'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Tooltip } from 'src/components/Tooltip'; import Alert from 'src/components/Alert'; import { NEW_CHART_SCOPING_ID } from './constants'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx index 7db981d69a6..26689cf9259 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx @@ -26,7 +26,7 @@ import { saveFilterBarOrientation, saveCrossFiltersSetting, } from 'src/dashboard/actions/dashboardInfo'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Checkbox from 'src/components/Checkbox'; import { Dropdown } from 'src/components/Dropdown'; import { Button } from 'src/components'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx index 7e45975ea41..fee23889a50 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx @@ -50,7 +50,7 @@ import { FilterBarOrientation, RootState } from 'src/dashboard/types'; import DropdownContainer, { Ref as DropdownContainerRef, } from 'src/components/DropdownContainer'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { useChartIds } from 'src/dashboard/util/charts/useChartIds'; import { useChartLayoutItems } from 'src/dashboard/util/useChartLayoutItems'; import { FiltersOutOfScopeCollapsible } from '../FiltersOutOfScopeCollapsible'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.tsx index 136adb4002c..4625db8d176 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.tsx @@ -23,7 +23,7 @@ import { useCSSTextTruncation, truncationCSS, } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Tooltip } from 'src/components/Tooltip'; import { FilterBarOrientation } from 'src/dashboard/types'; import { FilterDividerProps } from './types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx index 785ea4960de..fc7f056c512 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx @@ -19,7 +19,7 @@ /* eslint-disable no-param-reassign */ import { css, styled, t } from '@superset-ui/core'; import { memo, FC } from 'react'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Button from 'src/components/Button'; import { getFilterBarTestId } from '../utils'; import FilterBarSettings from '../FilterBarSettings'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx index 06e8d06c128..d659d7d2c16 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx @@ -31,7 +31,7 @@ import { } from 'react'; import cx from 'classnames'; import { styled, t, useTheme } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Loading from 'src/components/Loading'; import { EmptyState } from 'src/components/EmptyState'; import { getFilterBarTestId } from './utils'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/DependenciesRow.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/DependenciesRow.tsx index 50e97e8209d..7640dac5c42 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/DependenciesRow.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/DependenciesRow.tsx @@ -19,7 +19,7 @@ import { memo, useCallback, useMemo } from 'react'; import { useDispatch } from 'react-redux'; import { css, t, useTheme, useTruncation } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { setDirectPathToChild } from 'src/dashboard/actions/dashboardState'; import { DependencyItem, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx index 78da53009e7..33e86dce644 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx @@ -18,7 +18,7 @@ */ import { useSelector } from 'react-redux'; import { css, SupersetTheme, useTheme, useTruncation } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { useFilterConfigModal } from 'src/dashboard/components/nativeFilters/FilterBar/FilterConfigurationLink/useFilterConfigModal'; import { RootState } from 'src/dashboard/types'; import { Row, FilterName, InternalRow } from './Styles'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx index 22fdb7f3094..65659bd5aa7 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx @@ -25,7 +25,7 @@ import { useDrop, XYCoord, } from 'react-dnd'; -import Icons, { IconType } from 'src/components/Icons'; +import { Icons, IconType } from 'src/components/Icons'; interface TitleContainerProps { readonly isDragging: boolean; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx index 59898500c77..bc1f25beb9c 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx @@ -19,7 +19,7 @@ import { forwardRef, ReactNode } from 'react'; import { styled, t, useTheme } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { FilterRemoval } from './types'; import DraggableFilter from './DraggableFilter'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx index 7ef44bc8a0a..5a554af3ad4 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx @@ -20,7 +20,7 @@ import { useRef, FC } from 'react'; import { NativeFilterType, styled, t, useTheme } from '@superset-ui/core'; import { Button } from 'src/components'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import FilterTitleContainer from './FilterTitleContainer'; import { FilterRemoval } from './types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx index 5b1c39b0969..44972e53239 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx @@ -18,7 +18,7 @@ */ import { useState } from 'react'; import { styled, t } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Select } from 'src/components'; import { CollapsibleControl } from './CollapsibleControl'; import { INPUT_WIDTH } from './constants'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx index 9921e6e8e97..6ad9e5e4f0c 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx @@ -22,7 +22,7 @@ import { NativeFilterScope } from '@superset-ui/core'; import { Tree } from 'src/components'; import { DASHBOARD_ROOT_ID } from 'src/dashboard/util/constants'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { useFilterScopeTree } from './state'; import { findFilterScope, getTreeCheckedItems } from './utils'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx index 37c7fb5c32f..008ed703ee1 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx @@ -64,7 +64,7 @@ import Collapse from 'src/components/Collapse'; import BasicErrorAlert from 'src/components/ErrorMessage/BasicErrorAlert'; import ErrorMessageWithStackTrace from 'src/components/ErrorMessage/ErrorMessageWithStackTrace'; import { FormItem } from 'src/components/Form'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Loading from 'src/components/Loading'; import { addDangerToast } from 'src/components/MessageToasts/actions'; import { Radio } from 'src/components/Radio'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx index 8ff111ecbe8..a7004954f28 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx @@ -30,7 +30,7 @@ import { } from '@superset-ui/core'; import { useDispatch } from 'react-redux'; import { AntdForm } from 'src/components'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import ErrorBoundary from 'src/components/ErrorBoundary'; import { StyledModal } from 'src/components/Modal'; import { testWithId } from 'src/utils/testUtils'; diff --git a/superset-frontend/src/explore/components/ControlHeader.tsx b/superset-frontend/src/explore/components/ControlHeader.tsx index 77af8702024..fcd59a1808c 100644 --- a/superset-frontend/src/explore/components/ControlHeader.tsx +++ b/superset-frontend/src/explore/components/ControlHeader.tsx @@ -21,7 +21,7 @@ import { t, css, useTheme, SupersetTheme } from '@superset-ui/core'; import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls'; import { Tooltip } from 'src/components/Tooltip'; import { FormLabel } from 'src/components/Form'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; type ValidationError = string; diff --git a/superset-frontend/src/explore/components/ControlPanelsContainer.tsx b/superset-frontend/src/explore/components/ControlPanelsContainer.tsx index 93c591d01bf..9e6d39e7631 100644 --- a/superset-frontend/src/explore/components/ControlPanelsContainer.tsx +++ b/superset-frontend/src/explore/components/ControlPanelsContainer.tsx @@ -66,7 +66,7 @@ import { getSectionsToRender } from 'src/explore/controlUtils'; import { ExploreActions } from 'src/explore/actions/exploreActions'; import { ChartState, ExplorePageState } from 'src/explore/types'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import ControlRow from './ControlRow'; import Control from './Control'; import { ExploreAlert } from './ExploreAlert'; diff --git a/superset-frontend/src/explore/components/DataTableControl/index.tsx b/superset-frontend/src/explore/components/DataTableControl/index.tsx index 548b9d0740c..93d9439d74d 100644 --- a/superset-frontend/src/explore/components/DataTableControl/index.tsx +++ b/superset-frontend/src/explore/components/DataTableControl/index.tsx @@ -37,7 +37,7 @@ import { SLOW_DEBOUNCE, } from 'src/constants'; import { Radio } from 'src/components/Radio'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Button from 'src/components/Button'; import Popover from 'src/components/Popover'; import { prepareCopyToClipboardTabularData } from 'src/utils/common'; diff --git a/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx b/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx index 4dc318016c8..757db39dd58 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx @@ -24,7 +24,7 @@ import { t, useTheme, } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Tabs from 'src/components/Tabs'; import { getItem, diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx index 9b915994b2f..05bd1addedc 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx @@ -25,7 +25,7 @@ import { StyledColumnOption, StyledMetricOption, } from 'src/explore/components/optionRenderers'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { DatasourcePanelDndItem } from '../types'; diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx index cabc5f6593d..b7f7cf9dac4 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx @@ -20,7 +20,7 @@ import { CSSProperties, FC } from 'react'; import { css, Metric, styled, t, useTheme } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import DatasourcePanelDragOption from './DatasourcePanelDragOption'; import { DndItemType } from '../DndItemType'; import { DndItemValue } from './types'; diff --git a/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx b/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx index 52a6c94ab38..6f953c80f31 100644 --- a/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx +++ b/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx @@ -25,7 +25,7 @@ import { css, logging, SupersetClient, t, useTheme } from '@superset-ui/core'; import { chartPropShape } from 'src/dashboard/util/propShapes'; import AlteredSliceTag from 'src/components/AlteredSliceTag'; import Button from 'src/components/Button'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import PropertiesModal from 'src/explore/components/PropertiesModal'; import { sliceUpdated } from 'src/explore/actions/exploreActions'; import { PageHeaderWithActions } from 'src/components/PageHeaderWithActions'; diff --git a/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx b/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx index bcae4f8ac26..b69dda66759 100644 --- a/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx +++ b/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx @@ -36,7 +36,7 @@ import { Resizable } from 're-resizable'; import { usePluginContext } from 'src/components/DynamicPlugins'; import { Global } from '@emotion/react'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { getItem, setItem, diff --git a/superset-frontend/src/explore/components/ExportToCSVDropdown/index.tsx b/superset-frontend/src/explore/components/ExportToCSVDropdown/index.tsx index e53f1b3aab8..ad28f29c40f 100644 --- a/superset-frontend/src/explore/components/ExportToCSVDropdown/index.tsx +++ b/superset-frontend/src/explore/components/ExportToCSVDropdown/index.tsx @@ -19,7 +19,7 @@ import { ReactChild, useCallback, Key } from 'react'; import { t, styled } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Dropdown } from 'src/components/Dropdown'; import { Menu } from 'src/components/Menu'; diff --git a/superset-frontend/src/explore/components/PropertiesModal/index.tsx b/superset-frontend/src/explore/components/PropertiesModal/index.tsx index 3b62e432b8c..422ecc82575 100644 --- a/superset-frontend/src/explore/components/PropertiesModal/index.tsx +++ b/superset-frontend/src/explore/components/PropertiesModal/index.tsx @@ -36,7 +36,7 @@ import { useTheme, css, } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Chart, { Slice } from 'src/types/Chart'; import withToasts from 'src/components/MessageToasts/withToasts'; import { loadTags } from 'src/components/Tags/utils'; diff --git a/superset-frontend/src/explore/components/RunQueryButton/index.tsx b/superset-frontend/src/explore/components/RunQueryButton/index.tsx index b63987ea5d3..ce6ecc65e28 100644 --- a/superset-frontend/src/explore/components/RunQueryButton/index.tsx +++ b/superset-frontend/src/explore/components/RunQueryButton/index.tsx @@ -20,7 +20,7 @@ import { ReactNode } from 'react'; import { t, useTheme } from '@superset-ui/core'; import Button from 'src/components/Button'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; export type RunQueryButtonProps = { loading: boolean; diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx index da146a2643d..32dbf4d1217 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx @@ -37,7 +37,7 @@ import CustomListItem from 'src/explore/components/controls/CustomListItem'; import { ChartState, ExplorePageState } from 'src/explore/types'; import { AnyAction } from 'redux'; import { ThunkDispatch } from 'redux-thunk'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import ControlPopover, { getSectionContainerElement, } from '../ControlPopover/ControlPopover'; diff --git a/superset-frontend/src/explore/components/controls/CollectionControl/index.jsx b/superset-frontend/src/explore/components/controls/CollectionControl/index.jsx index 8cb6a0bb39b..9228f56eae9 100644 --- a/superset-frontend/src/explore/components/controls/CollectionControl/index.jsx +++ b/superset-frontend/src/explore/components/controls/CollectionControl/index.jsx @@ -27,7 +27,7 @@ import { SortableElement, arrayMove, } from 'react-sortable-hoc'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { HeaderContainer, AddIconButton, diff --git a/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx b/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx index c87031c7e7d..cfee7d12900 100644 --- a/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx @@ -33,7 +33,7 @@ import AntdSelect from 'antd/lib/select'; // TODO: Remove antd import { sortBy } from 'lodash'; import ControlHeader from 'src/explore/components/ControlHeader'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { SelectOptionsType } from 'src/components/Select/types'; import { StyledSelect } from 'src/components/Select/styles'; import { handleFilterOptionHelper } from 'src/components/Select/utils'; diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx index fbe7da65447..ea58e4777d8 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx @@ -24,7 +24,7 @@ import { D3_TIME_FORMAT_DOCS, D3_TIME_FORMAT_OPTIONS, } from '@superset-ui/chart-controls'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { ColumnConfigFormLayout } from './types'; export type SharedColumnConfigProp = diff --git a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx index 41aac850893..650a113312f 100644 --- a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx +++ b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx @@ -19,7 +19,7 @@ import { useEffect, useState } from 'react'; import { styled, css, t, useTheme } from '@superset-ui/core'; import { Comparator } from '@superset-ui/chart-controls'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import ControlHeader from 'src/explore/components/ControlHeader'; import { FormattingPopover } from './FormattingPopover'; import { diff --git a/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx b/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx index 09232e720de..4c8647b33b3 100644 --- a/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx +++ b/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx @@ -33,7 +33,7 @@ import { getUrlParam } from 'src/utils/urlUtils'; import { Dropdown } from 'src/components/Dropdown'; import { Menu } from 'src/components/Menu'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { ChangeDatasourceModal, DatasourceModal, diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx index 187ae89927f..6a102f208bf 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx @@ -31,7 +31,7 @@ import Button from 'src/components/Button'; import ControlHeader from 'src/explore/components/ControlHeader'; import Modal from 'src/components/Modal'; import { Divider } from 'src/components/Divider'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Select from 'src/components/Select/Select'; import { Tooltip } from 'src/components/Tooltip'; import { useDebouncedEffect } from 'src/explore/exploreUtils'; diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateLabel.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateLabel.tsx index 4d4b2b4561b..a096f850ad1 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateLabel.tsx @@ -20,7 +20,7 @@ import { forwardRef, MouseEvent, ReactNode, RefObject } from 'react'; import { css, styled, t } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; export type DateLabelProps = { name?: string; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectPopoverTitle.jsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectPopoverTitle.jsx index 39d307e3e3a..59c44e20257 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectPopoverTitle.jsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectPopoverTitle.jsx @@ -20,7 +20,7 @@ import { useCallback, useState } from 'react'; import { t, styled, useTheme } from '@superset-ui/core'; import { Input } from 'src/components/Input'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; const StyledInput = styled(Input)` border-radius: ${({ theme }) => theme.borderRadius}; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx index 0cdbbfa7a67..80c8b4362b8 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx @@ -29,7 +29,7 @@ import { DatasourcePanelDndItem, DndItemValue, } from 'src/explore/components/DatasourcePanel/types'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { DndItemType } from '../../DndItemType'; import { DraggingContext, DropzoneContext } from '../../ExploreContainer'; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx index 5b34cb8ef76..41d66a159b5 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx @@ -18,7 +18,7 @@ */ import { useCallback } from 'react'; import { css, styled, t, useTheme } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { CaretContainer, CloseContainer, diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx index 0d200603b2d..f12403b0d66 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx @@ -42,7 +42,7 @@ import { HeaderContainer, LabelsContainer, } from 'src/explore/components/controls/OptionControls'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Modal from 'src/components/Modal'; import AdhocFilterPopoverTrigger from 'src/explore/components/controls/FilterControl/AdhocFilterPopoverTrigger'; import AdhocFilterOption from 'src/explore/components/controls/FilterControl/AdhocFilterOption'; diff --git a/superset-frontend/src/explore/components/controls/FixedOrMetricControl/FixedOrMetricControl.test.tsx b/superset-frontend/src/explore/components/controls/FixedOrMetricControl/FixedOrMetricControl.test.tsx index 4ba35939d36..ccf627808f2 100644 --- a/superset-frontend/src/explore/components/controls/FixedOrMetricControl/FixedOrMetricControl.test.tsx +++ b/superset-frontend/src/explore/components/controls/FixedOrMetricControl/FixedOrMetricControl.test.tsx @@ -20,7 +20,7 @@ import { render, screen, userEvent } from 'spec/helpers/testing-library'; import FixedOrMetricControl from '.'; jest.mock( - 'src/components/Icons/Icon', + 'src/components/Icons/AsyncIcon', () => ({ fileName }: { fileName: string }) => ( diff --git a/superset-frontend/src/explore/components/controls/LayerConfigsControl/FlatLayerTree.tsx b/superset-frontend/src/explore/components/controls/LayerConfigsControl/FlatLayerTree.tsx index 3e8335821cd..95dc5055ca0 100644 --- a/superset-frontend/src/explore/components/controls/LayerConfigsControl/FlatLayerTree.tsx +++ b/superset-frontend/src/explore/components/controls/LayerConfigsControl/FlatLayerTree.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { css, styled, t } from '@superset-ui/core'; // eslint-disable-next-line no-restricted-imports import { Button, Tree } from 'antd'; // TODO: Remove antd diff --git a/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerTreeItem.tsx b/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerTreeItem.tsx index a92cc98fe37..4fcbf0ec069 100644 --- a/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerTreeItem.tsx +++ b/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerTreeItem.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; // eslint-disable-next-line no-restricted-imports import { Button, Tag } from 'antd'; // TODO: Remove antd import { FC } from 'react'; diff --git a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle.tsx b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle.tsx index ec1d3aa8dae..0777072641e 100644 --- a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle.tsx +++ b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle.tsx @@ -28,7 +28,7 @@ import { import { t, styled, useTheme } from '@superset-ui/core'; import { Input } from 'src/components/Input'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; const TitleLabel = styled.span` display: inline-block; diff --git a/superset-frontend/src/explore/components/controls/MetricControl/MetricsControl.jsx b/superset-frontend/src/explore/components/controls/MetricControl/MetricsControl.jsx index 0376be5e6dc..b94f790e32d 100644 --- a/superset-frontend/src/explore/components/controls/MetricControl/MetricsControl.jsx +++ b/superset-frontend/src/explore/components/controls/MetricControl/MetricsControl.jsx @@ -21,7 +21,7 @@ import PropTypes from 'prop-types'; import { ensureIsArray, t, useTheme, usePrevious } from '@superset-ui/core'; import { isEqual } from 'lodash'; import ControlHeader from 'src/explore/components/ControlHeader'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { AddIconButton, AddControlLabel, diff --git a/superset-frontend/src/explore/components/controls/OptionControls/index.tsx b/superset-frontend/src/explore/components/controls/OptionControls/index.tsx index 526ae0b56e9..da4df26f582 100644 --- a/superset-frontend/src/explore/components/controls/OptionControls/index.tsx +++ b/superset-frontend/src/explore/components/controls/OptionControls/index.tsx @@ -22,7 +22,7 @@ import { useDrag, useDrop, DropTargetMonitor } from 'react-dnd'; import { styled, t, useTheme, keyframes, css } from '@superset-ui/core'; import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { savedMetricType } from 'src/explore/components/controls/MetricControl/types'; import AdhocMetric from 'src/explore/components/controls/MetricControl/AdhocMetric'; import { StyledMetricOption } from '../../optionRenderers'; diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/FastVizSwitcher.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/FastVizSwitcher.tsx index edbe90284b1..597dfb2e9d6 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/FastVizSwitcher.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/FastVizSwitcher.tsx @@ -19,7 +19,7 @@ import { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; import { css, SupersetTheme } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { getChartKey } from 'src/explore/exploreUtils'; import { ExplorePageState } from 'src/explore/types'; import { FastVizSwitcherProps } from './types'; diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx index f427bc9f038..9f02cc28f26 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx @@ -121,7 +121,7 @@ describe('VizTypeControl', () => { }; await waitForRenderWrapper(props); expect(screen.getByLabelText('table')).toBeVisible(); - expect(screen.getByLabelText('big-number-chart-tile')).toBeVisible(); + expect(screen.getByLabelText('big-number_chart_tile')).toBeVisible(); expect(screen.getByLabelText('pie-chart')).toBeVisible(); expect(screen.getByLabelText('bar-chart')).toBeVisible(); expect(screen.getByLabelText('area-chart')).toBeVisible(); diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx index 25cdebf0a96..f39985086e3 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx @@ -44,7 +44,7 @@ import { Tooltip } from 'src/components/Tooltip'; import { Input } from 'src/components/Input'; import Label from 'src/components/Label'; import { usePluginContext } from 'src/components/DynamicPlugins'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { nativeFilterGate } from 'src/dashboard/components/nativeFilters/utils'; import scrollIntoView from 'scroll-into-view-if-needed'; diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/constants.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/constants.tsx index 1d7b0206b8b..c57513ab4d0 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/constants.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/constants.tsx @@ -17,7 +17,7 @@ * under the License. */ import { VizType } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { VizMeta } from './types'; export const FEATURED_CHARTS: VizMeta[] = [ diff --git a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/DashboardsSubMenu.tsx b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/DashboardsSubMenu.tsx index cf2fe1f46d3..b6ab5e5b7f1 100644 --- a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/DashboardsSubMenu.tsx +++ b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/DashboardsSubMenu.tsx @@ -19,7 +19,7 @@ import { useState } from 'react'; import { css, t, useTheme } from '@superset-ui/core'; import { Input } from 'src/components/Input'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Menu } from 'src/components/Menu'; import { Link } from 'react-router-dom'; diff --git a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx index b67dbc40c5e..43a45693af1 100644 --- a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx +++ b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx @@ -27,7 +27,7 @@ import { useTheme, VizType, } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Menu } from 'src/components/Menu'; import ModalTrigger from 'src/components/ModalTrigger'; import Button from 'src/components/Button'; diff --git a/superset-frontend/src/features/alerts/AlertReportModal.tsx b/superset-frontend/src/features/alerts/AlertReportModal.tsx index dc224a1f960..3970fcd900c 100644 --- a/superset-frontend/src/features/alerts/AlertReportModal.tsx +++ b/superset-frontend/src/features/alerts/AlertReportModal.tsx @@ -71,7 +71,7 @@ import { } from 'src/features/alerts/types'; import { useSelector } from 'react-redux'; import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import NumberInput from './components/NumberInput'; import { AlertReportCronScheduler } from './components/AlertReportCronScheduler'; import { NotificationMethod } from './components/NotificationMethod'; diff --git a/superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx b/superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx index 2d9e5aca6fa..969c8374b62 100644 --- a/superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx +++ b/superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx @@ -18,7 +18,7 @@ */ import { t, SupersetTheme, useTheme } from '@superset-ui/core'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { AlertState } from '../types'; function getStatusColor( diff --git a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx index ac18ceb47ba..c2a90e464e1 100644 --- a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx +++ b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx @@ -35,7 +35,7 @@ import { useTheme, } from '@superset-ui/core'; import { Select } from 'src/components'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import RefreshLabel from 'src/components/RefreshLabel'; import { NotificationMethodOption, diff --git a/superset-frontend/src/features/alerts/components/RecipientIcon.tsx b/superset-frontend/src/features/alerts/components/RecipientIcon.tsx index bc28bbabcbb..7d3e8ad07d9 100644 --- a/superset-frontend/src/features/alerts/components/RecipientIcon.tsx +++ b/superset-frontend/src/features/alerts/components/RecipientIcon.tsx @@ -19,7 +19,7 @@ import { SupersetTheme, css } from '@superset-ui/core'; import { ReactElement } from 'react'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { NotificationMethodOption } from '../types'; const notificationStyledIcon = (theme: SupersetTheme) => css` diff --git a/superset-frontend/src/features/alerts/components/ValidatedPanelHeader.tsx b/superset-frontend/src/features/alerts/components/ValidatedPanelHeader.tsx index 611161bc541..46411bbc3fa 100644 --- a/superset-frontend/src/features/alerts/components/ValidatedPanelHeader.tsx +++ b/superset-frontend/src/features/alerts/components/ValidatedPanelHeader.tsx @@ -17,7 +17,7 @@ * under the License. */ import { t, useTheme } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; const ValidatedPanelHeader = ({ title, diff --git a/superset-frontend/src/features/annotationLayers/AnnotationLayerModal.tsx b/superset-frontend/src/features/annotationLayers/AnnotationLayerModal.tsx index 816a0960d18..21f072b5be7 100644 --- a/superset-frontend/src/features/annotationLayers/AnnotationLayerModal.tsx +++ b/superset-frontend/src/features/annotationLayers/AnnotationLayerModal.tsx @@ -21,7 +21,7 @@ import { FunctionComponent, useState, useEffect, ChangeEvent } from 'react'; import { css, styled, t, useTheme } from '@superset-ui/core'; import { useSingleViewResource } from 'src/views/CRUD/hooks'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Modal from 'src/components/Modal'; import withToasts from 'src/components/MessageToasts/withToasts'; diff --git a/superset-frontend/src/features/annotations/AnnotationModal.tsx b/superset-frontend/src/features/annotations/AnnotationModal.tsx index 9b970e2d858..11b49581d92 100644 --- a/superset-frontend/src/features/annotations/AnnotationModal.tsx +++ b/superset-frontend/src/features/annotations/AnnotationModal.tsx @@ -22,7 +22,7 @@ import { css, styled, t, useTheme } from '@superset-ui/core'; import { useSingleViewResource } from 'src/views/CRUD/hooks'; import { RangePicker } from 'src/components/DatePicker'; import { extendedDayjs } from 'src/utils/dates'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Modal from 'src/components/Modal'; import withToasts from 'src/components/MessageToasts/withToasts'; import { JsonEditor } from 'src/components/AsyncAceEditor'; diff --git a/superset-frontend/src/features/charts/ChartCard.tsx b/superset-frontend/src/features/charts/ChartCard.tsx index a168391c5f4..aad15415d32 100644 --- a/superset-frontend/src/features/charts/ChartCard.tsx +++ b/superset-frontend/src/features/charts/ChartCard.tsx @@ -19,7 +19,7 @@ import { isFeatureEnabled, FeatureFlag, t, css } from '@superset-ui/core'; import { Link, useHistory } from 'react-router-dom'; import ConfirmStatusChange from 'src/components/ConfirmStatusChange'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Chart from 'src/types/Chart'; import ListViewCard from 'src/components/ListViewCard'; diff --git a/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx b/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx index a8da4bf18d3..026438c90e6 100644 --- a/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx +++ b/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx @@ -21,7 +21,7 @@ import { FunctionComponent, useState, useEffect, ChangeEvent } from 'react'; import { css, styled, t, useTheme } from '@superset-ui/core'; import { useSingleViewResource } from 'src/views/CRUD/hooks'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Modal from 'src/components/Modal'; import withToasts from 'src/components/MessageToasts/withToasts'; import { CssEditor } from 'src/components/AsyncAceEditor'; diff --git a/superset-frontend/src/features/dashboards/DashboardCard.tsx b/superset-frontend/src/features/dashboards/DashboardCard.tsx index f3b586b2694..6697d03dead 100644 --- a/superset-frontend/src/features/dashboards/DashboardCard.tsx +++ b/superset-frontend/src/features/dashboards/DashboardCard.tsx @@ -28,7 +28,7 @@ import { CardStyles } from 'src/views/CRUD/utils'; import { Dropdown } from 'src/components/Dropdown'; import { Menu } from 'src/components/Menu'; import ListViewCard from 'src/components/ListViewCard'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { PublishedLabel } from 'src/components/Label'; import FacePile from 'src/components/FacePile'; import FaveStar from 'src/components/FaveStar'; diff --git a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx index 93b9ce7cb3d..c10859993a2 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx @@ -20,7 +20,7 @@ import { useRef, useState } from 'react'; import { SupersetTheme, t } from '@superset-ui/core'; import { Button, AntdSelect } from 'src/components'; import FormLabel from 'src/components/Form/FormLabel'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { DatabaseParameters, FieldPropTypes } from '../../types'; import { infoTooltip, CredentialInfoForm } from '../styles'; diff --git a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/TableCatalog.tsx b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/TableCatalog.tsx index 91b6a63c0bc..cb300543647 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/TableCatalog.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/TableCatalog.tsx @@ -19,7 +19,7 @@ import { css, SupersetTheme, t } from '@superset-ui/core'; import ValidatedInput from 'src/components/Form/LabeledErrorBoundInput'; import FormLabel from 'src/components/Form/FormLabel'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { StyledFooterButton, StyledCatalogTable } from '../styles'; import { CatalogObject, FieldPropTypes } from '../../types'; diff --git a/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx b/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx index 44e62c78671..7feb06aaf9a 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx @@ -24,7 +24,7 @@ import { Radio } from 'src/components/Radio'; import { Input, TextArea } from 'src/components/Input'; // eslint-disable-next-line no-restricted-imports import { Input as AntdInput, Tooltip } from 'antd'; // TODO: Remove antd -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { DatabaseObject, FieldPropTypes } from '../types'; import { AuthType } from '.'; diff --git a/superset-frontend/src/features/databases/DatabaseModal/index.tsx b/superset-frontend/src/features/databases/DatabaseModal/index.tsx index 61c087c72be..c13fa504a3a 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/index.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/index.tsx @@ -51,7 +51,7 @@ import withToasts from 'src/components/MessageToasts/withToasts'; import ValidatedInput from 'src/components/Form/LabeledErrorBoundInput'; import ErrorMessageWithStackTrace from 'src/components/ErrorMessage/ErrorMessageWithStackTrace'; import ErrorAlert from 'src/components/ImportModal/ErrorAlert'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { testDatabaseConnection, useSingleViewResource, diff --git a/superset-frontend/src/features/databases/UploadDataModel/index.tsx b/superset-frontend/src/features/databases/UploadDataModel/index.tsx index 39dd14f82d4..55681b5c1b8 100644 --- a/superset-frontend/src/features/databases/UploadDataModel/index.tsx +++ b/superset-frontend/src/features/databases/UploadDataModel/index.tsx @@ -43,7 +43,7 @@ import { Select, Upload, } from 'src/components'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Input, InputNumber } from 'src/components/Input'; import rison from 'rison'; // eslint-disable-next-line no-restricted-imports diff --git a/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.test.tsx b/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.test.tsx index 7e5376fcfd6..8e553632761 100644 --- a/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.test.tsx +++ b/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.test.tsx @@ -36,7 +36,7 @@ import { } from './MessageContent'; jest.mock( - 'src/components/Icons/Icon', + 'src/components/Icons/AsyncIcon', () => ({ fileName }: { fileName: string }) => ( diff --git a/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx b/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx index 45d7d8dea73..2a0429e80f4 100644 --- a/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx +++ b/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx @@ -17,7 +17,7 @@ * under the License. */ import { t, styled } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Alert from 'src/components/Alert'; import Table, { ColumnsType, TableSize } from 'src/components/Table'; // @ts-ignore diff --git a/superset-frontend/src/features/datasets/AddDataset/EditDataset/UsageTab/index.tsx b/superset-frontend/src/features/datasets/AddDataset/EditDataset/UsageTab/index.tsx index 9b5d59caefc..80a56e0e690 100644 --- a/superset-frontend/src/features/datasets/AddDataset/EditDataset/UsageTab/index.tsx +++ b/superset-frontend/src/features/datasets/AddDataset/EditDataset/UsageTab/index.tsx @@ -34,7 +34,7 @@ import Table, { } from 'src/components/Table'; import { EmptyState } from 'src/components/EmptyState'; import ChartImage from 'src/assets/images/chart.svg'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { useToasts } from 'src/components/MessageToasts/withToasts'; import { useListViewResource } from 'src/views/CRUD/hooks'; import { FilterOperator } from 'src/components/ListView'; diff --git a/superset-frontend/src/features/datasets/AddDataset/Header/index.tsx b/superset-frontend/src/features/datasets/AddDataset/Header/index.tsx index b2f8f475aa5..60fc8a22a6c 100644 --- a/superset-frontend/src/features/datasets/AddDataset/Header/index.tsx +++ b/superset-frontend/src/features/datasets/AddDataset/Header/index.tsx @@ -20,7 +20,7 @@ import { Dispatch } from 'react'; import { t } from '@superset-ui/core'; import { PageHeaderWithActions } from 'src/components/PageHeaderWithActions'; import Button from 'src/components/Button'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Menu } from 'src/components/Menu'; import { TooltipPlacement } from 'src/components/Tooltip'; import { diff --git a/superset-frontend/src/features/home/ActivityTable.tsx b/superset-frontend/src/features/home/ActivityTable.tsx index 02dbdfea3d8..76e2f89f75c 100644 --- a/superset-frontend/src/features/home/ActivityTable.tsx +++ b/superset-frontend/src/features/home/ActivityTable.tsx @@ -30,7 +30,7 @@ import { getEditedObjects, } from 'src/views/CRUD/utils'; import { Chart } from 'src/types/Chart'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import SubMenu from './SubMenu'; import EmptyState from './EmptyState'; import { WelcomeTable, RecentActivity } from './types'; diff --git a/superset-frontend/src/features/home/ChartTable.tsx b/superset-frontend/src/features/home/ChartTable.tsx index 8642c7edfee..a228ec05b40 100644 --- a/superset-frontend/src/features/home/ChartTable.tsx +++ b/superset-frontend/src/features/home/ChartTable.tsx @@ -44,7 +44,7 @@ import Chart from 'src/types/Chart'; import handleResourceExport from 'src/utils/export'; import Loading from 'src/components/Loading'; import ErrorBoundary from 'src/components/ErrorBoundary'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import EmptyState from './EmptyState'; import { WelcomeTable } from './types'; import SubMenu from './SubMenu'; diff --git a/superset-frontend/src/features/home/DashboardTable.tsx b/superset-frontend/src/features/home/DashboardTable.tsx index 14f110a95fe..0086b9e692c 100644 --- a/superset-frontend/src/features/home/DashboardTable.tsx +++ b/superset-frontend/src/features/home/DashboardTable.tsx @@ -40,7 +40,7 @@ import Loading from 'src/components/Loading'; import DeleteModal from 'src/components/DeleteModal'; import PropertiesModal from 'src/dashboard/components/PropertiesModal'; import DashboardCard from 'src/features/dashboards/DashboardCard'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import EmptyState from './EmptyState'; import SubMenu from './SubMenu'; import { WelcomeTable } from './types'; diff --git a/superset-frontend/src/features/home/LanguagePicker.tsx b/superset-frontend/src/features/home/LanguagePicker.tsx index f0aa635e7ef..c2f9854edaa 100644 --- a/superset-frontend/src/features/home/LanguagePicker.tsx +++ b/superset-frontend/src/features/home/LanguagePicker.tsx @@ -18,7 +18,7 @@ */ import { MainNav as Menu } from 'src/components/Menu'; import { styled, css, useTheme } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; const { SubMenu } = Menu; export interface Languages { diff --git a/superset-frontend/src/features/home/Menu.tsx b/superset-frontend/src/features/home/Menu.tsx index 9ffe856dbec..f9dafcd767e 100644 --- a/superset-frontend/src/features/home/Menu.tsx +++ b/superset-frontend/src/features/home/Menu.tsx @@ -25,7 +25,7 @@ import { MainNav, MenuMode } from 'src/components/Menu'; import { Tooltip } from 'src/components/Tooltip'; import { NavLink, useLocation } from 'react-router-dom'; import { GenericLink } from 'src/components/GenericLink/GenericLink'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { useUiConfig } from 'src/components/UiConfigContext'; import { URL_PARAMS } from 'src/constants'; import { diff --git a/superset-frontend/src/features/home/RightMenu.tsx b/superset-frontend/src/features/home/RightMenu.tsx index d6dfb1270c2..16d66207361 100644 --- a/superset-frontend/src/features/home/RightMenu.tsx +++ b/superset-frontend/src/features/home/RightMenu.tsx @@ -40,7 +40,7 @@ import { } from '@superset-ui/core'; import { Menu } from 'src/components/Menu'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Label from 'src/components/Label'; import { findPermission } from 'src/utils/findPermission'; import { isUserAdmin } from 'src/dashboard/util/permissionUtils'; diff --git a/superset-frontend/src/features/home/SavedQueries.tsx b/superset-frontend/src/features/home/SavedQueries.tsx index 91c1dfd7dbb..fd8da07af5d 100644 --- a/superset-frontend/src/features/home/SavedQueries.tsx +++ b/superset-frontend/src/features/home/SavedQueries.tsx @@ -30,7 +30,7 @@ import { Menu } from 'src/components/Menu'; import { copyQueryLink, useListViewResource } from 'src/views/CRUD/hooks'; import ListViewCard from 'src/components/ListViewCard'; import DeleteModal from 'src/components/DeleteModal'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { User } from 'src/types/bootstrapTypes'; import { CardContainer, diff --git a/superset-frontend/src/features/home/SubMenu.tsx b/superset-frontend/src/features/home/SubMenu.tsx index 223f0d00458..5aeaa02f21b 100644 --- a/superset-frontend/src/features/home/SubMenu.tsx +++ b/superset-frontend/src/features/home/SubMenu.tsx @@ -26,7 +26,7 @@ import { debounce } from 'lodash'; import { Row } from 'src/components'; import { Menu, MenuMode, MainNav } from 'src/components/Menu'; import Button, { OnClickHandler } from 'src/components/Button'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { MenuObjectProps } from 'src/types/bootstrapTypes'; const StyledHeader = styled.div<{ backgroundColor?: string }>` diff --git a/superset-frontend/src/features/queries/SyntaxHighlighterCopy.tsx b/superset-frontend/src/features/queries/SyntaxHighlighterCopy.tsx index b144d71c41f..6a019141c14 100644 --- a/superset-frontend/src/features/queries/SyntaxHighlighterCopy.tsx +++ b/superset-frontend/src/features/queries/SyntaxHighlighterCopy.tsx @@ -24,7 +24,7 @@ import markdownSyntax from 'react-syntax-highlighter/dist/cjs/languages/hljs/mar import jsonSyntax from 'react-syntax-highlighter/dist/cjs/languages/hljs/json'; import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github'; import SyntaxHighlighter from 'react-syntax-highlighter/dist/cjs/light'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { ToastProps } from 'src/components/MessageToasts/withToasts'; import copyTextToClipboard from 'src/utils/copy'; diff --git a/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.tsx b/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.tsx index 4663d04a48b..2bf46ca4cc6 100644 --- a/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.tsx +++ b/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.tsx @@ -29,7 +29,7 @@ import { getExtensionsRegistry, usePrevious, } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Switch } from 'src/components/Switch'; import { AlertObject } from 'src/features/alerts/types'; import { Menu } from 'src/components/Menu'; diff --git a/superset-frontend/src/features/reports/ReportModal/index.tsx b/superset-frontend/src/features/reports/ReportModal/index.tsx index aa84619eba5..2d7e6c85fd9 100644 --- a/superset-frontend/src/features/reports/ReportModal/index.tsx +++ b/superset-frontend/src/features/reports/ReportModal/index.tsx @@ -39,7 +39,7 @@ import { import Alert from 'src/components/Alert'; import TimezoneSelector from 'src/components/TimezoneSelector'; import LabeledErrorBoundInput from 'src/components/Form/LabeledErrorBoundInput'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { CronError } from 'src/components/CronPicker'; import { Radio, RadioChangeEvent } from 'src/components/Radio'; import { Input } from 'src/components/Input'; diff --git a/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx b/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx index 8bf7d9b7936..e0517a4a575 100644 --- a/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx +++ b/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx @@ -20,7 +20,7 @@ import { css, styled, SupersetClient, useTheme, t } from '@superset-ui/core'; import Modal from 'src/components/Modal'; import { useCallback, useEffect, useMemo, useState } from 'react'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import Select from 'src/components/Select/Select'; import { TextArea } from 'src/components/Input'; import AsyncSelect from 'src/components/Select/AsyncSelect'; diff --git a/superset-frontend/src/features/tags/TagCard.tsx b/superset-frontend/src/features/tags/TagCard.tsx index 5ffd3bcd5db..b082b91aebc 100644 --- a/superset-frontend/src/features/tags/TagCard.tsx +++ b/superset-frontend/src/features/tags/TagCard.tsx @@ -23,7 +23,7 @@ import { Dropdown } from 'src/components/Dropdown'; import { Menu } from 'src/components/Menu'; import ConfirmStatusChange from 'src/components/ConfirmStatusChange'; import ListViewCard from 'src/components/ListViewCard'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Tag } from 'src/views/CRUD/types'; import { deleteTags } from 'src/features/tags/tags'; import { Button } from 'src/components'; diff --git a/superset-frontend/src/pages/AlertReportList/index.tsx b/superset-frontend/src/pages/AlertReportList/index.tsx index 34d1e50df61..7ced5692dff 100644 --- a/superset-frontend/src/pages/AlertReportList/index.tsx +++ b/superset-frontend/src/pages/AlertReportList/index.tsx @@ -57,7 +57,7 @@ import AlertReportModal from 'src/features/alerts/AlertReportModal'; import { AlertObject, AlertState } from 'src/features/alerts/types'; import { ModifiedInfo } from 'src/components/AuditInfo'; import { QueryObjectColumns } from 'src/views/CRUD/types'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; const extensionsRegistry = getExtensionsRegistry(); diff --git a/superset-frontend/src/pages/AnnotationLayerList/index.tsx b/superset-frontend/src/pages/AnnotationLayerList/index.tsx index 652dff17632..253d33c0d33 100644 --- a/superset-frontend/src/pages/AnnotationLayerList/index.tsx +++ b/superset-frontend/src/pages/AnnotationLayerList/index.tsx @@ -37,7 +37,7 @@ import AnnotationLayerModal from 'src/features/annotationLayers/AnnotationLayerM import { AnnotationLayerObject } from 'src/features/annotationLayers/types'; import { ModifiedInfo } from 'src/components/AuditInfo'; import { QueryObjectColumns } from 'src/views/CRUD/types'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; const PAGE_SIZE = 25; diff --git a/superset-frontend/src/pages/AnnotationList/index.tsx b/superset-frontend/src/pages/AnnotationList/index.tsx index e3f419860ab..09929fbe6d3 100644 --- a/superset-frontend/src/pages/AnnotationList/index.tsx +++ b/superset-frontend/src/pages/AnnotationList/index.tsx @@ -41,7 +41,7 @@ import { createErrorHandler } from 'src/views/CRUD/utils'; import { AnnotationObject } from 'src/features/annotations/types'; import AnnotationModal from 'src/features/annotations/AnnotationModal'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; const PAGE_SIZE = 25; diff --git a/superset-frontend/src/pages/ChartCreation/index.tsx b/superset-frontend/src/pages/ChartCreation/index.tsx index 6ae872c5e11..557b1e72a6f 100644 --- a/superset-frontend/src/pages/ChartCreation/index.tsx +++ b/superset-frontend/src/pages/ChartCreation/index.tsx @@ -45,7 +45,7 @@ import { Dataset, DatasetSelectLabel, } from 'src/features/datasets/DatasetSelectLabel'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; export interface ChartCreationProps extends RouteComponentProps { user: UserWithPermissionsAndRoles; diff --git a/superset-frontend/src/pages/ChartList/index.tsx b/superset-frontend/src/pages/ChartList/index.tsx index 57f97c0e328..6f1cc9e8c6f 100644 --- a/superset-frontend/src/pages/ChartList/index.tsx +++ b/superset-frontend/src/pages/ChartList/index.tsx @@ -62,7 +62,7 @@ import ImportModelsModal from 'src/components/ImportModal/index'; import Chart from 'src/types/Chart'; import Tag from 'src/types/TagType'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { nativeFilterGate } from 'src/dashboard/components/nativeFilters/utils'; import InfoTooltip from 'src/components/InfoTooltip'; import CertifiedBadge from 'src/components/CertifiedBadge'; diff --git a/superset-frontend/src/pages/CssTemplateList/index.tsx b/superset-frontend/src/pages/CssTemplateList/index.tsx index 506eb380943..1d68cb8545e 100644 --- a/superset-frontend/src/pages/CssTemplateList/index.tsx +++ b/superset-frontend/src/pages/CssTemplateList/index.tsx @@ -37,7 +37,7 @@ import CssTemplateModal from 'src/features/cssTemplates/CssTemplateModal'; import { TemplateObject } from 'src/features/cssTemplates/types'; import { ModifiedInfo } from 'src/components/AuditInfo'; import { QueryObjectColumns } from 'src/views/CRUD/types'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; const PAGE_SIZE = 25; diff --git a/superset-frontend/src/pages/DashboardList/index.tsx b/superset-frontend/src/pages/DashboardList/index.tsx index d79002aa421..94f41bd5875 100644 --- a/superset-frontend/src/pages/DashboardList/index.tsx +++ b/superset-frontend/src/pages/DashboardList/index.tsx @@ -52,7 +52,7 @@ import Owner from 'src/types/Owner'; import Tag from 'src/types/TagType'; import withToasts from 'src/components/MessageToasts/withToasts'; import FacePile from 'src/components/FacePile'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import DeleteModal from 'src/components/DeleteModal'; import FaveStar from 'src/components/FaveStar'; import PropertiesModal from 'src/dashboard/components/PropertiesModal'; diff --git a/superset-frontend/src/pages/DatabaseList/index.tsx b/superset-frontend/src/pages/DatabaseList/index.tsx index afa58da1da6..368465a69da 100644 --- a/superset-frontend/src/pages/DatabaseList/index.tsx +++ b/superset-frontend/src/pages/DatabaseList/index.tsx @@ -42,7 +42,7 @@ import DeleteModal from 'src/components/DeleteModal'; import { getUrlParam } from 'src/utils/urlUtils'; import { URL_PARAMS } from 'src/constants'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { isUserAdmin } from 'src/dashboard/util/permissionUtils'; import ListView, { FilterOperator, Filters } from 'src/components/ListView'; import handleResourceExport from 'src/utils/export'; diff --git a/superset-frontend/src/pages/DatasetList/index.tsx b/superset-frontend/src/pages/DatasetList/index.tsx index 69b7880600a..8909b426bf7 100644 --- a/superset-frontend/src/pages/DatasetList/index.tsx +++ b/superset-frontend/src/pages/DatasetList/index.tsx @@ -49,7 +49,7 @@ import SubMenu, { SubMenuProps, ButtonProps } from 'src/features/home/SubMenu'; import Owner from 'src/types/Owner'; import withToasts from 'src/components/MessageToasts/withToasts'; import { Tooltip } from 'src/components/Tooltip'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import FacePile from 'src/components/FacePile'; import CertifiedBadge from 'src/components/CertifiedBadge'; import InfoTooltip from 'src/components/InfoTooltip'; diff --git a/superset-frontend/src/pages/QueryHistoryList/index.tsx b/superset-frontend/src/pages/QueryHistoryList/index.tsx index 1dfa49991e3..a3996c5ba02 100644 --- a/superset-frontend/src/pages/QueryHistoryList/index.tsx +++ b/superset-frontend/src/pages/QueryHistoryList/index.tsx @@ -50,7 +50,7 @@ import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github'; import { DATETIME_WITH_TIME_ZONE, TIME_WITH_MS } from 'src/constants'; import { QueryObject, QueryObjectColumns } from 'src/views/CRUD/types'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import QueryPreviewModal from 'src/features/queries/QueryPreviewModal'; import { addSuccessToast } from 'src/components/MessageToasts/actions'; import getOwnerName from 'src/utils/getOwnerName'; diff --git a/superset-frontend/src/pages/RowLevelSecurityList/index.tsx b/superset-frontend/src/pages/RowLevelSecurityList/index.tsx index c50802ba25c..9a0aa6112be 100644 --- a/superset-frontend/src/pages/RowLevelSecurityList/index.tsx +++ b/superset-frontend/src/pages/RowLevelSecurityList/index.tsx @@ -19,7 +19,7 @@ import { t, styled, SupersetClient, useTheme, css } from '@superset-ui/core'; import { useMemo, useState } from 'react'; import ConfirmStatusChange from 'src/components/ConfirmStatusChange'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import ListView, { FetchDataConfig, FilterOperator, diff --git a/superset-frontend/src/pages/SavedQueryList/index.tsx b/superset-frontend/src/pages/SavedQueryList/index.tsx index bfdc10af0e5..f45d7953e44 100644 --- a/superset-frontend/src/pages/SavedQueryList/index.tsx +++ b/superset-frontend/src/pages/SavedQueryList/index.tsx @@ -57,7 +57,7 @@ import Tag from 'src/types/TagType'; import ImportModelsModal from 'src/components/ImportModal/index'; import { ModifiedInfo } from 'src/components/AuditInfo'; import { loadTags } from 'src/components/Tags/utils'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes'; import SavedQueryPreviewModal from 'src/features/queries/SavedQueryPreviewModal'; import { findPermission } from 'src/utils/findPermission'; diff --git a/superset-frontend/src/pages/Tags/index.tsx b/superset-frontend/src/pages/Tags/index.tsx index b938e1df157..28449182bb8 100644 --- a/superset-frontend/src/pages/Tags/index.tsx +++ b/superset-frontend/src/pages/Tags/index.tsx @@ -39,7 +39,7 @@ import ListView, { } from 'src/components/ListView'; import { dangerouslyGetItemDoNotUse } from 'src/utils/localStorageHelpers'; import withToasts from 'src/components/MessageToasts/withToasts'; -import Icons from 'src/components/Icons'; +import { Icons } from 'src/components/Icons'; import { Tooltip } from 'src/components/Tooltip'; import { Link } from 'react-router-dom'; import { deleteTags } from 'src/features/tags/tags'; diff --git a/superset/async_events/cache_backend.py b/superset/async_events/cache_backend.py index 15887e47ab1..9158e2d119a 100644 --- a/superset/async_events/cache_backend.py +++ b/superset/async_events/cache_backend.py @@ -95,6 +95,11 @@ class RedisCacheBackend(RedisCache): "ssl_cert_reqs": config.get("CACHE_REDIS_SSL_CERT_REQS", "required"), "ssl_ca_certs": config.get("CACHE_REDIS_SSL_CA_CERTS", None), } + + # Handle username separately as it's optional for Redis authentication. + if configured_username := config.get("CACHE_REDIS_USER"): + kwargs["username"] = configured_username + return cls(**kwargs) diff --git a/tests/integration_tests/charts/api_tests.py b/tests/integration_tests/charts/api_tests.py index 5fd27bed0f8..d4e8f01993e 100644 --- a/tests/integration_tests/charts/api_tests.py +++ b/tests/integration_tests/charts/api_tests.py @@ -14,7 +14,6 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Unit tests for Superset""" from io import BytesIO from unittest import mock @@ -24,7 +23,6 @@ from zipfile import is_zipfile, ZipFile import prison import pytest import yaml -from flask import g from flask_babel import lazy_gettext as _ from parameterized import parameterized from sqlalchemy import and_ @@ -63,7 +61,6 @@ from tests.integration_tests.fixtures.importexport import ( dataset_config, dataset_metadata_config, ) -from tests.integration_tests.fixtures.query_context import get_query_context from tests.integration_tests.fixtures.tags import ( create_custom_tags, # noqa: F401 get_filter_params, @@ -80,7 +77,6 @@ from tests.integration_tests.insert_chart_mixin import InsertChartMixin from tests.integration_tests.test_app import app from tests.integration_tests.utils.get_dashboards import get_dashboards_ids -CHART_DATA_URI = "api/v1/chart/data" CHARTS_FIXTURE_COUNT = 10 @@ -2330,57 +2326,3 @@ class TestChartApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCase): security_manager.add_permission_role(alpha_role, write_tags_perm) security_manager.add_permission_role(alpha_role, tag_charts_perm) - - @patch("superset.security.manager.SupersetSecurityManager.has_guest_access") - @patch("superset.security.manager.SupersetSecurityManager.is_guest_user") - @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") - def test_get_chart_data_as_guest_user( - self, is_guest_user, has_guest_access - ): # get_guest_rls_filters - """ - Chart API: Test create simple chart - """ - self.login(ADMIN_USERNAME) - g.user.rls = [] - is_guest_user.return_value = True - has_guest_access.return_value = True - - with mock.patch.object(Slice, "get_query_context") as mock_get_query_context: - mock_get_query_context.return_value = get_query_context("birth_names") - rv = self.client.post( - "api/v1/chart/data", # noqa: F541 - json={ - "datasource": {"id": 2, "type": "table"}, - "queries": [ - { - "extras": {"where": "", "time_grain_sqla": "P1D"}, - "columns": ["name"], - "metrics": [{"label": "sum__num"}], - "orderby": [("sum__num", False)], - "row_limit": 100, - "granularity": "ds", - "time_range": "100 years ago : now", - "timeseries_limit": 0, - "timeseries_limit_metric": None, - "order_desc": True, - "filters": [ - {"col": "gender", "op": "==", "val": "boy"}, - {"col": "num", "op": "IS NOT NULL"}, - { - "col": "name", - "op": "NOT IN", - "val": ["", '"abc"'], - }, - ], - "having": "", - "where": "", - } - ], - "result_format": "json", - "result_type": "full", - }, - ) - data = json.loads(rv.data.decode("utf-8")) - result = data["result"] - excluded_key = "query" - assert all([excluded_key not in query for query in result]) # noqa: C419 diff --git a/tests/integration_tests/charts/data/api_tests.py b/tests/integration_tests/charts/data/api_tests.py index dd9480c124e..fa5e7b44ba2 100644 --- a/tests/integration_tests/charts/data/api_tests.py +++ b/tests/integration_tests/charts/data/api_tests.py @@ -14,25 +14,45 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -# isort:skip_file -"""Unit tests for Superset""" -import unittest import copy +import time +import unittest from datetime import datetime from io import BytesIO -import time from typing import Any, Optional from unittest import mock from zipfile import ZipFile -from flask import Response +import pytest +from flask import g, Response from flask.ctx import AppContext -from tests.integration_tests.conftest import with_feature_flags + from superset.charts.data.api import ChartDataRestApi +from superset.commands.chart.data.get_data_command import ChartDataCommand +from superset.common.chart_data import ChartDataResultFormat, ChartDataResultType +from superset.connectors.sqla.models import SqlaTable, TableColumn +from superset.errors import SupersetErrorType +from superset.extensions import async_query_manager_factory, db +from superset.models.annotations import AnnotationLayer +from superset.models.slice import Slice from superset.models.sql_lab import Query +from superset.superset_typing import AdhocColumn +from superset.utils import json +from superset.utils.core import ( + AdhocMetricExpressionType, + AnnotationType, + backend, + ExtraFiltersReasonType, + get_example_default_schema, +) +from superset.utils.database import get_example_database, get_main_database +from tests.common.query_context_generator import ANNOTATION_LAYERS +from tests.integration_tests.annotation_layers.fixtures import ( + create_annotation_layers, # noqa: F401 +) from tests.integration_tests.base_tests import SupersetTestCase, test_client -from tests.integration_tests.annotation_layers.fixtures import create_annotation_layers # noqa: F401 +from tests.integration_tests.conftest import with_feature_flags from tests.integration_tests.constants import ( ADMIN_USERNAME, GAMMA_NO_CSV_USERNAME, @@ -42,37 +62,13 @@ from tests.integration_tests.fixtures.birth_names_dashboard import ( load_birth_names_dashboard_with_slices, # noqa: F401 load_birth_names_data, # noqa: F401 ) -from tests.integration_tests.test_app import app from tests.integration_tests.fixtures.energy_dashboard import ( - load_energy_table_with_slice, # noqa: F401 load_energy_table_data, # noqa: F401 + load_energy_table_with_slice, # noqa: F401 ) -import pytest -from superset.models.slice import Slice - -from superset.commands.chart.data.get_data_command import ChartDataCommand -from superset.connectors.sqla.models import TableColumn, SqlaTable -from superset.errors import SupersetErrorType -from superset.extensions import async_query_manager_factory, db -from superset.models.annotations import AnnotationLayer -from superset.superset_typing import AdhocColumn -from superset.utils.core import ( - AnnotationType, - backend, - get_example_default_schema, - AdhocMetricExpressionType, - ExtraFiltersReasonType, -) -from superset.utils import json -from superset.utils.database import get_example_database, get_main_database -from superset.common.chart_data import ChartDataResultFormat, ChartDataResultType - -from tests.common.query_context_generator import ANNOTATION_LAYERS from tests.integration_tests.fixtures.query_context import get_query_context - from tests.integration_tests.test_app import app # noqa: F811 - CHART_DATA_URI = "api/v1/chart/data" CHARTS_FIXTURE_COUNT = 10 ADHOC_COLUMN_FIXTURE: AdhocColumn = { @@ -1286,6 +1282,58 @@ class TestGetChartDataApi(BaseTestChartDataApi): } ] + @mock.patch("superset.security.manager.SupersetSecurityManager.has_guest_access") + @mock.patch("superset.security.manager.SupersetSecurityManager.is_guest_user") + @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") + def test_chart_data_as_guest_user(self, is_guest_user, has_guest_access): + """ + Chart data API: Test response does not inlcude the SQL query for embedded + users. + """ + g.user.rls = [] + is_guest_user.return_value = True + has_guest_access.return_value = True + + rv = self.client.post(CHART_DATA_URI, json=self.query_context_payload) + data = json.loads(rv.data.decode("utf-8")) + result = data["result"] + excluded_key = "query" + assert all([excluded_key not in query for query in result]) # noqa: C419 + + def test_chart_data_table_chart_with_time_grain_filter(self): + """ + Chart data API: Test that a table chart that's not using a temporal column can + still receive a time grain filter (for Jinja purposes). + """ + metric_def = { + "aggregate": None, + "column": None, + "datasourceWarning": False, + "expressionType": "SQL", + "hasCustomLabel": True, + "label": "test", + "optionName": "metric_1eef4v0fryc_m7tm09g1hu", + "sqlExpression": "'{{ time_grain }}'", + } + self.query_context_payload["queries"][0]["columns"] = [] + self.query_context_payload["queries"][0]["metrics"] = [metric_def] + self.query_context_payload["queries"][0]["row_limit"] = 1 + self.query_context_payload["queries"][0]["extras"] = { + "where": "", + "having": "", + "time_grain_sqla": "PT5M", + } + self.query_context_payload["queries"][0]["orderby"] = [[metric_def, True]] + del self.query_context_payload["queries"][0]["granularity"] + del self.query_context_payload["queries"][0]["time_range"] + self.query_context_payload["queries"][0]["filters"] = [] + + rv = self.client.post(CHART_DATA_URI, json=self.query_context_payload) + data = json.loads(rv.data.decode("utf-8")) + result = data["result"][0] + assert "PT5M" in result["query"] + assert result["data"] == [{"test": "PT5M"}] + @pytest.fixture def physical_query_context(physical_dataset) -> dict[str, Any]: