mirror of https://github.com/apache/superset.git
fix: Filtering db names while creating dataset is not working (#17023)
This commit is contained in:
parent
9ef2861fbd
commit
be211437de
|
@ -251,6 +251,7 @@ export default function DatabaseSelector({
|
|||
return renderSelectRow(
|
||||
<Select
|
||||
ariaLabel={t('Select database or type database name')}
|
||||
optionFilterProps={['database_name', 'value']}
|
||||
data-test="select-database"
|
||||
header={<FormLabel>{t('Database')}</FormLabel>}
|
||||
lazyLoading={false}
|
||||
|
|
|
@ -181,6 +181,7 @@ const Select = ({
|
|||
mode = 'single',
|
||||
name,
|
||||
notFoundContent,
|
||||
onError,
|
||||
onChange,
|
||||
onClear,
|
||||
optionFilterProps = ['label', 'value'],
|
||||
|
@ -328,15 +329,18 @@ const Select = ({
|
|||
setSearchedValue('');
|
||||
};
|
||||
|
||||
const onError = (response: Response) =>
|
||||
const internalOnError = useCallback(
|
||||
(response: Response) =>
|
||||
getClientErrorObject(response).then(e => {
|
||||
const { error } = e;
|
||||
setError(error);
|
||||
|
||||
if (props.onError) {
|
||||
props.onError(error);
|
||||
if (onError) {
|
||||
onError(error);
|
||||
}
|
||||
});
|
||||
}),
|
||||
[onError],
|
||||
);
|
||||
|
||||
const handleData = (data: OptionsType) => {
|
||||
let mergedData: OptionsType = [];
|
||||
|
@ -391,13 +395,13 @@ const Select = ({
|
|||
setAllValuesLoaded(true);
|
||||
}
|
||||
})
|
||||
.catch(onError)
|
||||
.catch(internalOnError)
|
||||
.finally(() => {
|
||||
setIsLoading(false);
|
||||
setIsTyping(false);
|
||||
});
|
||||
},
|
||||
[allValuesLoaded, fetchOnlyOnSearch, options],
|
||||
[allValuesLoaded, fetchOnlyOnSearch, internalOnError, options],
|
||||
);
|
||||
|
||||
const handleOnSearch = useMemo(
|
||||
|
|
Loading…
Reference in New Issue