mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
chore: Show datasets when search input is empty (#12391)
This commit is contained in:
@@ -25,7 +25,7 @@ import React, {
|
||||
} from 'react';
|
||||
import { Alert, FormControl, FormControlProps } from 'react-bootstrap';
|
||||
import { SupersetClient, t, styled } from '@superset-ui/core';
|
||||
import TableView from 'src/components/TableView';
|
||||
import TableView, { EmptyWrapperType } from 'src/components/TableView';
|
||||
import StyledModal from 'src/common/components/Modal';
|
||||
import Button from 'src/components/Button';
|
||||
import { useListViewResource } from 'src/views/CRUD/hooks';
|
||||
@@ -120,9 +120,9 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
|
||||
|
||||
useDebouncedEffect(
|
||||
() => {
|
||||
if (filter) {
|
||||
fetchData({
|
||||
...emptyRequest,
|
||||
fetchData({
|
||||
...emptyRequest,
|
||||
...(filter && {
|
||||
filters: [
|
||||
{
|
||||
id: 'table_name',
|
||||
@@ -130,8 +130,8 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
|
||||
value: filter,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
}),
|
||||
});
|
||||
},
|
||||
1000,
|
||||
[filter],
|
||||
@@ -142,9 +142,6 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
|
||||
if (searchRef && searchRef.current) {
|
||||
searchRef.current.focus();
|
||||
}
|
||||
|
||||
// Fetch initial datasets for tableview
|
||||
await fetchData(emptyRequest);
|
||||
};
|
||||
|
||||
if (show) {
|
||||
@@ -224,6 +221,7 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
|
||||
onHide={onHide}
|
||||
responsive
|
||||
title={t('Change Dataset')}
|
||||
height="350px"
|
||||
footer={
|
||||
<>
|
||||
{confirmChange && (
|
||||
@@ -268,6 +266,7 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
|
||||
data={renderTableView()}
|
||||
pageSize={20}
|
||||
className="table-condensed"
|
||||
emptyWrapperType={EmptyWrapperType.Small}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user