diff --git a/superset-frontend/spec/javascripts/components/AlteredSliceTag_spec.jsx b/superset-frontend/spec/javascripts/components/AlteredSliceTag_spec.jsx index f939d7aef..cbde50b60 100644 --- a/superset-frontend/spec/javascripts/components/AlteredSliceTag_spec.jsx +++ b/superset-frontend/spec/javascripts/components/AlteredSliceTag_spec.jsx @@ -22,7 +22,7 @@ import { getChartControlPanelRegistry } from '@superset-ui/core'; import AlteredSliceTag from 'src/components/AlteredSliceTag'; import ModalTrigger from 'src/components/ModalTrigger'; -import TooltipWrapper from 'src/components/TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; import TableCollection from 'src/components/dataViewCommon/TableCollection'; import TableView from 'src/components/TableView'; @@ -97,11 +97,11 @@ describe('AlteredSliceTag', () => { }); describe('renderTriggerNode', () => { - it('renders a TooltipWrapper', () => { + it('renders a Tooltip', () => { const triggerNode = mount(
{wrapper.instance().renderTriggerNode()}
, ); - expect(triggerNode.find(TooltipWrapper)).toHaveLength(1); + expect(triggerNode.find(Tooltip)).toHaveLength(1); }); }); diff --git a/superset-frontend/spec/javascripts/explore/components/RowCountLabel_spec.jsx b/superset-frontend/spec/javascripts/explore/components/RowCountLabel_spec.jsx index 13de226e7..7a669c993 100644 --- a/superset-frontend/spec/javascripts/explore/components/RowCountLabel_spec.jsx +++ b/superset-frontend/spec/javascripts/explore/components/RowCountLabel_spec.jsx @@ -20,7 +20,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import Label from 'src/components/Label'; -import TooltipWrapper from 'src/components/TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; import RowCountLabel from 'src/explore/components/RowCountLabel'; describe('RowCountLabel', () => { @@ -34,10 +34,10 @@ describe('RowCountLabel', () => { true, ); }); - it('renders a Label and a TooltipWrapper', () => { + it('renders a Label and a Tooltip', () => { const wrapper = shallow(); expect(wrapper.find(Label)).toExist(); - expect(wrapper.find(TooltipWrapper)).toExist(); + expect(wrapper.find(Tooltip)).toExist(); }); it('renders a danger when limit is reached', () => { const props = { diff --git a/superset-frontend/src/common/components/Tooltip/Tooltip.stories.tsx b/superset-frontend/src/common/components/Tooltip/Tooltip.stories.tsx new file mode 100644 index 000000000..f1040d71d --- /dev/null +++ b/superset-frontend/src/common/components/Tooltip/Tooltip.stories.tsx @@ -0,0 +1,77 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React from 'react'; +import Button from 'src/components/Button'; +import { TooltipProps, TooltipPlacement } from 'antd/lib/tooltip'; +import { Tooltip } from './index'; + +export default { + title: 'Tooltip', + component: Tooltip, +}; + +const PLACEMENTS: TooltipPlacement[] = [ + 'bottom', + 'bottomLeft', + 'bottomRight', + 'left', + 'leftBottom', + 'leftTop', + 'right', + 'rightBottom', + 'rightTop', + 'top', + 'topLeft', + 'topRight', +]; + +const TRIGGERS = ['hover', 'focus', 'click', 'contextMenu']; + +export const InteractiveTooltip = (args: TooltipProps) => ( + + + +); + +InteractiveTooltip.story = { + parameters: { + knobs: { + disabled: true, + }, + }, +}; + +InteractiveTooltip.args = { + title: 'Simple tooltip text', + mouseEnterDelay: 0.1, + mouseLeaveDelay: 0.1, +}; + +InteractiveTooltip.argTypes = { + placement: { + defaultValue: 'top', + control: { type: 'select', options: PLACEMENTS }, + }, + trigger: { + defaultValue: 'hover', + control: { type: 'select', options: TRIGGERS }, + }, + color: { control: { type: 'color' } }, + onVisibleChange: { action: 'onVisibleChange' }, +}; diff --git a/superset-frontend/src/common/components/Tooltip/Tooltip.test.tsx b/superset-frontend/src/common/components/Tooltip/Tooltip.test.tsx new file mode 100644 index 000000000..1aec5a23b --- /dev/null +++ b/superset-frontend/src/common/components/Tooltip/Tooltip.test.tsx @@ -0,0 +1,72 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React from 'react'; +import { render, screen } from 'spec/helpers/testing-library'; +import userEvent from '@testing-library/user-event'; +import { supersetTheme } from '@superset-ui/core'; +import Button from 'src/components/Button'; +import Icon from 'src/components/Icon'; +import { Tooltip } from '.'; + +test('starts hidden with default props', () => { + render( + + + , + ); + expect(screen.queryByRole('tooltip')).not.toBeInTheDocument(); +}); + +test('renders on hover', async () => { + render( + + + , + ); + userEvent.hover(screen.getByRole('button')); + expect(await screen.findByRole('tooltip')).toBeInTheDocument(); +}); + +test('renders with theme', () => { + render( + + + , + ); + const tooltip = screen.getByRole('tooltip'); + expect(tooltip).toHaveStyle({ + background: `${supersetTheme.colors.grayscale.dark2}e6`, + }); + expect(tooltip.parentNode?.parentNode).toHaveStyle({ + lineHeight: 1.6, + fontSize: 12, + }); +}); + +test('renders with icon child', async () => { + render( + + + Hover me + + , + ); + userEvent.hover(screen.getByRole('img')); + expect(await screen.findByRole('tooltip')).toBeInTheDocument(); +}); diff --git a/superset-frontend/src/common/components/Tooltip.tsx b/superset-frontend/src/common/components/Tooltip/index.tsx similarity index 100% rename from superset-frontend/src/common/components/Tooltip.tsx rename to superset-frontend/src/common/components/Tooltip/index.tsx diff --git a/superset-frontend/src/components/AlteredSliceTag.jsx b/superset-frontend/src/components/AlteredSliceTag.jsx index 53a5b8ca2..407eb4ecd 100644 --- a/superset-frontend/src/components/AlteredSliceTag.jsx +++ b/superset-frontend/src/components/AlteredSliceTag.jsx @@ -22,7 +22,7 @@ import { isEqual, isEmpty } from 'lodash'; import { t } from '@superset-ui/core'; import getControlsForVizType from 'src/utils/getControlsForVizType'; import { safeStringify } from 'src/utils/safeStringify'; -import TooltipWrapper from './TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; import ModalTrigger from './ModalTrigger'; import TableView from './TableView'; @@ -174,14 +174,14 @@ export default class AlteredSliceTag extends React.Component { renderTriggerNode() { return ( - + {t('Altered')} - + ); } diff --git a/superset-frontend/src/components/CachedLabel.jsx b/superset-frontend/src/components/CachedLabel.jsx index a7bc72089..a1f5a0c8a 100644 --- a/superset-frontend/src/components/CachedLabel.jsx +++ b/superset-frontend/src/components/CachedLabel.jsx @@ -22,7 +22,7 @@ import moment from 'moment'; import { t } from '@superset-ui/core'; import Label from 'src/components/Label'; -import TooltipWrapper from './TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; const propTypes = { onClick: PropTypes.func, @@ -69,7 +69,7 @@ class CacheLabel extends React.PureComponent { render() { const labelType = this.state.hovered ? 'primary' : 'default'; return ( - + - + ); } } diff --git a/superset-frontend/src/components/CertifiedIconWithTooltip.tsx b/superset-frontend/src/components/CertifiedIconWithTooltip.tsx index e4132dc82..dc4d5ed72 100644 --- a/superset-frontend/src/components/CertifiedIconWithTooltip.tsx +++ b/superset-frontend/src/components/CertifiedIconWithTooltip.tsx @@ -19,7 +19,7 @@ import React from 'react'; import { t, supersetTheme } from '@superset-ui/core'; import Icon from 'src/components/Icon'; -import TooltipWrapper from 'src/components/TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; interface CertifiedIconWithTooltipProps { certifiedBy?: string; @@ -33,9 +33,9 @@ function CertifiedIconWithTooltip({ size = 24, }: CertifiedIconWithTooltipProps) { return ( - {certifiedBy &&
{t('Certified by %s', certifiedBy)}
}
{details}
@@ -48,7 +48,7 @@ function CertifiedIconWithTooltip({ width={size} name="certified" /> -
+ ); } diff --git a/superset-frontend/src/components/EditableTitle.tsx b/superset-frontend/src/components/EditableTitle.tsx index 5f4f7a482..024879358 100644 --- a/superset-frontend/src/components/EditableTitle.tsx +++ b/superset-frontend/src/components/EditableTitle.tsx @@ -19,7 +19,7 @@ import React, { useEffect, useState, useRef } from 'react'; import cx from 'classnames'; import { t } from '@superset-ui/core'; -import TooltipWrapper from './TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; interface EditableTitleProps { canEdit?: boolean; @@ -174,9 +174,9 @@ export default function EditableTitle({ ); if (showTooltip && !isEditing) { titleComponent = ( - {titleComponent} - + ); } if (!canEdit) { diff --git a/superset-frontend/src/components/FaveStar.tsx b/superset-frontend/src/components/FaveStar.tsx index 32f4a5d05..28c970881 100644 --- a/superset-frontend/src/components/FaveStar.tsx +++ b/superset-frontend/src/components/FaveStar.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; import { t, styled } from '@superset-ui/core'; -import TooltipWrapper from './TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; import Icon from './Icon'; interface FaveStarProps { @@ -65,12 +65,12 @@ export default class FaveStar extends React.PureComponent { if (this.props.showTooltip) { return ( - {content} - + ); } diff --git a/superset-frontend/src/components/FilterableTable/FilterableTable.tsx b/superset-frontend/src/components/FilterableTable/FilterableTable.tsx index c7629962d..0a86c5e0e 100644 --- a/superset-frontend/src/components/FilterableTable/FilterableTable.tsx +++ b/superset-frontend/src/components/FilterableTable/FilterableTable.tsx @@ -30,11 +30,10 @@ import { Table, } from 'react-virtualized'; import { getMultipleTextDimensions, t, styled } from '@superset-ui/core'; - +import { Tooltip } from 'src/common/components/Tooltip'; import Button from '../Button'; import CopyToClipboard from '../CopyToClipboard'; import ModalTrigger from '../ModalTrigger'; -import TooltipWrapper from '../TooltipWrapper'; function safeJsonObjectParse( data: unknown, @@ -358,14 +357,14 @@ export default class FilterableTable extends PureComponent< ? 'header-style-disabled' : 'header-style'; return ( - +
{label} {sortBy === dataKey && ( )}
-
+ ); } @@ -384,7 +383,7 @@ export default class FilterableTable extends PureComponent< ? 'header-style-disabled' : 'header-style'; return ( - +
{label}
-
+ ); } diff --git a/superset-frontend/src/components/ListView/ActionsBar.tsx b/superset-frontend/src/components/ListView/ActionsBar.tsx index c1734f6d8..b9785294e 100644 --- a/superset-frontend/src/components/ListView/ActionsBar.tsx +++ b/superset-frontend/src/components/ListView/ActionsBar.tsx @@ -18,13 +18,14 @@ */ import React from 'react'; import { styled } from '@superset-ui/core'; -import TooltipWrapper from 'src/components/TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; import Icon, { IconName } from 'src/components/Icon'; +import { TooltipPlacement } from 'antd/lib/tooltip'; export type ActionProps = { label: string; tooltip?: string | React.ReactElement; - placement?: string; + placement?: TooltipPlacement; icon: IconName; onClick: () => void; }; @@ -55,10 +56,10 @@ export default function ActionsBar({ actions }: ActionsBarProps) { {actions.map((action, index) => { if (action.tooltip) { return ( - - + ); } diff --git a/superset-frontend/src/components/RefreshLabel.jsx b/superset-frontend/src/components/RefreshLabel.jsx index 2155f0bfa..bac7ae18c 100644 --- a/superset-frontend/src/components/RefreshLabel.jsx +++ b/superset-frontend/src/components/RefreshLabel.jsx @@ -18,7 +18,7 @@ */ import React from 'react'; import PropTypes from 'prop-types'; -import TooltipWrapper from './TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; import './RefreshLabel.less'; @@ -30,7 +30,7 @@ const propTypes = { class RefreshLabel extends React.PureComponent { render() { return ( - + - + ); } } diff --git a/superset-frontend/src/components/TooltipWrapper.jsx b/superset-frontend/src/components/TooltipWrapper.jsx deleted file mode 100644 index d21f87bcc..000000000 --- a/superset-frontend/src/components/TooltipWrapper.jsx +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import React from 'react'; -import PropTypes from 'prop-types'; -import { kebabCase } from 'lodash'; -import { Tooltip } from 'src/common/components/Tooltip'; - -const propTypes = { - label: PropTypes.string.isRequired, - tooltip: PropTypes.node.isRequired, - children: PropTypes.node.isRequired, - placement: PropTypes.string, - trigger: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.arrayOf(PropTypes.string), - ]), -}; - -const defaultProps = { - placement: 'top', -}; - -export default function TooltipWrapper({ - label, - tooltip, - children, - placement, - trigger, -}) { - return ( - - {children} - - ); -} - -TooltipWrapper.propTypes = propTypes; -TooltipWrapper.defaultProps = defaultProps; diff --git a/superset-frontend/src/dashboard/components/PublishedStatus.jsx b/superset-frontend/src/dashboard/components/PublishedStatus.jsx index cbf642cc0..403ab03eb 100644 --- a/superset-frontend/src/dashboard/components/PublishedStatus.jsx +++ b/superset-frontend/src/dashboard/components/PublishedStatus.jsx @@ -19,7 +19,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { t } from '@superset-ui/core'; -import TooltipWrapper from 'src/components/TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; import Label from 'src/components/Label'; const propTypes = { @@ -59,10 +59,10 @@ export default class PublishedStatus extends React.Component { // if they can edit the dash, make the badge a button if (this.props.canEdit && this.props.canSave) { return ( - - + ); } return ( - - + ); } // Show the published badge for the owner of the dashboard to toggle if (this.props.canEdit && this.props.canSave) { return ( - - + ); } diff --git a/superset-frontend/src/dashboard/components/SliceHeader.jsx b/superset-frontend/src/dashboard/components/SliceHeader.jsx index fcc1dd5ab..5f9ecd397 100644 --- a/superset-frontend/src/dashboard/components/SliceHeader.jsx +++ b/superset-frontend/src/dashboard/components/SliceHeader.jsx @@ -20,8 +20,8 @@ import React from 'react'; import PropTypes from 'prop-types'; import { t } from '@superset-ui/core'; +import { Tooltip } from 'src/common/components/Tooltip'; import EditableTitle from '../../components/EditableTitle'; -import TooltipWrapper from '../../components/TooltipWrapper'; import SliceHeaderControls from './SliceHeaderControls'; import FiltersBadge from '../containers/FiltersBadge'; @@ -122,22 +122,22 @@ class SliceHeader extends React.PureComponent { showTooltip={false} /> {!!Object.values(annotationQuery).length && ( - - + )} {!!Object.values(annotationError).length && ( - - + )}
diff --git a/superset-frontend/src/explore/components/ExploreChartHeader.jsx b/superset-frontend/src/explore/components/ExploreChartHeader.jsx index 9c1df9f3a..adf07c797 100644 --- a/superset-frontend/src/explore/components/ExploreChartHeader.jsx +++ b/superset-frontend/src/explore/components/ExploreChartHeader.jsx @@ -21,14 +21,13 @@ import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import PropTypes from 'prop-types'; import { styled, t } from '@superset-ui/core'; - +import { Tooltip } from 'src/common/components/Tooltip'; import { chartPropShape } from '../../dashboard/util/propShapes'; import ExploreActionButtons from './ExploreActionButtons'; import RowCountLabel from './RowCountLabel'; import EditableTitle from '../../components/EditableTitle'; import AlteredSliceTag from '../../components/AlteredSliceTag'; import FaveStar from '../../components/FaveStar'; -import TooltipWrapper from '../../components/TooltipWrapper'; import Timer from '../../components/Timer'; import CachedLabel from '../../components/CachedLabel'; import PropertiesModal from './PropertiesModal'; @@ -161,9 +160,9 @@ export class ExploreChartHeader extends React.PureComponent { onSave={this.props.sliceUpdated} slice={this.props.slice} /> - - + {this.props.chart.sliceFormData && ( ); return ( - + - + ); } diff --git a/superset-frontend/src/explore/components/controls/ColorSchemeControl.jsx b/superset-frontend/src/explore/components/controls/ColorSchemeControl.jsx index 03d1445b4..6b76fbc3d 100644 --- a/superset-frontend/src/explore/components/controls/ColorSchemeControl.jsx +++ b/superset-frontend/src/explore/components/controls/ColorSchemeControl.jsx @@ -20,8 +20,9 @@ import React from 'react'; import PropTypes from 'prop-types'; import { isFunction } from 'lodash'; import { Select } from 'src/components/Select'; +import { Tooltip } from 'src/common/components/Tooltip'; import ControlHeader from '../ControlHeader'; -import TooltipWrapper from '../../../components/TooltipWrapper'; + import './ColorSchemeControl.less'; const propTypes = { @@ -72,10 +73,7 @@ export default class ColorSchemeControl extends React.PureComponent { } return ( - +
    {colors.map((color, i) => (
  • ))}
-
+ ); } diff --git a/superset-frontend/src/views/CRUD/chart/ChartList.tsx b/superset-frontend/src/views/CRUD/chart/ChartList.tsx index 6048cc9e4..67b4d2100 100644 --- a/superset-frontend/src/views/CRUD/chart/ChartList.tsx +++ b/superset-frontend/src/views/CRUD/chart/ChartList.tsx @@ -46,7 +46,7 @@ import withToasts from 'src/messageToasts/enhancers/withToasts'; import PropertiesModal from 'src/explore/components/PropertiesModal'; import ImportModelsModal from 'src/components/ImportModal/index'; import Chart from 'src/types/Chart'; -import TooltipWrapper from 'src/components/TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; import ChartCard from './ChartCard'; const PAGE_SIZE = 25; @@ -308,9 +308,9 @@ function ChartList(props: ChartListProps) { onConfirm={handleDelete} > {confirmDelete => ( - - + )} )} {canExport && ( - - + )} {canEdit && ( - - + )} ); diff --git a/superset-frontend/src/views/CRUD/csstemplates/CssTemplatesList.tsx b/superset-frontend/src/views/CRUD/csstemplates/CssTemplatesList.tsx index cc87c6b4a..5e33bfad0 100644 --- a/superset-frontend/src/views/CRUD/csstemplates/CssTemplatesList.tsx +++ b/superset-frontend/src/views/CRUD/csstemplates/CssTemplatesList.tsx @@ -27,7 +27,7 @@ import { createFetchRelated, createErrorHandler } from 'src/views/CRUD/utils'; import withToasts from 'src/messageToasts/enhancers/withToasts'; import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu'; import DeleteModal from 'src/components/DeleteModal'; -import TooltipWrapper from 'src/components/TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; import ConfirmStatusChange from 'src/components/ConfirmStatusChange'; import { IconName } from 'src/components/Icon'; import ActionsBar, { ActionProps } from 'src/components/ListView/ActionsBar'; @@ -146,13 +146,13 @@ function CssTemplatesList({ } return ( - {changedOn} - + ); }, Header: t('Last modified'), diff --git a/superset-frontend/src/views/CRUD/dashboard/DashboardList.tsx b/superset-frontend/src/views/CRUD/dashboard/DashboardList.tsx index 8138dafea..af810c132 100644 --- a/superset-frontend/src/views/CRUD/dashboard/DashboardList.tsx +++ b/superset-frontend/src/views/CRUD/dashboard/DashboardList.tsx @@ -40,7 +40,7 @@ import FacePile from 'src/components/FacePile'; import Icon from 'src/components/Icon'; import FaveStar from 'src/components/FaveStar'; import PropertiesModal from 'src/dashboard/components/PropertiesModal'; -import TooltipWrapper from 'src/components/TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; import ImportModelsModal from 'src/components/ImportModal/index'; import Dashboard from 'src/dashboard/containers/Dashboard'; @@ -291,9 +291,9 @@ function DashboardList(props: DashboardListProps) { onConfirm={handleDelete} > {confirmDelete => ( - - + )} )} {canExport && ( - - + )} {canEdit && ( - - + )} ); diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx index 78d7e466d..82d897039 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx @@ -25,7 +25,7 @@ import { createErrorHandler } from 'src/views/CRUD/utils'; import withToasts from 'src/messageToasts/enhancers/withToasts'; import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu'; import DeleteModal from 'src/components/DeleteModal'; -import TooltipWrapper from 'src/components/TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; import Icon from 'src/components/Icon'; import ListView, { Filters } from 'src/components/ListView'; import { commonMenuData } from 'src/views/CRUD/data/common'; @@ -205,13 +205,13 @@ function DatabaseList({ addDangerToast, addSuccessToast }: DatabaseListProps) { { accessor: 'allow_run_async', Header: ( - {t('AQE')} - + ), Cell: ({ row: { @@ -223,13 +223,13 @@ function DatabaseList({ addDangerToast, addSuccessToast }: DatabaseListProps) { { accessor: 'allow_dml', Header: ( - {t('DML')} - + ), Cell: ({ row: { @@ -298,19 +298,19 @@ function DatabaseList({ addDangerToast, addSuccessToast }: DatabaseListProps) { data-test="database-delete" onClick={handleDelete} > - - + )} {canExport && ( - - + )} {canEdit && ( - - + )} ); @@ -367,13 +367,13 @@ function DatabaseList({ addDangerToast, addSuccessToast }: DatabaseListProps) { }, { Header: ( - {t('AQE')} - + ), id: 'allow_run_async', input: 'select', diff --git a/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx b/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx index f5d5a7884..85406ae80 100644 --- a/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx +++ b/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx @@ -41,7 +41,7 @@ import SubMenu, { import { commonMenuData } from 'src/views/CRUD/data/common'; import Owner from 'src/types/Owner'; import withToasts from 'src/messageToasts/enhancers/withToasts'; -import TooltipWrapper from 'src/components/TooltipWrapper'; +import { Tooltip } from 'src/common/components/Tooltip'; import Icon from 'src/components/Icon'; import FacePile from 'src/components/FacePile'; import CertifiedIconWithTooltip from 'src/components/CertifiedIconWithTooltip'; @@ -199,22 +199,19 @@ const DatasetList: FunctionComponent = ({ }: any) => { if (kind === 'physical') { return ( - - + ); } return ( - + - + ); }, accessor: 'kind_icon', @@ -325,9 +322,9 @@ const DatasetList: FunctionComponent = ({ return ( {canDelete && ( - = ({ > - + )} {canExport && ( - = ({ > - + )} {canEdit && ( - = ({ > - + )} );