You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by en...@apache.org on 2025/01/31 18:53:50 UTC

(superset) branch enxdev/refactor-antd5-icons created (now e1e304b73b)

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

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


      at e1e304b73b replaces custom icons (trash, link) with antd5 icons

This branch includes the following new commits:

     new e1e304b73b replaces custom icons (trash, link) with antd5 icons

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 01/01: replaces custom icons (trash, link) with antd5 icons

Posted by en...@apache.org.
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

commit e1e304b73bb240be8a6f903891aa5a9a1a86b65c
Author: Enzo Martellucci <en...@gmail.com>
AuthorDate: Fri Jan 31 19:53:22 2025 +0100

    replaces custom icons (trash, link) with antd5 icons
---
 .../src/SqlLab/components/QueryTable/index.tsx            |  2 +-
 .../src/SqlLab/components/ShareSqlLabQuery/index.tsx      | 15 ++++-----------
 .../src/components/Datasource/CollectionTable.tsx         |  2 +-
 superset-frontend/src/components/Icons/AntdEnhanced.tsx   |  8 ++++++++
 superset-frontend/src/components/Icons/index.tsx          |  9 ++++-----
 .../src/components/ListViewCard/ListViewCard.stories.tsx  |  2 +-
 .../src/dashboard/components/DeleteComponentButton.tsx    |  7 ++++++-
 .../CrossFilters/ScopingModal/ChartsScopingListPanel.tsx  |  6 ++----
 .../FiltersConfigModal/FilterTitleContainer.tsx           | 10 ++++------
 .../FiltersConfigForm/DependencyList.tsx                  |  2 +-
 .../src/features/alerts/components/NotificationMethod.tsx |  2 +-
 superset-frontend/src/features/charts/ChartCard.tsx       |  2 +-
 .../src/features/dashboards/DashboardCard.tsx             |  2 +-
 superset-frontend/src/features/tags/TagCard.tsx           |  2 +-
 superset-frontend/src/pages/AlertReportList/index.tsx     |  2 +-
 superset-frontend/src/pages/AnnotationLayerList/index.tsx |  2 +-
 superset-frontend/src/pages/AnnotationList/index.tsx      |  2 +-
 superset-frontend/src/pages/ChartList/index.tsx           |  2 +-
 superset-frontend/src/pages/CssTemplateList/index.tsx     |  2 +-
 superset-frontend/src/pages/DashboardList/index.tsx       |  2 +-
 superset-frontend/src/pages/DatabaseList/index.tsx        |  2 +-
 superset-frontend/src/pages/DatasetList/index.tsx         |  2 +-
 .../src/pages/RowLevelSecurityList/index.tsx              |  2 +-
 superset-frontend/src/pages/SavedQueryList/index.tsx      |  2 +-
 superset-frontend/src/pages/Tags/index.tsx                |  2 +-
 25 files changed, 47 insertions(+), 46 deletions(-)

diff --git a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx
index baf0e6f35f..0f56e97fe2 100644
--- a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx
+++ b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx
@@ -358,7 +358,7 @@ const QueryTable = ({
                 onClick={() => dispatch(removeQuery(query))}
                 className="pointer"
               >
-                <Icons.Trash iconSize="xl" />
+                <Icons.DeleteOutlined iconSize="xl" />
               </StyledTooltip>
             )}
           </div>
diff --git a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx
index 988b96b51b..af68a4641f 100644
--- a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx
+++ b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx
@@ -36,16 +36,6 @@ interface ShareSqlLabQueryProps {
   addDangerToast: (msg: string) => void;
 }
 
