From 77d5216e7f9bf12ac782abee550d2991a9dc9f97 Mon Sep 17 00:00:00 2001 From: "Hugh A. Miles II" Date: Tue, 3 Oct 2023 03:07:19 +0000 Subject: [PATCH 1/5] hide description if empty --- .../src/pages/AllEntities/index.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/pages/AllEntities/index.tsx b/superset-frontend/src/pages/AllEntities/index.tsx index 63d5883537cd9..2076f43bb410b 100644 --- a/superset-frontend/src/pages/AllEntities/index.tsx +++ b/superset-frontend/src/pages/AllEntities/index.tsx @@ -97,22 +97,28 @@ function AllEntities() { label: t('dataset name'), }; - const description: Description = { - type: MetadataType.DESCRIPTION, - value: tag?.description || '', - }; + const items = []; + if (tag?.description) { + const description: Description = { + type: MetadataType.DESCRIPTION, + value: tag?.description || '', + }; + items.push(description); + } const owner: Owner = { type: MetadataType.OWNER, createdBy: `${tag?.created_by.first_name} ${tag?.created_by.last_name}`, createdOn: tag?.created_on_delta_humanized || '', }; + items.push(owner); + const lastModified: LastModified = { type: MetadataType.LAST_MODIFIED, value: tag?.changed_on_delta_humanized || '', modifiedBy: `${tag?.changed_by.first_name} ${tag?.changed_by.last_name}`, }; - const items = [description, owner, lastModified]; + items.push(lastModified); useEffect(() => { // fetch single tag met From 2e588d8ad5eec6f232154f56efde52bca08fd110 Mon Sep 17 00:00:00 2001 From: "Hugh A. Miles II" Date: Tue, 3 Oct 2023 03:17:19 +0000 Subject: [PATCH 2/5] fix margin on btn margin --- superset-frontend/src/pages/AllEntities/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/superset-frontend/src/pages/AllEntities/index.tsx b/superset-frontend/src/pages/AllEntities/index.tsx index 2076f43bb410b..8d51291057876 100644 --- a/superset-frontend/src/pages/AllEntities/index.tsx +++ b/superset-frontend/src/pages/AllEntities/index.tsx @@ -165,6 +165,7 @@ function AllEntities() { data-test="bulk-select-action" buttonStyle="secondary" onClick={() => setShowTagModal(true)} + showMarginRight={false} > {t('Edit Tag')}{' '} From ac68e79514f49967341f780167e860f906e1f108 Mon Sep 17 00:00:00 2001 From: "Hugh A. Miles II" Date: Tue, 3 Oct 2023 03:28:20 +0000 Subject: [PATCH 3/5] add spacing and added resource names --- .../src/features/tags/BulkTagModal.tsx | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/superset-frontend/src/features/tags/BulkTagModal.tsx b/superset-frontend/src/features/tags/BulkTagModal.tsx index 3fff056f41329..fdf03f884b239 100644 --- a/superset-frontend/src/features/tags/BulkTagModal.tsx +++ b/superset-frontend/src/features/tags/BulkTagModal.tsx @@ -17,7 +17,7 @@ * under the License. */ import React, { useState, useEffect } from 'react'; -import { t, SupersetClient } from '@superset-ui/core'; +import { t, styled, SupersetClient } from '@superset-ui/core'; import { FormLabel } from 'src/components/Form'; import Modal from 'src/components/Modal'; import AsyncSelect from 'src/components/Select/AsyncSelect'; @@ -25,6 +25,12 @@ import Button from 'src/components/Button'; import { loadTags } from 'src/components/Tags/utils'; import { TaggableResourceOption } from 'src/features/tags/TagModal'; +const BulkTagModalContainer = styled.div` + .bulk-tag-text { + margin-bottom: ${({ theme }) => theme.gridUnit * 2.5}px; + } +`; + interface BulkTagModalProps { onHide: () => void; refreshData: () => void; @@ -61,7 +67,7 @@ const BulkTagModal: React.FC = ({ }, }) .then(({ json = {} }) => { - addSuccessToast(t('Tagged %s items', selected.length)); + addSuccessToast(t('Tagged %s %ss', selected.length, resourceName)); }) .catch(err => { addDangerToast(t('Failed to tag items')); @@ -99,9 +105,14 @@ const BulkTagModal: React.FC = ({ } > - <> - <>{t('You are adding tags to the %s entities', selected.length)} -
+ +
+ {t( + 'You are adding tags to the %s %ss', + selected.length, + resourceName, + )} +
{t('tags')} = ({ placeholder={t('Select Tags')} mode="multiple" /> - +
); }; From c18f03345b702f41267e71a93d2eedecc0a2211f Mon Sep 17 00:00:00 2001 From: "Hugh A. Miles II" Date: Tue, 3 Oct 2023 03:29:11 +0000 Subject: [PATCH 4/5] add spacing and added resource names --- superset-frontend/src/features/tags/BulkTagModal.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/superset-frontend/src/features/tags/BulkTagModal.tsx b/superset-frontend/src/features/tags/BulkTagModal.tsx index fdf03f884b239..9854cf3d2a118 100644 --- a/superset-frontend/src/features/tags/BulkTagModal.tsx +++ b/superset-frontend/src/features/tags/BulkTagModal.tsx @@ -107,11 +107,7 @@ const BulkTagModal: React.FC = ({ >
- {t( - 'You are adding tags to the %s %ss', - selected.length, - resourceName, - )} + {t('You are adding tags to %s %ss', selected.length, resourceName)}
{t('tags')} Date: Tue, 3 Oct 2023 03:45:59 +0000 Subject: [PATCH 5/5] fix max height on create tag dropdowns --- .../src/features/tags/TagModal.tsx | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/superset-frontend/src/features/tags/TagModal.tsx b/superset-frontend/src/features/tags/TagModal.tsx index 90d6391e8b554..fde448d4b48fd 100644 --- a/superset-frontend/src/features/tags/TagModal.tsx +++ b/superset-frontend/src/features/tags/TagModal.tsx @@ -30,7 +30,10 @@ import { fetchObjects } from 'src/features/tags/tags'; const StyledModalBody = styled.div` .ant-select-dropdown { - max-height: ${({ theme }) => theme.gridUnit * 25}px; + max-height: ${({ theme }) => theme.gridUnit * 40}px; + } + .tag-input { + margin-bottom: ${({ theme }) => theme.gridUnit * 3}px; } `; @@ -272,21 +275,24 @@ const TagModal: React.FC = ({ } > - {t('Tag name')} - - {t('Description')} - - + {t('Tag name')} + + {t('Description')} + + = ({ allowClear /> = ({ allowClear />