MINOR: fix the dropdown not showing in case of no data in glossary (#16256)

* fix the dropdown not showing in case of no data in glossary

* minor fix
This commit is contained in:
Ashish Gupta 2024-05-16 14:27:56 +05:30 committed by GitHub
parent c3abcc22b6
commit fc00b61e59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -73,6 +73,7 @@ const TreeAsyncSelectList: FC<Omit<AsyncSelectListProps, 'fetchOptions'>> = ({
const form = Form.useFormInstance();
const fetchGlossaryListInternal = async () => {
setIsLoading(true);
try {
const { data } = await getGlossariesList({
limit: PAGE_SIZE_LARGE,
@ -91,11 +92,12 @@ const TreeAsyncSelectList: FC<Omit<AsyncSelectListProps, 'fetchOptions'>> = ({
const dropdownRender = (menu: React.ReactElement) => (
<>
{menu}
{isLoading ? <Loader size="small" /> : menu}
<Space className="p-sm p-b-xss p-l-xs custom-dropdown-render" size={8}>
<Button
className="update-btn"
data-testid="saveAssociatedTag"
disabled={isEmpty(glossaries)}
htmlType="submit"
loading={isSubmitLoading}
size="small"
@ -211,7 +213,6 @@ const TreeAsyncSelectList: FC<Omit<AsyncSelectListProps, 'fetchOptions'>> = ({
if (!params?.glossary) {
return;
}
setIsLoading(true);
try {
const results = await queryGlossaryTerms(params.glossary);
@ -229,8 +230,6 @@ const TreeAsyncSelectList: FC<Omit<AsyncSelectListProps, 'fetchOptions'>> = ({
);
} catch (error) {
showErrorToast(error as AxiosError);
} finally {
setIsLoading(false);
}
};
@ -282,7 +281,6 @@ const TreeAsyncSelectList: FC<Omit<AsyncSelectListProps, 'fetchOptions'>> = ({
return Promise.resolve();
}}
notFoundContent={isLoading ? <Loader size="small" /> : null}
showCheckedStrategy={TreeSelect.SHOW_ALL}
style={{ width: '100%' }}
switcherIcon={