refactor(Icons): Replaces custom icons with Ant Design 5 icons (#32112)

Replace custom icons with Ant Design 5 icons to standardize the icon
This commit is contained in:
Enzo Martellucci
2025-03-18 22:22:41 +01:00
committed by GitHub
parent 9e3052968b
commit ce6d5f5551
341 changed files with 2222 additions and 3999 deletions

View File

@@ -102,7 +102,7 @@ describe('DatasourceControl', () => {
expect(
container.querySelector('[data-test="datasource-menu-trigger"]'),
).toBeInTheDocument();
userEvent.click(screen.getByLabelText('more-vert'));
userEvent.click(screen.getByLabelText('more'));
await waitFor(() => {
expect(screen.queryAllByRole('menuitem')).toHaveLength(3);
});
@@ -121,7 +121,7 @@ describe('DatasourceControl', () => {
expect(
container.querySelector('[data-test="datasource-menu-trigger"]'),
).toBeInTheDocument();
userEvent.click(screen.getByLabelText('more-vert'));
userEvent.click(screen.getByLabelText('more'));
await waitFor(() => {
expect(screen.queryAllByRole('menuitem')).toHaveLength(2);
});
@@ -129,7 +129,7 @@ describe('DatasourceControl', () => {
it('should render health check message', async () => {
setup();
const modalTrigger = screen.getByLabelText('alert-solid');
const modalTrigger = screen.getByLabelText('warning');
expect(modalTrigger).toBeInTheDocument();
// Hover the modal so healthcheck message can show up

View File

@@ -21,6 +21,7 @@
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import {
css,
DatasourceType,
SupersetClient,
styled,
@@ -116,7 +117,7 @@ const Styles = styled.div`
span[aria-label='dataset-physical'] {
color: ${({ theme }) => theme.colors.grayscale.base};
}
span[aria-label='more-vert'] {
span[aria-label='more'] {
color: ${({ theme }) => theme.colors.primary.base};
}
`;
@@ -136,7 +137,7 @@ export const datasourceIconLookup = {
[DatasourceType.Query]: (
<Icons.ConsoleSqlOutlined className="datasource-svg" />
),
[DatasourceType.Table]: <Icons.DatasetPhysical 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
@@ -400,7 +401,12 @@ class DatasourceControl extends PureComponent {
{renderDatasourceTitle(titleText, tooltip)}
{healthCheckMessage && (
<Tooltip title={healthCheckMessage}>
<Icons.AlertSolid iconColor={theme.colors.warning.base} />
<Icons.WarningOutlined
css={css`
margin-left: ${theme.gridUnit * 2}px;
`}
iconColor={theme.colors.warning.base}
/>
</Tooltip>
)}
{extra?.warning_markdown && (
@@ -415,7 +421,9 @@ class DatasourceControl extends PureComponent {
trigger={['click']}
data-test="datasource-menu"
>
<Icons.MoreVert
<Icons.MoreOutlined
IconSize="xl"
iconColor={theme.colors.primary.base}
className="datasource-modal-trigger"
data-test="datasource-menu-trigger"
/>