Skip to content

Commit edfcbed

Browse files
authored
refactor(input): Remove leftover direct usage of Ant Design input (apache#32545)
1 parent f45ab70 commit edfcbed

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

superset-frontend/src/components/ListView/Filters/Search.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626

2727
import { t, styled } from '@superset-ui/core';
2828
import Icons from 'src/components/Icons';
29-
import { AntdInput } from 'src/components';
29+
import { Input } from 'src/components/Input';
3030
import { SELECT_WIDTH } from 'src/components/ListView/utils';
3131
import { FormLabel } from 'src/components/Form';
3232
import InfoTooltip from 'src/components/InfoTooltip';
@@ -47,10 +47,6 @@ const SearchIcon = styled(Icons.Search)`
4747
color: ${({ theme }) => theme.colors.grayscale.light1};
4848
`;
4949

50-
const StyledInput = styled(AntdInput)`
51-
border-radius: ${({ theme }) => theme.gridUnit}px;
52-
`;
53-
5450
function SearchFilter(
5551
{
5652
Header,
@@ -87,7 +83,7 @@ function SearchFilter(
8783
{toolTipDescription && (
8884
<InfoTooltip tooltip={toolTipDescription} viewBox="0 -7 28 28" />
8985
)}
90-
<StyledInput
86+
<Input
9187
allowClear
9288
data-test="filters-search"
9389
placeholder={t('Type a value')}

superset-frontend/src/components/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export {
5555
Checkbox as AntdCheckbox,
5656
Collapse as AntdCollapse,
5757
Form as AntdForm,
58-
Input as AntdInput,
5958
Select as AntdSelect,
6059
} from 'antd';
6160

superset-frontend/src/pages/DatabaseList/DatabaseList.test.jsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1515
* KIND, either express or implied. See the License for the
1616
* specific language governing permissions and limitations
17-
* under the License.
17+
* under the License.src/pages/DatabaseList/DatabaseList.test.jsx
1818
*/
1919
import thunk from 'redux-thunk';
2020
import * as reactRedux from 'react-redux';
@@ -175,7 +175,11 @@ describe('Admin DatabaseList', () => {
175175
});
176176
await waitForComponentToPaint(wrapper);
177177
act(() => {
178-
wrapper.find('button').last().props().onClick();
178+
wrapper
179+
.find({ 'data-test': 'modal-confirm-button' })
180+
.last()
181+
.props()
182+
.onClick();
179183
});
180184

181185
await waitForComponentToPaint(wrapper);

superset-frontend/src/pages/SavedQueryList/SavedQueryList.test.jsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ describe('SavedQueryList', () => {
196196
await waitFor(() => {
197197
const calls = fetchMock.calls(/saved_query\/\?q/);
198198
const lastCall = calls[calls.length - 1][0];
199-
expect(lastCall).toContain('order_column:label');
199+
const url = new URL(lastCall);
200+
const params = new URLSearchParams(url.search);
201+
const qParam = params.get('q');
202+
expect(qParam).toContain('order_column:label');
200203
});
201204
});
202205

0 commit comments

Comments
 (0)