Skip to content

Commit

Permalink
chore: Removes Popover duplication (apache#13462)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored and Allan Caetano de Oliveira committed May 21, 2021
1 parent b5ee5f6 commit 3d2c761
Show file tree
Hide file tree
Showing 24 changed files with 22 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import React from 'react';
import sinon from 'sinon';
import { shallow } from 'enzyme';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';

import AdhocFilter, {
EXPRESSION_TYPES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React from 'react';
import sinon from 'sinon';
import { shallow } from 'enzyme';

import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import { AGGREGATES } from 'src/explore/constants';
import AdhocMetricOption from 'src/explore/components/controls/MetricControl/AdhocMetricOption';
import AdhocMetric from 'src/explore/components/controls/MetricControl/AdhocMetric';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
CategoricalScheme,
getCategoricalSchemeRegistry,
} from '@superset-ui/core';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import ColorPickerControl from 'src/explore/components/controls/ColorPickerControl';
import ControlHeader from 'src/explore/components/ControlHeader';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import React from 'react';
import { shallow, mount } from 'enzyme';
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import sinon from 'sinon';
import { Provider } from 'react-redux';
import configureStore from 'redux-mock-store';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React from 'react';
import sinon from 'sinon';
import { shallow } from 'enzyme';

import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import FilterBoxItemControl from 'src/explore/components/controls/FilterBoxItemControl';
import FormRow from 'src/components/FormRow';
import datasources from 'spec/fixtures/mockDatasource';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React from 'react';
import { FormControl } from 'react-bootstrap';
import sinon from 'sinon';
import { shallow } from 'enzyme';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import TimeSeriesColumnControl from 'src/explore/components/controls/TimeSeriesColumnControl';

const defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/* eslint-disable no-unused-expressions */
import React from 'react';
import { styledMount as mount } from 'spec/helpers/theming';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';

import Label from 'src/components/Label';
import ViewportControl from 'src/explore/components/controls/ViewportControl';
Expand Down
23 changes: 0 additions & 23 deletions superset-frontend/src/common/components/Popover.tsx

This file was deleted.

29 changes: 0 additions & 29 deletions superset-frontend/src/common/components/common.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { withKnobs, boolean, select } from '@storybook/addon-knobs';
import Button from 'src/components/Button';
import Modal from './Modal';
import Tabs, { EditableTabs } from './Tabs';
import AntdPopover from './Popover';
import { Tooltip as AntdTooltip } from './Tooltip';
import { Switch as AntdSwitch } from './Switch';
import { Menu, Input, Divider } from '.';
Expand Down Expand Up @@ -127,34 +126,6 @@ export const TabsWithDropdownMenu = () => (
</EditableTabs>
);

export const Popover = () => (
<AntdPopover
trigger={select('Trigger', ['click', 'hover', 'focus'], 'click')}
placement={select(
'Placement',
[
'topLeft',
'top',
'topRight',
'leftTop',
'left',
'leftBottom',
'rightTop',
'right',
'rightBottom',
'bottomLeft',
'bottom',
'bottomRight',
],
'topLeft',
)}
arrowPointAtCenter={boolean('Arrow point at center', false)}
content={<div>CONTENT</div>}
>
<Button>TRIGGER</Button>
</AntdPopover>
);

export const Tooltip = () => (
<AntdTooltip
title="This is a Tooltip"
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/Popover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { Popover } from 'src/common/components';
import { Popover } from 'antd';

// Eventually Popover can be wrapped and customized in this file
// for now we're just redirecting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { t } from '@superset-ui/core';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import CopyToClipboard from 'src/components/CopyToClipboard';
import { getShortUrl } from 'src/utils/urlUtils';
import withToasts from 'src/messageToasts/enhancers/withToasts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
CheckCircleFilled,
ExclamationCircleFilled,
} from '@ant-design/icons';
import { Popover } from 'src/common/components/index';
import Popover from 'src/components/Popover';
import Collapse from 'src/common/components/Collapse';
import { Global } from '@emotion/core';
import Icon from 'src/components/Icon';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { styled, t, DataMask } from '@superset-ui/core';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import Icon from 'src/components/Icon';
import { Pill } from 'src/dashboard/components/FiltersBadge/Styles';
import { useSelector } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { t } from '@superset-ui/core';

import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import FormLabel from 'src/components/FormLabel';
import Icon from 'src/components/Icon';
import { Tooltip } from 'src/common/components/Tooltip';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { ListGroup, ListGroupItem } from 'react-bootstrap';
import { connect } from 'react-redux';
import { t, withTheme } from '@superset-ui/core';
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import AsyncEsmComponent from 'src/components/AsyncEsmComponent';
import { getChartKey } from 'src/explore/exploreUtils';
import { runAnnotationQuery } from 'src/chart/chartAction';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { SketchPicker } from 'react-color';
import { getCategoricalSchemeRegistry } from '@superset-ui/core';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import ControlHeader from '../ControlHeader';

const propTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { getClientErrorObject } from 'src/utils/getClientErrorObject';
import Button from 'src/components/Button';
import ControlHeader from 'src/explore/components/ControlHeader';
import Label from 'src/components/Label';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import { Divider } from 'src/common/components';
import Icon from 'src/components/Icon';
import { Select } from 'src/components/Select';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import PropTypes from 'prop-types';
import { t } from '@superset-ui/core';
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';

import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import FormRow from '../../../components/FormRow';
import SelectControl from './SelectControl';
import CheckboxControl from './CheckboxControl';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import React from 'react';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import { OptionSortType } from 'src/explore/types';
import AdhocFilterEditPopover from './AdhocFilterEditPopover';
import AdhocFilter from './AdhocFilter';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import React, { ReactNode } from 'react';
import { Metric } from '@superset-ui/core';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import AdhocMetricEditPopoverTitle from 'src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle';
import AdhocMetricEditPopover, {
SAVED_TAB_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Row, Col, FormControl } from 'react-bootstrap';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import Select from 'src/components/Select';
import { t } from '@superset-ui/core';
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import React from 'react';
import PropTypes from 'prop-types';
import Popover from 'src/common/components/Popover';
import Popover from 'src/components/Popover';
import { decimal2sexagesimal } from 'geolib';

import Label from 'src/components/Label';
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/views/CRUD/data/query/QueryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
import withToasts from 'src/messageToasts/enhancers/withToasts';
import { useListViewResource } from 'src/views/CRUD/hooks';
import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu';
import { Popover } from 'src/common/components';
import Popover from 'src/components/Popover';
import { commonMenuData } from 'src/views/CRUD/data/common';
import ListView, {
Filters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
createFetchDistinct,
createErrorHandler,
} from 'src/views/CRUD/utils';
import { Popover } from 'src/common/components';
import Popover from 'src/components/Popover';
import withToasts from 'src/messageToasts/enhancers/withToasts';
import { useListViewResource } from 'src/views/CRUD/hooks';
import ConfirmStatusChange from 'src/components/ConfirmStatusChange';
Expand Down

0 comments on commit 3d2c761

Please sign in to comment.