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(
|
return renderSelectRow(
|
||||||
<Select
|
<Select
|
||||||
ariaLabel={t('Select database or type database name')}
|
ariaLabel={t('Select database or type database name')}
|
||||||
|
optionFilterProps={['database_name', 'value']}
|
||||||
data-test="select-database"
|
data-test="select-database"
|
||||||
header={<FormLabel>{t('Database')}</FormLabel>}
|
header={<FormLabel>{t('Database')}</FormLabel>}
|
||||||
lazyLoading={false}
|
lazyLoading={false}
|
||||||
|
|
|
@ -181,6 +181,7 @@ const Select = ({
|
||||||
mode = 'single',
|
mode = 'single',
|
||||||
name,
|
name,
|
||||||
notFoundContent,
|
notFoundContent,
|
||||||
|
onError,
|
||||||
onChange,
|
onChange,
|
||||||
onClear,
|
onClear,
|
||||||
optionFilterProps = ['label', 'value'],
|
optionFilterProps = ['label', 'value'],
|
||||||
|
@ -328,15 +329,18 @@ const Select = ({
|
||||||
setSearchedValue('');
|
setSearchedValue('');
|
||||||
};
|
};
|
||||||
|
|
||||||
const onError = (response: Response) =>
|
const internalOnError = useCallback(
|
||||||
getClientErrorObject(response).then(e => {
|
(response: Response) =>
|
||||||
const { error } = e;
|
getClientErrorObject(response).then(e => {
|
||||||
setError(error);
|
const { error } = e;
|
||||||
|
setError(error);
|
||||||
|
|
||||||
if (props.onError) {
|
if (onError) {
|
||||||
props.onError(error);
|
onError(error);
|
||||||
}
|
}
|
||||||
});
|
}),
|
||||||
|
[onError],
|
||||||
|
);
|
||||||
|
|
||||||
const handleData = (data: OptionsType) => {
|
const handleData = (data: OptionsType) => {
|
||||||
let mergedData: OptionsType = [];
|
let mergedData: OptionsType = [];
|
||||||
|
@ -391,13 +395,13 @@ const Select = ({
|
||||||
setAllValuesLoaded(true);
|
setAllValuesLoaded(true);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(onError)
|
.catch(internalOnError)
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
setIsTyping(false);
|
setIsTyping(false);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[allValuesLoaded, fetchOnlyOnSearch, options],
|
[allValuesLoaded, fetchOnlyOnSearch, internalOnError, options],
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleOnSearch = useMemo(
|
const handleOnSearch = useMemo(
|
||||||
|
|
Loading…
Reference in New Issue