Skip to content

Commit

Permalink
refactor: Deletes the common/components folder (#18999)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Mar 4, 2022
1 parent 9f834e8 commit 3298551
Show file tree
Hide file tree
Showing 95 changed files with 260 additions and 281 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import React, { CSSProperties } from 'react';
import ButtonGroup from 'src/components/ButtonGroup';
import Alert from 'src/components/Alert';
import moment from 'moment';
import { RadioChangeEvent } from 'antd/lib/radio';
import { RadioChangeEvent } from 'src/components';
import Button from 'src/components/Button';
import shortid from 'shortid';
import rison from 'rison';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import React from 'react';
import { shallow } from 'enzyme';
import { Radio } from 'src/components/Radio';
import { AutoComplete } from 'src/common/components';
import { AutoComplete } from 'src/components';
import { Input } from 'src/components/Input';
import { SaveDatasetModal } from 'src/SqlLab/components/SaveDatasetModal';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
import React, { FunctionComponent } from 'react';
import { AutoCompleteProps } from 'antd/lib/auto-complete';
import { Radio } from 'src/components/Radio';
import { AutoComplete } from 'src/common/components';
import { AutoComplete, RadioChangeEvent } from 'src/components';
import { Input } from 'src/components/Input';
import StyledModal from 'src/components/Modal';
import Button from 'src/components/Button';
import { styled, t } from '@superset-ui/core';
import { RadioChangeEvent } from 'antd/lib/radio';

interface SaveDatasetModalProps {
visible: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import React, { useState, useEffect } from 'react';
import { Row, Col } from 'src/common/components';
import { Row, Col } from 'src/components';
import { Input, TextArea } from 'src/components/Input';
import { t, styled } from '@superset-ui/core';
import Button from 'src/components/Button';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import React, { FunctionComponent, useState } from 'react';
import SchemaForm, { FormProps, FormValidation } from 'react-jsonschema-form';
import { Row, Col } from 'src/common/components';
import { Row, Col } from 'src/components';
import { Input, TextArea } from 'src/components/Input';
import { t, styled } from '@superset-ui/core';
import * as chrono from 'chrono-node';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import AceEditorWrapper from 'src/SqlLab/components/AceEditorWrapper';
import ConnectedSouthPane from 'src/SqlLab/components/SouthPane/state';
import SqlEditor from 'src/SqlLab/components/SqlEditor';
import SqlEditorLeftBar from 'src/SqlLab/components/SqlEditorLeftBar';
import { Dropdown } from 'src/common/components';
import { AntdDropdown } from 'src/components';
import {
queryEditorSetFunctionNames,
queryEditorSetSelectedText,
Expand Down Expand Up @@ -126,6 +126,6 @@ describe('SqlEditor', () => {
const updatedProps = { ...mockedProps, defaultQueryLimit };
const wrapper = buildWrapper(updatedProps);
await waitForComponentToPaint(wrapper);
expect(wrapper.find(Dropdown)).toExist();
expect(wrapper.find(AntdDropdown)).toExist();
});
});
12 changes: 6 additions & 6 deletions superset-frontend/src/SqlLab/components/SqlEditor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import StyledModal from 'src/components/Modal';
import Mousetrap from 'mousetrap';
import Button from 'src/components/Button';
import Timer from 'src/components/Timer';
import { Dropdown, Switch } from 'src/common/components';
import { AntdDropdown, AntdSwitch } from 'src/components';
import { Input } from 'src/components/Input';
import { Menu } from 'src/components/Menu';
import Icons from 'src/components/Icons';
Expand Down Expand Up @@ -533,7 +533,7 @@ class SqlEditor extends React.PureComponent {
<Menu.Item style={{ display: 'flex', justifyContent: 'space-between' }}>
{' '}
<span>{t('Autocomplete')}</span>{' '}
<Switch
<AntdSwitch
checked={this.state.autocompleteEnabled}
onChange={this.handleToggleAutocompleteEnabled}
name="autocomplete-switch"
Expand Down Expand Up @@ -667,7 +667,7 @@ class SqlEditor extends React.PureComponent {
)}
<span>
<LimitSelectStyled>
<Dropdown overlay={this.renderQueryLimit()} trigger="click">
<AntdDropdown overlay={this.renderQueryLimit()} trigger="click">
<a onClick={e => e.preventDefault()}>
<span>LIMIT:</span>
<span className="limitDropdown">
Expand All @@ -678,7 +678,7 @@ class SqlEditor extends React.PureComponent {
</span>
<Icons.TriangleDown iconColor={theme.colors.grayscale.base} />
</a>
</Dropdown>
</AntdDropdown>
</LimitSelectStyled>
</span>
{this.props.latestQuery && (
Expand All @@ -703,9 +703,9 @@ class SqlEditor extends React.PureComponent {
<span>
<ShareSqlLabQuery queryEditor={qe} />
</span>
<Dropdown overlay={this.renderDropdown()} trigger="click">
<AntdDropdown overlay={this.renderDropdown()} trigger="click">
<Icons.MoreHoriz iconColor={theme.colors.grayscale.base} />
</Dropdown>
</AntdDropdown>
</div>
</StyledToolbar>
);
Expand Down
3 changes: 1 addition & 2 deletions superset-frontend/src/addSlice/AddSliceContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
import React, { ReactNode } from 'react';
import rison from 'rison';
import { styled, t, SupersetClient, JsonResponse } from '@superset-ui/core';
import { Steps } from 'src/common/components';
import Button from 'src/components/Button';
import { Select } from 'src/components';
import { Select, Steps } from 'src/components';
import { FormLabel } from 'src/components/Form';
import { Tooltip } from 'src/components/Tooltip';

Expand Down
67 changes: 0 additions & 67 deletions superset-frontend/src/common/components/index.tsx

This file was deleted.

5 changes: 1 addition & 4 deletions superset-frontend/src/components/Alert/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
* under the License.
*/
import React, { PropsWithChildren } from 'react';
import {
Alert as AntdAlert,
AlertProps as AntdAlertProps,
} from 'src/common/components';
import AntdAlert, { AlertProps as AntdAlertProps } from 'antd/lib/alert';
import { useTheme } from '@superset-ui/core';
import Icons from 'src/components/Icons';

Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import React, { CSSProperties, Children, ReactElement } from 'react';
import { kebabCase } from 'lodash';
import { mix } from 'polished';
import cx from 'classnames';
import { Button as AntdButton } from 'antd';
import { AntdButton } from 'src/components';
import { useTheme } from '@superset-ui/core';
import { Tooltip } from 'src/components/Tooltip';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import React, { useState, useRef, useCallback } from 'react';
import { Divider } from 'src/common/components';
import { Divider } from 'src/components';
import { Input } from 'src/components/Input';
import { CronPicker, CronError, CronProps } from '.';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { useDebouncedEffect } from 'src/explore/exploreUtils';
import { SLOW_DEBOUNCE } from 'src/constants';
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
import Loading from 'src/components/Loading';
import { AntdInput } from 'src/common/components';
import { AntdInput } from 'src/components';
import { Input } from 'src/components/Input';
import {
PAGE_SIZE as DATASET_PAGE_SIZE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
import rison from 'rison';
import React, { useCallback } from 'react';
import PropTypes from 'prop-types';
import { Row, Col } from 'src/common/components';
import { Radio } from 'src/components/Radio';
import Card from 'src/components/Card';
import Alert from 'src/components/Alert';
import Badge from 'src/components/Badge';
import shortid from 'shortid';
import { styled, SupersetClient, t, withTheme } from '@superset-ui/core';
import { Select } from 'src/components';
import { Select, Row, Col } from 'src/components';
import { FormLabel } from 'src/components/Form';
import Button from 'src/components/Button';
import Tabs from 'src/components/Tabs';
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/Dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import React, { RefObject } from 'react';
import { Dropdown as AntdDropdown } from 'antd';
import { AntdDropdown } from 'src/components';
import { DropDownProps } from 'antd/lib/dropdown';
import { styled } from '@superset-ui/core';

Expand Down
6 changes: 3 additions & 3 deletions superset-frontend/src/components/DropdownButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import React, { ReactNode } from 'react';
import { Dropdown as AntdDropdown, Tooltip } from 'src/common/components';
import { AntdDropdown, AntdTooltip } from 'src/components';
import { styled } from '@superset-ui/core';
import kebabCase from 'lodash/kebabCase';

Expand Down Expand Up @@ -92,13 +92,13 @@ export const DropdownButton = ({
if (tooltip) {
return buildButton({
buttonsRender: ([leftButton, rightButton]) => [
<Tooltip
<AntdTooltip
placement={placement}
id={`${kebabCase(tooltip)}-tooltip`}
title={tooltip}
>
{leftButton}
</Tooltip>,
</AntdTooltip>,
rightButton,
],
});
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/EmptyState/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import React, { ReactNode } from 'react';
import { styled, css, SupersetTheme } from '@superset-ui/core';
import { Empty } from 'src/common/components';
import { Empty } from 'src/components';
import Button from 'src/components/Button';

export enum EmptyStateSize {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import React from 'react';
import { styledMount as mount } from 'spec/helpers/theming';

import { Avatar } from 'src/common/components';
import { Avatar } from 'src/components';
import FacePile from '.';
import { getRandomColor } from './utils';

Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/FacePile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
SupersetTheme,
} from '@superset-ui/core';
import { Tooltip } from 'src/components/Tooltip';
import { Avatar } from 'src/common/components';
import { Avatar } from 'src/components';
import { getRandomColor } from './utils';

interface FacePileProps {
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/src/components/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* under the License.
*/
import React from 'react';
import AntDForm, { FormProps } from 'antd/lib/form';
import AntdForm, { FormProps } from 'antd/lib/form';
import { styled } from '@superset-ui/core';

const StyledForm = styled(AntDForm)`
const StyledForm = styled(AntdForm)`
&.ant-form label {
font-size: ${({ theme }) => theme.typography.sizes.s}px;
}
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/FormRow/FormRow.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import React from 'react';
import { shallow } from 'enzyme';

import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
import { Row, Col } from 'src/common/components';
import { Row, Col } from 'src/components';
import TextControl from 'src/explore/components/controls/TextControl';
import FormRow from 'src/components/FormRow';

Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/FormRow/index.jsx
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 { Row, Col } from 'src/common/components';
import { Row, Col } from 'src/components';

import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { styledMount as mount } from 'spec/helpers/theming';
import { ReactWrapper } from 'enzyme';
import fetchMock from 'fetch-mock';
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
import { Upload } from 'src/common/components';
import { Upload } from 'src/components';
import Button from 'src/components/Button';
import { ImportResourceName } from 'src/views/CRUD/types';
import ImportModelsModal from 'src/components/ImportModal';
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/ImportModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { styled, t } from '@superset-ui/core';

import Button from 'src/components/Button';
import Modal from 'src/components/Modal';
import { Upload } from 'src/common/components';
import { Upload } from 'src/components';
import { useImportResource } from 'src/views/CRUD/hooks';
import { ImportResourceName } from 'src/views/CRUD/types';

Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/Label/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import React, { CSSProperties } from 'react';
import { Tag } from 'src/common/components';
import { Tag } from 'src/components';
import { useTheme } from '@superset-ui/core';

export type OnClickHandler = React.MouseEventHandler<HTMLElement>;
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/src/components/ListView/Filters/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import React, { useState } from 'react';
import { t, styled } from '@superset-ui/core';
import Icons from 'src/components/Icons';
import { AntdInput as Input } from 'src/common/components';
import { AntdInput } from 'src/components';
import { SELECT_WIDTH } from 'src/components/ListView/utils';
import { FormLabel } from 'src/components/Form';
import { BaseFilter } from './Base';
Expand All @@ -38,7 +38,7 @@ const SearchIcon = styled(Icons.Search)`
color: ${({ theme }) => theme.colors.grayscale.light1};
`;

const StyledInput = styled(Input)`
const StyledInput = styled(AntdInput)`
border-radius: ${({ theme }) => theme.gridUnit}px;
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { QueryParamProvider } from 'use-query-params';
import { supersetTheme, ThemeProvider } from '@superset-ui/core';

import Button from 'src/components/Button';
import { Empty } from 'src/common/components';
import { Empty } from 'src/components';
import CardCollection from 'src/components/ListView/CardCollection';
import { CardSortSelect } from 'src/components/ListView/CardSortSelect';
import IndeterminateCheckbox from 'src/components/IndeterminateCheckbox';
Expand Down
Loading

0 comments on commit 3298551

Please sign in to comment.