fix(tags): fix Bulk tag modal dropdown clipping and stale tag cache (#39210)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
(cherry picked from commit d915e4f3ff)
This commit is contained in:
Maxime Beauchemin
2026-04-08 16:28:13 -07:00
committed by Michael S. Molina
parent f59eaff400
commit ccfe29e83f
3 changed files with 6 additions and 11 deletions

View File

@@ -26,15 +26,6 @@ import {
import type { TagType } from 'src/types/TagType';
import rison from 'rison';
import { cacheWrapper } from 'src/utils/cacheWrapper';
const localCache = new Map<string, any>();
const cachedSupersetGet = cacheWrapper(
SupersetClient.get,
localCache,
({ endpoint }) => endpoint || '',
);
type SelectTagsValue = {
value: number | undefined;
@@ -75,7 +66,7 @@ export const loadTags = async (
return errorText;
};
return cachedSupersetGet({
return SupersetClient.get({
endpoint: `/api/v1/tag/?q=${query}`,
})
.then(response => {

View File

@@ -125,7 +125,7 @@ const BulkTagModal: FC<BulkTagModalProps> = ({
<div className="bulk-tag-text">
{t('You are adding tags to %s %ss', selected.length, resourceName)}
</div>
<FormLabel>{t('tags')}</FormLabel>
<FormLabel>{t('Tags')}</FormLabel>
<AsyncSelect
ariaLabel="tags"
// @ts-expect-error
@@ -134,6 +134,7 @@ const BulkTagModal: FC<BulkTagModalProps> = ({
onHide={onHide}
// @ts-expect-error
onChange={tags => setTags(tags)}
getPopupContainer={() => document.body}
placeholder={t('Select Tags')}
mode="multiple"
/>

View File

@@ -332,6 +332,7 @@ const TagModal: FC<TagModalProps> = ({
onChange={value =>
handleOptionChange(TaggableResources.Dashboard, value)
}
getPopupContainer={() => document.body}
header={<FormLabel>{t('Dashboards')}</FormLabel>}
allowClear
/>
@@ -344,6 +345,7 @@ const TagModal: FC<TagModalProps> = ({
value={chartsToTag}
options={loadCharts}
onChange={value => handleOptionChange(TaggableResources.Chart, value)}
getPopupContainer={() => document.body}
header={<FormLabel>{t('Charts')}</FormLabel>}
allowClear
/>
@@ -358,6 +360,7 @@ const TagModal: FC<TagModalProps> = ({
onChange={value =>
handleOptionChange(TaggableResources.SavedQuery, value)
}
getPopupContainer={() => document.body}
header={<FormLabel>{t('Saved queries')}</FormLabel>}
allowClear
/>