This is an automated email from the ASF dual-hosted git repository.

enzomartellucci pushed a commit to branch enxdev/refactor-antd5-icons
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/enxdev/refactor-antd5-icons by 
this push:
     new 4527e1c62b refactor(icons): Replaces custom icons (tags, filter) with 
antd5 icons
4527e1c62b is described below

commit 4527e1c62b873deb35f8fd8aa309bcd454fa4a19
Author: Enzo Martellucci <[email protected]>
AuthorDate: Sun Feb 2 23:48:02 2025 +0100

    refactor(icons): Replaces custom icons (tags, filter) with antd5 icons
---
 .../src/SqlLab/components/ShareSqlLabQuery/index.tsx       |  1 -
 superset-frontend/src/components/Icons/AntdEnhanced.tsx    |  6 ++++++
 superset-frontend/src/components/Icons/index.tsx           |  4 ++--
 .../src/dashboard/components/FiltersBadge/index.tsx        |  2 +-
 .../FilterBar/FilterControls/FilterControls.tsx            |  2 +-
 .../components/nativeFilters/FilterBar/Vertical.tsx        | 10 ++++------
 .../components/nativeFilters/FilterCard/NameRow.tsx        |  3 ++-
 .../nativeFilters/FiltersConfigModal/FilterTitlePane.tsx   |  2 +-
 .../components/controls/DatasourceControl/index.jsx        |  2 +-
 .../explore/components/controls/VizTypeControl/VizTile.tsx | 14 +++++++-------
 .../components/controls/VizTypeControl/VizTypeGallery.tsx  |  2 +-
 .../components/controls/VizTypeControl/constants.tsx       |  2 +-
 .../datasets/AddDataset/DatasetPanel/DatasetPanel.tsx      |  2 +-
 13 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx 
