This is an automated email from the ASF dual-hosted git repository. enzomartellucci pushed a commit to branch enxdev/refactor/InfoTooltipWithTrigger-component in repository https://gitbox.apache.org/repos/asf/superset.git
commit f5ff30251792326849e1384b6cf098b57d10c426 Author: Enzo Martellucci <enzomartellu...@gmail.com> AuthorDate: Mon Apr 28 17:04:46 2025 +0200 refactor(icons): replace fa fa icons with antd5 icons --- .../src/components/InfoTooltipWithTrigger.tsx | 2 +- .../src/SqlLab/components/TemplateParamsEditor/index.tsx | 13 +++++++++---- .../components/controls/AnnotationLayerControl/index.tsx | 2 +- .../components/controls/DndColumnSelectControl/Option.tsx | 8 ++++++-- .../explore/components/controls/OptionControls/index.tsx | 2 +- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/InfoTooltipWithTrigger.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/InfoTooltipWithTrigger.tsx index 2c82fc52ec..d0e04ac787 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/InfoTooltipWithTrigger.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/InfoTooltipWithTrigger.tsx @@ -39,7 +39,7 @@ export const InfoTooltipWithTrigger = ({ icon = <ExclamationCircleOutlined />, className = 'text-muted', placement = 'right', - iconsStyle = {}, + iconsStyle = { fontSize: 12 }, }: InfoTooltipWithTriggerProps) => { const handleKeyDown = (event: KeyboardEvent<HTMLSpanElement>) => { if (onClick && (event.key === 'Enter' || event.key === ' ')) { diff --git a/superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx b/superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx index 8079c8e417..83f8d4b472 100644 --- a/superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx +++ b/superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx @@ -17,10 +17,10 @@ * under the License. */ import { useState, useEffect } from 'react'; -import { t, styled } from '@superset-ui/core'; +import { t, styled, useTheme } from '@superset-ui/core'; import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls'; import { debounce } from 'lodash'; - +import { Icons } from 'src/components/Icons'; import { Badge, ConfigEditor, Tooltip } from 'src/components'; import ModalTrigger from 'src/components/ModalTrigger'; import { FAST_DEBOUNCE } from 'src/constants'; @@ -47,6 +47,7 @@ const TemplateParamsEditor = ({ const [isValid, setIsValid] = useState(true); const { templateParams } = useQueryEditor(queryEditorId, ['templateParams']); + const theme = useTheme(); const code = templateParams ?? '{}'; useEffect(() => { @@ -107,8 +108,12 @@ const TemplateParamsEditor = ({ <Badge count={paramCount} /> {!isValid && ( <InfoTooltipWithTrigger - icon="exclamation-triangle" - bsStyle="danger" + icon={ + <Icons.WarningOutlined + iconSize="s" + iconColor={theme.colorError} + /> + } tooltip={t('Invalid JSON')} label="invalid-json" /> diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx index 93f9120d68..4a9cb6a06f 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx @@ -193,7 +193,7 @@ class AnnotationLayerControl extends PureComponent<Props, PopoverState> { return ( <InfoTooltipWithTrigger label="validation-errors" - bsStyle="danger" + iconsStyle={{ color: theme.colorError }} tooltip={annotationError[anno.name]} /> ); diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx index 41d66a159b..d2fcac5179 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx @@ -72,9 +72,13 @@ export default function Option({ <Label data-test="control-label">{children}</Label> {(!!datasourceWarningMessage || isExtra) && ( <StyledInfoTooltipWithTrigger - icon="exclamation-triangle" + icon={ + <Icons.WarningOutlined + iconSize="s" + iconColor={theme.colorWarning} + /> + } placement="top" - bsStyle="warning" tooltip={ datasourceWarningMessage || t(` diff --git a/superset-frontend/src/explore/components/controls/OptionControls/index.tsx b/superset-frontend/src/explore/components/controls/OptionControls/index.tsx index ec204ff717..20427b932f 100644 --- a/superset-frontend/src/explore/components/controls/OptionControls/index.tsx +++ b/superset-frontend/src/explore/components/controls/OptionControls/index.tsx @@ -396,7 +396,7 @@ export const OptionControlLabel = ({ {(!!datasourceWarningMessage || isExtra) && ( <StyledInfoTooltipWithTrigger icon={ - <Icons.ExclamationCircleOutlined + <Icons.WarningOutlined iconSize="s" iconColor={theme.colorWarning} />