From c7f1c56c94e283431d12a0597b999891d8e6e75a Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Tue, 18 Oct 2022 18:02:51 +0530 Subject: [PATCH] Fix (ui) :- Tag dropdown overflow issue and added localisation (#8173) * Fix Tag dropdown overflow issue and added localisation * added missing colon --- .../EntityTable/EntityTable.component.tsx | 41 ++++++++++++------- .../resources/ui/src/components/tags/tags.tsx | 4 +- .../resources/ui/src/constants/constants.ts | 2 +- .../ui/src/locale/languages/en-us.json | 14 ++++++- .../src/main/resources/ui/src/styles/app.less | 3 ++ 5 files changed, 45 insertions(+), 19 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/EntityTable/EntityTable.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/EntityTable/EntityTable.component.tsx index 0ef20e95c5e..8cfb7e1c69d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/EntityTable/EntityTable.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/EntityTable/EntityTable.component.tsx @@ -24,6 +24,7 @@ import React, { useMemo, useState, } from 'react'; +import { useTranslation } from 'react-i18next'; import { Link, useHistory } from 'react-router-dom'; import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants'; import { getTableDetailsPath } from '../../constants/constants'; @@ -80,6 +81,7 @@ const EntityTable = ({ entityFieldTasks, }: EntityTableProps) => { const history = useHistory(); + const { t } = useTranslation(); const [searchedColumns, setSearchedColumns] = useState([]); @@ -391,14 +393,14 @@ const EntityTable = ({ destroyTooltipOnHide content={ hasDescription - ? 'Request update description' - : 'Request description' + ? t('label.request-update-description') + : t('label.request-description') } overlayClassName="ant-popover-request-description" trigger="hover" zIndex={9999}> @@ -409,7 +411,9 @@ const EntityTable = ({ const getRequestTagsElement = (cell: Column) => { const hasTags = !isEmpty(cell?.tags || []); - const text = hasTags ? 'Update request tags' : 'Request tags'; + const text = hasTags + ? t('label.update-request-tags') + : t('label.request-tags'); return ( ); @@ -489,7 +497,9 @@ const EntityTable = ({ {record?.description ? ( ) : ( - No description + + {t('label.no-description')} + )}
@@ -501,9 +511,9 @@ const EntityTable = ({ className="tw-self-start tw-w-7 tw-h-7 focus:tw-outline-none tw-flex-none hover-cell-icon" onClick={() => handleUpdate(record, index)}> @@ -543,7 +553,7 @@ const EntityTable = ({ {checkIfJoinsAvailable(record?.name) && (
- Frequently joined columns: + {t('label.frequently-joined-columns')}: {getFrequentlyJoinedWithColumns(record?.name) @@ -640,6 +650,7 @@ const EntityTable = ({ } }}> [ { - title: 'Name', + title: t('label.name'), dataIndex: 'name', key: 'name', accessor: 'name', @@ -734,7 +745,7 @@ const EntityTable = ({ renderCell(TABLE_HEADERS_V1.name, record, index), }, { - title: 'Type', + title: t('label.type'), dataIndex: 'dataTypeDisplay', key: 'dataTypeDisplay', accessor: 'dataTypeDisplay', @@ -745,7 +756,7 @@ const EntityTable = ({ }, }, { - title: 'Description', + title: t('label.description'), dataIndex: 'description', key: 'description', accessor: 'description', @@ -753,7 +764,7 @@ const EntityTable = ({ renderCell(TABLE_HEADERS_V1.description, record, index), }, { - title: 'Tags', + title: t('label.tags'), dataIndex: 'tags', key: 'tags', accessor: 'tags', @@ -801,8 +812,8 @@ const EntityTable = ({ /> {editColumn && ( = ({ ); const tagName = showOnlyName ? tag.split(FQN_SEPARATOR_CHAR).slice(-2).join(FQN_SEPARATOR_CHAR) - : getTagDisplay(tag); + : tag; return ( = ({ )} data-testid={editable && isRemovable ? `tag-${tag}` : `add-tag`}> {startIcon} - {tagName} + {getTagDisplay(tagName)} {editable && isRemovable && (