mirror of
https://github.com/apache/superset.git
synced 2026-07-20 13:45:47 +00:00
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:
committed by
Michael S. Molina
parent
f59eaff400
commit
ccfe29e83f
@@ -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 => {
|
||||
|
||||
@@ -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"
|
||||
/>
|
||||
|
||||
@@ -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
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user