{
+ setTagName('');
+ setDescription('');
+ setDashboardsToTag([]);
+ setChartsToTag([]);
+ setSavedQueriesToTag([]);
+ onHide();
+ }}
+ show={show}
+ footer={
+
+
+
+
+ }
+ >
+ <>
+ {t('Tag Name')}
+
+ {t('Description')}
+
+
+
+ handleOptionChange(TaggableResources.Dashboard, value)
+ }
+ header={{t('Dashboards')}}
+ allowClear
+ />
+ handleOptionChange(TaggableResources.Chart, value)}
+ header={{t('Charts')}}
+ allowClear
+ />
+
+ handleOptionChange(TaggableResources.SavedQuery, value)
+ }
+ header={{t('Saved Queries')}}
+ allowClear
+ />
+ >
+
+ );
+};
+
+export default TagModal;
diff --git a/superset-frontend/src/features/tags/tags.ts b/superset-frontend/src/features/tags/tags.ts
index ff0b8f3a339d3..97b5b094b3dbe 100644
--- a/superset-frontend/src/features/tags/tags.ts
+++ b/superset-frontend/src/features/tags/tags.ts
@@ -55,6 +55,16 @@ export function fetchAllTags(
.catch(response => error(response));
}
+export function fetchSingleTag(
+ name: string,
+ callback: (json: JsonObject) => void,
+ error: (response: Response) => void,
+) {
+ SupersetClient.get({ endpoint: `/api/v1/tag` })
+ .then(({ json }) => callback(json))
+ .catch(response => error(response));
+}
+
export function fetchTags(
{
objectType,
diff --git a/superset-frontend/src/pages/Tags/index.tsx b/superset-frontend/src/pages/Tags/index.tsx
index 03a2b1da9c884..fa623f03c5bea 100644
--- a/superset-frontend/src/pages/Tags/index.tsx
+++ b/superset-frontend/src/pages/Tags/index.tsx
@@ -16,8 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
+import React, { useMemo, useCallback, useState } from 'react';
import { isFeatureEnabled, FeatureFlag, t } from '@superset-ui/core';
-import React, { useMemo, useCallback } from 'react';
import {
createFetchRelated,
createErrorHandler,
@@ -41,23 +41,9 @@ import { deleteTags } from 'src/features/tags/tags';
import { Tag as AntdTag } from 'antd';
import { Tag } from 'src/views/CRUD/types';
import TagCard from 'src/features/tags/TagCard';
+import TagModal from 'src/features/tags/TagModal';
import FaveStar from 'src/components/FaveStar';
-const emptyState = {
- title: t('No Tags created'),
- image: 'dashboard.svg',
- description:
- 'Create a new tag and assign it to existing entities like charts or dashboards',
- buttonAction: () => {},
- // todo(hughhh): Add this back once Tag modal is functional
- // buttonText: (
- // <>
- //