From 14b9c482a015c714baf1d57ea637ad69d10865da Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Thu, 9 Nov 2023 20:16:17 +0530 Subject: [PATCH] fix(ui): supported tooltip descriptions for domain types (#13909) * supported tooltip description for domain types * localization keys * changes as per comments --- .../AddDomainForm/AddDomainForm.component.tsx | 6 ++++ .../DocumentationTab.component.tsx | 15 ++++++++-- .../ui/src/components/Domain/domain.less | 11 +++++++ .../ui/src/components/Form/Form.interface.ts | 4 ++- .../ui/src/components/Form/FormItemLabel.tsx | 10 ++++++- .../ui/src/constants/Domain.constants.ts | 29 +++++++++++++++++++ .../ui/src/interface/FormUtils.interface.ts | 2 +- .../ui/src/locale/languages/de-de.json | 6 ++++ .../ui/src/locale/languages/en-us.json | 6 ++++ .../ui/src/locale/languages/es-es.json | 6 ++++ .../ui/src/locale/languages/fr-fr.json | 6 ++++ .../ui/src/locale/languages/ja-jp.json | 6 ++++ .../ui/src/locale/languages/pt-br.json | 6 ++++ .../ui/src/locale/languages/ru-ru.json | 6 ++++ .../ui/src/locale/languages/zh-cn.json | 6 ++++ .../resources/ui/src/utils/DomainUtils.tsx | 22 +++++++++++++- .../main/resources/ui/src/utils/formUtils.tsx | 2 ++ 17 files changed, 143 insertions(+), 6 deletions(-) create mode 100644 openmetadata-ui/src/main/resources/ui/src/constants/Domain.constants.ts diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Domain/AddDomainForm/AddDomainForm.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Domain/AddDomainForm/AddDomainForm.component.tsx index 7581d2267e8..93b1affb3c4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Domain/AddDomainForm/AddDomainForm.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Domain/AddDomainForm/AddDomainForm.component.tsx @@ -35,9 +35,11 @@ import { FieldTypes, FormItemLayout, } from '../../../interface/FormUtils.interface'; +import { domainTypeTooltipDataRender } from '../../../utils/DomainUtils'; import { getEntityName } from '../../../utils/EntityUtils'; import { generateFormFields, getField } from '../../../utils/formUtils'; import { checkPermission } from '../../../utils/PermissionsUtils'; +import '../domain.less'; import { DomainFormType } from '../DomainPage.interface'; import { AddDomainFormProps } from './AddDomainForm.interface'; @@ -139,9 +141,13 @@ const AddDomainForm = ({ label: t('label.domain-type'), id: 'root/domainType', type: FieldTypes.SELECT, + helperText: domainTypeTooltipDataRender(), props: { 'data-testid': 'domainType', options: domainTypeArray, + overlayClassName: 'domain-type-tooltip-container', + tooltipPlacement: 'topLeft', + tooltipAlign: { targetOffset: [18, 0] }, }, }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainTabs/DocumentationTab/DocumentationTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainTabs/DocumentationTab/DocumentationTab.component.tsx index 264e72b4743..770e8cc3f91 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainTabs/DocumentationTab/DocumentationTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainTabs/DocumentationTab/DocumentationTab.component.tsx @@ -37,10 +37,14 @@ import { ChangeDescription, EntityReference, } from '../../../../generated/entity/type'; -import { getUserNames } from '../../../../utils/DomainUtils'; +import { + domainTypeTooltipDataRender, + getUserNames, +} from '../../../../utils/DomainUtils'; import { getEntityName } from '../../../../utils/EntityUtils'; import { getEntityVersionByField } from '../../../../utils/EntityVersionUtils'; import { checkPermission } from '../../../../utils/PermissionsUtils'; +import FormItemLabel from '../../../Form/FormItemLabel'; import '../../domain.less'; import { DocumentationEntity, @@ -281,8 +285,15 @@ const DocumentationTab = ({ - {t('label.domain-type')} + + {editAllPermission && (domain as Domain).domainType && (