-const StyledIcon = styled(Icons.Link)`
-  &:first-of-type {
-    margin: 0;
-    display: flex;
-    svg {
-      margin: 0;
-    }
-  }
-`;
-
 const ShareSqlLabQuery = ({
   queryEditorId,
   addDangerToast,
@@ -86,7 +76,10 @@ const ShareSqlLabQuery = ({
     const tooltip = t('Copy query link to your clipboard');
     return (
       <Button buttonSize="small" tooltip={tooltip}>
-        <StyledIcon iconColor={theme.colors.primary.base} iconSize="xl" />
+        <Icons.LinkOutlined
+          iconColor={theme.colors.primary.base}
+          iconSize="xl"
+        />
         {t('Copy link')}
       </Button>
     );
diff --git a/superset-frontend/src/components/Datasource/CollectionTable.tsx b/superset-frontend/src/components/Datasource/CollectionTable.tsx
index 3a6543b408..b904cdebd7 100644
--- a/superset-frontend/src/components/Datasource/CollectionTable.tsx
+++ b/superset-frontend/src/components/Datasource/CollectionTable.tsx
@@ -425,7 +425,7 @@ export default class CRUDCollection extends PureComponent<
           data-test="crud-delete-option"
           className="text-primary"
         >
-          <Icons.Trash
+          <Icons.DeleteOutlined
             aria-label="Delete item"
             className="pointer"
             data-test="crud-delete-icon"
diff --git a/superset-frontend/src/components/Icons/AntdEnhanced.tsx b/superset-frontend/src/components/Icons/AntdEnhanced.tsx
index eadd0ea2ed..48df1004ef 100644
--- a/superset-frontend/src/components/Icons/AntdEnhanced.tsx
+++ b/superset-frontend/src/components/Icons/AntdEnhanced.tsx
@@ -40,6 +40,7 @@ import {
   DashboardOutlined,
   DatabaseOutlined,
   DeleteFilled,
+  DeleteOutlined,
   DownOutlined,
   DownloadOutlined,
   EditOutlined,
@@ -56,6 +57,7 @@ import {
   InfoCircleOutlined,
   InsertRowBelowOutlined,
   LineChartOutlined,
+  LinkOutlined,
   LoadingOutlined,
   MonitorOutlined,
   PicCenterOutlined,
@@ -68,7 +70,9 @@ import {
   SettingOutlined,
   StopOutlined,
   SyncOutlined,
+  TagOutlined,
   TagsOutlined,
+  TableOutlined,
   UnlockOutlined,
   UpOutlined,
   UserOutlined,
@@ -100,6 +104,7 @@ const AntdIcons = {
   DashboardOutlined,
   DatabaseOutlined,
   DeleteFilled,
+  DeleteOutlined,
   DownOutlined,
   DownloadOutlined,
   EditOutlined,
@@ -116,6 +121,7 @@ const AntdIcons = {
   InfoCircleOutlined,
   InsertRowBelowOutlined,
   LineChartOutlined,
+  LinkOutlined,
   LoadingOutlined,
   MonitorOutlined,
   PicCenterOutlined,
@@ -128,7 +134,9 @@ const AntdIcons = {
   SettingOutlined,
   StopOutlined,
   SyncOutlined,
+  TagOutlined,
   TagsOutlined,
+  TableOutlined,
   UnlockOutlined,
   UpOutlined,
   UserOutlined,
diff --git a/superset-frontend/src/components/Icons/index.tsx b/superset-frontend/src/components/Icons/index.tsx
index ee09aceb10..9cd0e3602f 100644
--- a/superset-frontend/src/components/Icons/index.tsx
+++ b/superset-frontend/src/components/Icons/index.tsx
@@ -63,7 +63,6 @@ const IconFileNames = [
   'components',
   'copy',
   'cursor_target',
-  'database',
   'dataset_physical',
   'dataset_virtual_greyscale',
   'dataset_virtual',
@@ -106,7 +105,6 @@ const IconFileNames = [
   'layers',
   'lightbulb',
   'line-chart-tile',
-  'link',
   'list',
   'list_view',
   'location',
@@ -146,10 +144,7 @@ const IconFileNames = [
   'sort_asc',
   'sort_desc',
   'sort',
-  'table',
   'table-chart-tile',
-  'tag',
-  'trash',
   'triangle_change',
   'triangle_down',
   'triangle_up',
@@ -164,6 +159,10 @@ const IconFileNames = [
   'category',
   'undo',
   'redo',
+  // to remove
+  'database',
+  'table',
+  'tag',
 ];
 
 const iconOverrides: Record<string, FC<IconType>> = {};
diff --git a/superset-frontend/src/components/ListViewCard/ListViewCard.stories.tsx b/superset-frontend/src/components/ListViewCard/ListViewCard.stories.tsx
index 38fc7cbe94..5887a555a9 100644
--- a/superset-frontend/src/components/ListViewCard/ListViewCard.stories.tsx
+++ b/superset-frontend/src/components/ListViewCard/ListViewCard.stories.tsx
@@ -74,7 +74,7 @@ export const SupersetListViewCard = ({
           overlay={
             <Menu>
               <Menu.Item role="button" tabIndex={0} onClick={action('Delete')}>
-                <Icons.Trash /> Delete
+                <Icons.DeleteOutlined /> Delete
               </Menu.Item>
               <Menu.Item role="button" tabIndex={0} onClick={action('Edit')}>
                 <Icons.EditAlt /> Edit
diff --git a/superset-frontend/src/dashboard/components/DeleteComponentButton.tsx b/superset-frontend/src/dashboard/components/DeleteComponentButton.tsx
index 87e38c0e34..bc47088059 100644
--- a/superset-frontend/src/dashboard/components/DeleteComponentButton.tsx
+++ b/superset-frontend/src/dashboard/components/DeleteComponentButton.tsx
@@ -27,6 +27,11 @@ type DeleteComponentButtonProps = {
 
 const DeleteComponentButton: FC<DeleteComponentButtonProps> = ({
   onDelete,
-}) => <IconButton onClick={onDelete} icon={<Icons.Trash iconSize="xl" />} />;
+}) => (
+  <IconButton
+    onClick={onDelete}
+    icon={<Icons.DeleteOutlined iconSize="xl" />}
+  />
+);
 
 export default DeleteComponentButton;
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 ad99071f20..bca6e967ae 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
@@ -71,15 +71,13 @@ const ScopingTitle = ({
       onClick={() => onClick(id)}
     >
       {label}
-      <Icons.Trash
+      <Icons.DeleteOutlined
         iconColor={theme.colors.grayscale.light3}
+        iconSize="xl"
         onClick={event => {
           event.stopPropagation();
           onRemove(id);
         }}
-        css={css`
-          margin-left: auto;
-        `}
       />
     </FilterTitle>
   );
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx
index 495009f0d0..d0728b9006 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx
@@ -18,7 +18,7 @@
  */
 import { forwardRef, ReactNode } from 'react';
 
-import { styled, t } from '@superset-ui/core';
+import { styled, t, useTheme } from '@superset-ui/core';
 import Icons from 'src/components/Icons';
 import { FilterRemoval } from './types';
 import DraggableFilter from './DraggableFilter';
@@ -51,10 +51,6 @@ export const FilterTitle = styled.div`
   `}
 `;
 
-const StyledTrashIcon = styled(Icons.Trash)`
-  color: ${({ theme }) => theme.colors.grayscale.light3};
-`;
-
 const StyledWarning = styled(Icons.Warning)`
   color: ${({ theme }) => theme.colors.error.base};
   &.anticon {
@@ -95,6 +91,7 @@ const FilterTitleContainer = forwardRef<HTMLDivElement, Props>(
     ref,
   ) => {
     const renderComponent = (id: string) => {
+      const theme = useTheme();
       const isRemoved = !!removedFilters[id];
       const isErrored = erroredFilters.includes(id);
       const isActive = currentFilterId === id;
@@ -142,7 +139,8 @@ const FilterTitleContainer = forwardRef<HTMLDivElement, Props>(
           </div>
           <div css={{ alignSelf: 'flex-start', marginLeft: 'auto' }}>
             {isRemoved ? null : (
-              <StyledTrashIcon
+              <Icons.DeleteOutlined
+                iconColor={theme.colors.grayscale.light3}
                 onClick={event => {
                   event.stopPropagation();
                   onRemove(id);
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 3fd8291ea1..bb1c61e3aa 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx
@@ -53,7 +53,7 @@ const AddFilter = styled.div`
   `}
 `;
 
-const DeleteFilter = styled(Icons.Trash)`
+const DeleteFilter = styled(Icons.DeleteOutlined)`
   ${({ theme }) => `
     cursor: pointer;
     margin-left: ${theme.gridUnit * 2}px;
diff --git a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx
index 17a78697c9..026764631f 100644
--- a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx
+++ b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx
@@ -447,7 +447,7 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
                 className="delete-button"
                 onClick={() => onRemove(index)}
               >
-                <Icons.Trash iconColor={theme.colors.grayscale.base} />
+                <Icons.DeleteOutlined iconColor={theme.colors.grayscale.base} />
               </span>
             ) : null}
           </div>
diff --git a/superset-frontend/src/features/charts/ChartCard.tsx b/superset-frontend/src/features/charts/ChartCard.tsx
index 9dd18d1a89..909054773b 100644
--- a/superset-frontend/src/features/charts/ChartCard.tsx
+++ b/superset-frontend/src/features/charts/ChartCard.tsx
@@ -100,7 +100,7 @@ export default function ChartCard({
                 className="action-button"
                 onClick={confirmDelete}
               >
-                <Icons.Trash iconSize="l" /> {t('Delete')}
+                <Icons.DeleteOutlined iconSize="l" /> {t('Delete')}
               </div>
             )}
           </ConfirmStatusChange>
diff --git a/superset-frontend/src/features/dashboards/DashboardCard.tsx b/superset-frontend/src/features/dashboards/DashboardCard.tsx
index 2b09233d96..cb9e73dbde 100644
--- a/superset-frontend/src/features/dashboards/DashboardCard.tsx
+++ b/superset-frontend/src/features/dashboards/DashboardCard.tsx
@@ -134,7 +134,7 @@ function DashboardCard({
             onClick={() => onDelete(dashboard)}
             data-test="dashboard-card-option-delete-button"
           >
-            <Icons.Trash iconSize="l" /> {t('Delete')}
+            <Icons.DeleteOutlined iconSize="l" /> {t('Delete')}
           </div>
         </Menu.Item>
       )}
diff --git a/superset-frontend/src/features/tags/TagCard.tsx b/superset-frontend/src/features/tags/TagCard.tsx
index 6b68868695..72195f1eec 100644
--- a/superset-frontend/src/features/tags/TagCard.tsx
+++ b/superset-frontend/src/features/tags/TagCard.tsx
@@ -80,7 +80,7 @@ function TagCard({
                 onClick={confirmDelete}
                 data-test="dashboard-card-option-delete-button"
               >
-                <Icons.Trash iconSize="l" /> {t('Delete')}
+                <Icons.DeleteOutlined iconSize="l" /> {t('Delete')}
               </div>
             )}
           </ConfirmStatusChange>
diff --git a/superset-frontend/src/pages/AlertReportList/index.tsx b/superset-frontend/src/pages/AlertReportList/index.tsx
index f60caf0cf7..01307abf82 100644
--- a/superset-frontend/src/pages/AlertReportList/index.tsx
+++ b/superset-frontend/src/pages/AlertReportList/index.tsx
@@ -389,7 +389,7 @@ function AlertList({
                   label: 'delete-action',
                   tooltip: t('Delete'),
                   placement: 'bottom',
-                  icon: 'Trash',
+                  icon: 'DeleteOutlined',
                   onClick: handleDelete,
                 }
               : null,
diff --git a/superset-frontend/src/pages/AnnotationLayerList/index.tsx b/superset-frontend/src/pages/AnnotationLayerList/index.tsx
index d1f88ba651..a0f6177df5 100644
--- a/superset-frontend/src/pages/AnnotationLayerList/index.tsx
+++ b/superset-frontend/src/pages/AnnotationLayerList/index.tsx
@@ -186,7 +186,7 @@ function AnnotationLayersList({
                   label: 'delete-action',
                   tooltip: t('Delete template'),
                   placement: 'bottom',
-                  icon: 'Trash',
+                  icon: 'DeleteOutlined',
                   onClick: handleDelete,
                 }
               : null,
diff --git a/superset-frontend/src/pages/AnnotationList/index.tsx b/superset-frontend/src/pages/AnnotationList/index.tsx
index 6e4b4169f8..a8258fceda 100644
--- a/superset-frontend/src/pages/AnnotationList/index.tsx
+++ b/superset-frontend/src/pages/AnnotationList/index.tsx
@@ -207,7 +207,7 @@ function AnnotationList({
               label: 'delete-action',
               tooltip: t('Delete annotation'),
               placement: 'bottom',
-              icon: 'Trash',
+              icon: 'DeleteOutlined',
               onClick: handleDelete,
             },
           ];
diff --git a/superset-frontend/src/pages/ChartList/index.tsx b/superset-frontend/src/pages/ChartList/index.tsx
index 031722ab22..30c205aa6f 100644
--- a/superset-frontend/src/pages/ChartList/index.tsx
+++ b/superset-frontend/src/pages/ChartList/index.tsx
@@ -485,7 +485,7 @@ function ChartList(props: ChartListProps) {
                         className="action-button"
                         onClick={confirmDelete}
                       >
-                        <Icons.Trash />
+                        <Icons.DeleteOutlined />
                       </span>
                     </Tooltip>
                   )}
diff --git a/superset-frontend/src/pages/CssTemplateList/index.tsx b/superset-frontend/src/pages/CssTemplateList/index.tsx
index c0948c949e..e097a420b4 100644
--- a/superset-frontend/src/pages/CssTemplateList/index.tsx
+++ b/superset-frontend/src/pages/CssTemplateList/index.tsx
@@ -164,7 +164,7 @@ function CssTemplatesList({
                   label: 'delete-action',
                   tooltip: t('Delete template'),
                   placement: 'bottom',
-                  icon: 'Trash',
+                  icon: 'DeleteOutlined',
                   onClick: handleDelete,
                 }
               : null,
diff --git a/superset-frontend/src/pages/DashboardList/index.tsx b/superset-frontend/src/pages/DashboardList/index.tsx
index 93d2904086..80015022e4 100644
--- a/superset-frontend/src/pages/DashboardList/index.tsx
+++ b/superset-frontend/src/pages/DashboardList/index.tsx
@@ -437,7 +437,7 @@ function DashboardList(props: DashboardListProps) {
                         className="action-button"
                         onClick={confirmDelete}
                       >
-                        <Icons.Trash data-test="dashboard-list-trash-icon" />
+                        <Icons.DeleteOutlined data-test="dashboard-list-trash-icon" />
                       </span>
                     </Tooltip>
                   )}
diff --git a/superset-frontend/src/pages/DatabaseList/index.tsx b/superset-frontend/src/pages/DatabaseList/index.tsx
index 776dbbe817..f96b3fd00e 100644
--- a/superset-frontend/src/pages/DatabaseList/index.tsx
+++ b/superset-frontend/src/pages/DatabaseList/index.tsx
@@ -444,7 +444,7 @@ function DatabaseList({
                     title={t('Delete database')}
                     placement="bottom"
                   >
-                    <Icons.Trash />
+                    <Icons.DeleteOutlined />
                   </Tooltip>
                 </span>
               )}
diff --git a/superset-frontend/src/pages/DatasetList/index.tsx b/superset-frontend/src/pages/DatasetList/index.tsx
index 8173456e97..f670fe1e0d 100644
--- a/superset-frontend/src/pages/DatasetList/index.tsx
+++ b/superset-frontend/src/pages/DatasetList/index.tsx
@@ -421,7 +421,7 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
                     className="action-button"
                     onClick={handleDelete}
                   >
-                    <Icons.Trash />
+                    <Icons.DeleteOutlined />
                   </span>
                 </Tooltip>
               )}
diff --git a/superset-frontend/src/pages/RowLevelSecurityList/index.tsx b/superset-frontend/src/pages/RowLevelSecurityList/index.tsx
index 9d263af14b..c8e51415f4 100644
--- a/superset-frontend/src/pages/RowLevelSecurityList/index.tsx
+++ b/superset-frontend/src/pages/RowLevelSecurityList/index.tsx
@@ -193,7 +193,7 @@ function RowLevelSecurityList(props: RLSProps) {
                         className="action-button"
                         onClick={confirmDelete}
                       >
-                        <Icons.Trash data-test="rls-list-trash-icon" />
+                        <Icons.DeleteOutlined data-test="rls-list-trash-icon" />
                       </span>
                     </Tooltip>
                   )}
diff --git a/superset-frontend/src/pages/SavedQueryList/index.tsx b/superset-frontend/src/pages/SavedQueryList/index.tsx
index 052815f635..83f0fcbc90 100644
--- a/superset-frontend/src/pages/SavedQueryList/index.tsx
+++ b/superset-frontend/src/pages/SavedQueryList/index.tsx
@@ -444,7 +444,7 @@ function SavedQueryList({
               label: 'delete-action',
               tooltip: t('Delete query'),
               placement: 'bottom',
-              icon: 'Trash',
+              icon: 'DeleteOutlined',
               onClick: handleDelete,
             },
           ].filter(item => !!item);
diff --git a/superset-frontend/src/pages/Tags/index.tsx b/superset-frontend/src/pages/Tags/index.tsx
index d7bda00ed4..b50dadfaee 100644
--- a/superset-frontend/src/pages/Tags/index.tsx
+++ b/superset-frontend/src/pages/Tags/index.tsx
@@ -215,7 +215,7 @@ function TagList(props: TagListProps) {
                         className="action-button"
                         onClick={confirmDelete}
                       >
-                        <Icons.Trash data-test="dashboard-list-trash-icon" />
+                        <Icons.DeleteOutlined data-test="dashboard-list-trash-icon" />
                       </span>
                     </Tooltip>
                   )}