b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx
index af68a4641f..52eac910f2 100644
--- a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx
+++ b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx
@@ -17,7 +17,6 @@
  * under the License.
  */
 import {
-  styled,
   t,
   useTheme,
   getClientErrorObject,
diff --git a/superset-frontend/src/components/Icons/AntdEnhanced.tsx 
b/superset-frontend/src/components/Icons/AntdEnhanced.tsx
index 48df1004ef..e9bf54fb3f 100644
--- a/superset-frontend/src/components/Icons/AntdEnhanced.tsx
+++ b/superset-frontend/src/components/Icons/AntdEnhanced.tsx
@@ -78,6 +78,9 @@ import {
   UserOutlined,
   VerticalLeftOutlined,
   VerticalRightOutlined,
+  NumberOutlined,
+  ThunderboltOutlined,
+  FilterOutlined,
 } from '@ant-design/icons';
 import { StyledIcon } from './Icon';
 import IconType from './IconType';
@@ -142,6 +145,9 @@ const AntdIcons = {
   UserOutlined,
   VerticalLeftOutlined,
   VerticalRightOutlined,
+  NumberOutlined,
+  ThunderboltOutlined,
+  FilterOutlined,
 };
 
 const AntdEnhancedIcons = Object.keys(AntdIcons)
diff --git a/superset-frontend/src/components/Icons/index.tsx 
b/superset-frontend/src/components/Icons/index.tsx
index ffaae91447..090fc587e3 100644
--- a/superset-frontend/src/components/Icons/index.tsx
+++ b/superset-frontend/src/components/Icons/index.tsx
@@ -31,7 +31,6 @@ const IconFileNames = [
   'bar-chart-tile',
   'big-number-chart-tile',
   'binoculars',
-  'bolt',
   'bolt_small',
   'bolt_small_run',
   'calendar',
@@ -153,12 +152,13 @@ const IconFileNames = [
   'warning_solid',
   'x-large',
   'x-small',
-  'tags',
   'ballot',
   'category',
   'undo',
   'redo',
   // to remove
+  'tags',
+  'bolt',
 ];
 
 const iconOverrides: Record<string, FC<IconType>> = {};
diff --git a/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx 
b/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx
index 57413ffd23..5f544d6996 100644
--- a/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx
+++ b/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx
@@ -309,7 +309,7 @@ export const FiltersBadge = ({ chartId }: 
FiltersBadgeProps) => {
         tabIndex={0}
         onKeyDown={handleKeyDown}
       >
-        <Icons.Filter iconSize="m" />
+        <Icons.FilterOutlined iconSize="m" />
         <StyledBadge
           data-test="applied-filter-count"
           className="applied-count"
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 18126b2f99..83f1cbde7b 100644
--- 
a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx
+++ 
b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx
@@ -239,7 +239,7 @@ const FilterControls: FC<FilterControlsProps> = ({
         <DropdownContainer
           items={items}
           dropdownTriggerIcon={
-            <Icons.FilterSmall
+            <Icons.FilterOutlined
               css={css`
                 && {
                   margin-right: -4px;
diff --git 
a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx
 
b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx
index 686320c81c..86332b1de7 100644
--- 
a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx
+++ 
b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx
@@ -30,7 +30,7 @@ import {
   FC,
 } from 'react';
 import cx from 'classnames';
-import { styled, t } from '@superset-ui/core';
+import { styled, t, useTheme } from '@superset-ui/core';
 import Icons from 'src/components/Icons';
 import Loading from 'src/components/Loading';
 import { EmptyState } from 'src/components/EmptyState';
@@ -104,10 +104,6 @@ const StyledCollapseIcon = styled(Icons.Collapse)`
   `}
 `;
 
-const StyledFilterIcon = styled(Icons.Filter)`
-  color: ${({ theme }) => theme.colors.grayscale.base};
-`;
-
 const FilterBarEmptyStateContainer = styled.div`
   margin-top: ${({ theme }) => theme.gridUnit * 8}px;
 `;
@@ -132,6 +128,7 @@ const VerticalFilterBar: FC<VerticalBarProps> = ({
   toggleFiltersBar,
   width,
 }) => {
+  const theme = useTheme();
   const [isScrolling, setIsScrolling] = useState(false);
   const timeout = useRef<any>();
 
@@ -209,7 +206,8 @@ const VerticalFilterBar: FC<VerticalBarProps> = ({
             {...getFilterBarTestId('expand-button')}
             iconSize="l"
           />
-          <StyledFilterIcon
+          <Icons.FilterOutlined
+            iconColor={theme.colors.grayscale.base}
             {...getFilterBarTestId('filter-icon')}
             iconSize="l"
           />
diff --git 
a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx
 
b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx
index 01679b1926..b4834d1898 100644
--- 
a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx
+++ 
b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx
@@ -47,7 +47,8 @@ export const NameRow = ({
       `}
     >
       <InternalRow>
-        <Icons.FilterSmall
+        <Icons.FilterOutlined
+          iconSize="s"
           css={(theme: SupersetTheme) => css`
             margin-right: ${theme.gridUnit}px;
           `}
diff --git 
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx
 
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx
index 0a76a5264f..ce6f32454e 100644
--- 
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx
+++ 
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx
@@ -109,7 +109,7 @@ const FilterTitlePane: FC<Props> = ({
         <Button
           buttonSize="default"
           buttonStyle="secondary"
-          icon={<Icons.Filter iconSize="m" />}
+          icon={<Icons.FilterOutlined iconSize="m" />}
           data-test="add-new-filter-button"
           onClick={() => handleOnAdd(NativeFilterType.NativeFilter)}
         >
diff --git 
a/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx 
b/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx
index 88af3d76ed..dea78d5d41 100644
--- 
a/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx
+++ 
b/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx
@@ -141,7 +141,7 @@ export const datasourceIconLookup = {
   [DatasourceType.Query]: (
     <Icons.ConsoleSqlOutlined className="datasource-svg" />
   ),
-  [DatasourceType.Table]: <Icons.TableOutlined  className="datasource-svg" />,
+  [DatasourceType.Table]: <Icons.TableOutlined className="datasource-svg" />,
 };
 
 // Render title for datasource with tooltip only if text is longer than 
VISIBLE_TITLE_LENGTH
diff --git 
a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTile.tsx 
b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTile.tsx
index 85bf2fd5f0..fca2e657ca 100644
--- 
a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTile.tsx
+++ 
b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTile.tsx
@@ -122,13 +122,13 @@ export const VizTile = ({
           `}
         `}
       >
-        <span 
-        css={
-          css`
-           padding:0px ${theme.gridUnit}px;
-          `
-        }
-        >{vizMeta.icon}</span>
+        <span
+          css={css`
+            padding: 0px ${theme.gridUnit}px;
+          `}
+        >
+          {vizMeta.icon}
+        </span>
         <span
           css={css`
             overflow: hidden;
diff --git 
a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx
 
b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx
index 0dde8da562..66e8b7a2ec 100644
--- 
a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx
+++ 
b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx
@@ -618,7 +618,7 @@ export default function VizTypeGallery(props: 
VizTypeGalleryProps) {
       },
       [Sections.Tags]: {
         title: t('Tags'),
-        icon: <Icons.Tags iconSize="m" />,
+        icon: <Icons.NumberOutlined iconSize="m" />,
         selectors: tags,
       },
     }),
diff --git 
a/superset-frontend/src/explore/components/controls/VizTypeControl/constants.tsx
 
b/superset-frontend/src/explore/components/controls/VizTypeControl/constants.tsx
index 1799b800c5..f42480a97c 100644
--- 
a/superset-frontend/src/explore/components/controls/VizTypeControl/constants.tsx
+++ 
b/superset-frontend/src/explore/components/controls/VizTypeControl/constants.tsx
@@ -30,7 +30,7 @@ export const FEATURED_CHARTS: VizMeta[] = [
     icon: <Icons.BarChartTile />,
   },
   { name: VizType.Area, icon: <Icons.AreaChartTile /> },
-  { name: VizType.Table, icon: <Icons.TableOutlined iconSize='l' /> },
+  { name: VizType.Table, icon: <Icons.TableOutlined iconSize="l" /> },
   {
     name: VizType.BigNumberTotal,
     icon: <Icons.BigNumberChartTile />,
diff --git 
a/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx
 
b/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx
index 69a828037a..b1819f9500 100644
--- 
a/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx
+++ 
b/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx
@@ -334,7 +334,7 @@ const DatasetPanel = ({
             title={tableName || ''}
           >
             {tableName && (
-              <Icons.DatasetPanel iconColor={theme.colors.grayscale.base} />
+              <Icons.TableOutlined iconColor={theme.colors.grayscale.base} />
             )}
             {tableName}
           </StyledHeader>

Reply via email to