From 8ddcba82e076089d2cac574b33084cefbca0814f Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Wed, 31 Mar 2021 19:42:14 -0300 Subject: [PATCH] chore: Removes Select duplication (#13477) --- .../CRUD/alert/AlertReportModal_spec.jsx | 3 +-- .../Select/NativeSelect.tsx} | 20 ++++++++----------- .../src/components/Select/index.ts | 1 + ...AdhocFilterEditPopoverSimpleTabContent.jsx | 2 +- .../AdhocFilterEditPopoverSqlTabContent.jsx | 2 +- .../MetricControl/AdhocMetricEditPopover.jsx | 2 +- .../src/views/CRUD/alert/AlertReportModal.tsx | 3 +-- 7 files changed, 14 insertions(+), 19 deletions(-) rename superset-frontend/src/{common/components/Select.tsx => components/Select/NativeSelect.tsx} (74%) diff --git a/superset-frontend/spec/javascripts/views/CRUD/alert/AlertReportModal_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/alert/AlertReportModal_spec.jsx index 941faf17663..b4a0131ae4b 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/alert/AlertReportModal_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/alert/AlertReportModal_spec.jsx @@ -24,9 +24,8 @@ import fetchMock from 'fetch-mock'; import { act } from 'react-dom/test-utils'; import AlertReportModal from 'src/views/CRUD/alert/AlertReportModal'; import Modal from 'src/common/components/Modal'; -import { AsyncSelect } from 'src/components/Select'; +import { AsyncSelect, NativeGraySelect as Select } from 'src/components/Select'; import { Radio } from 'src/common/components/Radio'; -import { GraySelect as Select } from 'src/common/components/Select'; import { Switch } from 'src/common/components/Switch'; import TextAreaControl from 'src/explore/components/controls/TextAreaControl'; import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint'; diff --git a/superset-frontend/src/common/components/Select.tsx b/superset-frontend/src/components/Select/NativeSelect.tsx similarity index 74% rename from superset-frontend/src/common/components/Select.tsx rename to superset-frontend/src/components/Select/NativeSelect.tsx index 49dc91d692e..604496701eb 100644 --- a/superset-frontend/src/common/components/Select.tsx +++ b/superset-frontend/src/components/Select/NativeSelect.tsx @@ -18,18 +18,15 @@ */ import React from 'react'; import { styled } from '@superset-ui/core'; -import { Select as BaseSelect, SelectProps } from 'src/common/components'; +import Select, { SelectProps } from 'antd/lib/select'; -const StyledSelect = styled((props: SelectProps) => ( - trigger.parentNode} - {...props} - /> +const StyledNativeSelect = styled((props: SelectProps) => ( +