mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-30 11:56:01 +00:00
UI : fix add owner and tier functionality on Translated entity page (#9244)
* fix add owner and tier functionality on Translated entity page * get entity info keys from enum * remove unwanted translation keys * minor changes
This commit is contained in:
parent
afa93cbba2
commit
02f17227e8
@ -31,7 +31,7 @@ import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
|
|||||||
import { EntityField } from '../../constants/Feeds.constants';
|
import { EntityField } from '../../constants/Feeds.constants';
|
||||||
import { observerOptions } from '../../constants/Mydata.constants';
|
import { observerOptions } from '../../constants/Mydata.constants';
|
||||||
import { SettledStatus } from '../../enums/axios.enum';
|
import { SettledStatus } from '../../enums/axios.enum';
|
||||||
import { EntityType } from '../../enums/entity.enum';
|
import { EntityInfo, EntityType } from '../../enums/entity.enum';
|
||||||
import { OwnerType } from '../../enums/user.enum';
|
import { OwnerType } from '../../enums/user.enum';
|
||||||
import { Dashboard } from '../../generated/entity/data/dashboard';
|
import { Dashboard } from '../../generated/entity/data/dashboard';
|
||||||
import { ThreadType } from '../../generated/entity/feed/thread';
|
import { ThreadType } from '../../generated/entity/feed/thread';
|
||||||
@ -230,7 +230,7 @@ const DashboardDetails = ({
|
|||||||
|
|
||||||
const extraInfo: Array<ExtraInfo> = [
|
const extraInfo: Array<ExtraInfo> = [
|
||||||
{
|
{
|
||||||
key: 'Owner',
|
key: EntityInfo.OWNER,
|
||||||
value: getOwnerValue(owner),
|
value: getOwnerValue(owner),
|
||||||
placeholderText: getEntityPlaceHolder(
|
placeholderText: getEntityPlaceHolder(
|
||||||
getEntityName(owner),
|
getEntityName(owner),
|
||||||
@ -241,11 +241,11 @@ const DashboardDetails = ({
|
|||||||
profileName: owner?.type === OwnerType.USER ? owner?.name : undefined,
|
profileName: owner?.type === OwnerType.USER ? owner?.name : undefined,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'Tier',
|
key: EntityInfo.TIER,
|
||||||
value: tier?.tagFQN ? tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : '',
|
value: tier?.tagFQN ? tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: `${serviceType} Url`,
|
key: `${serviceType} ${EntityInfo.URL}`,
|
||||||
value: dashboardUrl,
|
value: dashboardUrl,
|
||||||
placeholderText: entityName,
|
placeholderText: entityName,
|
||||||
isLink: true,
|
isLink: true,
|
||||||
|
@ -24,7 +24,7 @@ import { ROUTES } from '../../constants/constants';
|
|||||||
import { EntityField } from '../../constants/Feeds.constants';
|
import { EntityField } from '../../constants/Feeds.constants';
|
||||||
import { observerOptions } from '../../constants/Mydata.constants';
|
import { observerOptions } from '../../constants/Mydata.constants';
|
||||||
import { CSMode } from '../../enums/codemirror.enum';
|
import { CSMode } from '../../enums/codemirror.enum';
|
||||||
import { EntityType, FqnPart } from '../../enums/entity.enum';
|
import { EntityInfo, EntityType, FqnPart } from '../../enums/entity.enum';
|
||||||
import { OwnerType } from '../../enums/user.enum';
|
import { OwnerType } from '../../enums/user.enum';
|
||||||
import {
|
import {
|
||||||
JoinedWith,
|
JoinedWith,
|
||||||
@ -382,7 +382,7 @@ const DatasetDetails: React.FC<DatasetDetailsProps> = ({
|
|||||||
|
|
||||||
const extraInfo: Array<ExtraInfo> = [
|
const extraInfo: Array<ExtraInfo> = [
|
||||||
{
|
{
|
||||||
key: t('label.owner'),
|
key: EntityInfo.OWNER,
|
||||||
value: getOwnerValue(owner),
|
value: getOwnerValue(owner),
|
||||||
placeholderText: getEntityPlaceHolder(
|
placeholderText: getEntityPlaceHolder(
|
||||||
getEntityName(owner),
|
getEntityName(owner),
|
||||||
@ -395,23 +395,23 @@ const DatasetDetails: React.FC<DatasetDetailsProps> = ({
|
|||||||
profileName: owner?.type === OwnerType.USER ? owner?.name : undefined,
|
profileName: owner?.type === OwnerType.USER ? owner?.name : undefined,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: t('label.tier'),
|
key: EntityInfo.TIER,
|
||||||
value: tier?.tagFQN ? tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : '',
|
value: tier?.tagFQN ? tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : '',
|
||||||
},
|
},
|
||||||
{ key: t('label.type'), value: `${tableType}`, showLabel: true },
|
{ key: EntityInfo.TYPE, value: `${tableType}`, showLabel: true },
|
||||||
{ value: usage },
|
{ value: usage },
|
||||||
{ value: `${weeklyUsageCount} Queries` },
|
{ value: `${weeklyUsageCount} ${t('label.query-plural')}` },
|
||||||
{
|
{
|
||||||
key: t('label.column-plural'),
|
key: EntityInfo.COLUMNS,
|
||||||
value:
|
value:
|
||||||
tableProfile && tableProfile?.columnCount
|
tableProfile && tableProfile?.columnCount
|
||||||
? `${tableProfile.columnCount} Columns`
|
? `${tableProfile.columnCount} ${t('label.columns-plural')}`
|
||||||
: columns.length
|
: columns.length
|
||||||
? `${columns.length} Columns`
|
? `${columns.length} ${t('label.columns-plural')}`
|
||||||
: '',
|
: '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: t('label.row-plural'),
|
key: EntityInfo.ROWS,
|
||||||
value: prepareTableRowInfo(),
|
value: prepareTableRowInfo(),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -36,7 +36,7 @@ import {
|
|||||||
} from '../../constants/constants';
|
} from '../../constants/constants';
|
||||||
import { EntityField } from '../../constants/Feeds.constants';
|
import { EntityField } from '../../constants/Feeds.constants';
|
||||||
import { observerOptions } from '../../constants/Mydata.constants';
|
import { observerOptions } from '../../constants/Mydata.constants';
|
||||||
import { EntityType } from '../../enums/entity.enum';
|
import { EntityInfo, EntityType } from '../../enums/entity.enum';
|
||||||
import { ServiceCategory } from '../../enums/service.enum';
|
import { ServiceCategory } from '../../enums/service.enum';
|
||||||
import { OwnerType } from '../../enums/user.enum';
|
import { OwnerType } from '../../enums/user.enum';
|
||||||
import { MlHyperParameter } from '../../generated/api/data/createMlModel';
|
import { MlHyperParameter } from '../../generated/api/data/createMlModel';
|
||||||
@ -173,7 +173,7 @@ const MlModelDetail: FC<MlModelDetailProp> = ({
|
|||||||
|
|
||||||
const mlModelPageInfo: ExtraInfo[] = [
|
const mlModelPageInfo: ExtraInfo[] = [
|
||||||
{
|
{
|
||||||
key: t('label.owner'),
|
key: EntityInfo.OWNER,
|
||||||
value: getOwnerValue(mlModelDetail.owner ?? ({} as EntityReference)),
|
value: getOwnerValue(mlModelDetail.owner ?? ({} as EntityReference)),
|
||||||
placeholderText: getEntityPlaceHolder(
|
placeholderText: getEntityPlaceHolder(
|
||||||
getEntityName(mlModelDetail.owner),
|
getEntityName(mlModelDetail.owner),
|
||||||
@ -187,23 +187,23 @@ const MlModelDetail: FC<MlModelDetailProp> = ({
|
|||||||
: undefined,
|
: undefined,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: t('label.tier'),
|
key: EntityInfo.TIER,
|
||||||
value: mlModelTier?.tagFQN
|
value: mlModelTier?.tagFQN
|
||||||
? mlModelTier.tagFQN.split(FQN_SEPARATOR_CHAR)[1]
|
? mlModelTier.tagFQN.split(FQN_SEPARATOR_CHAR)[1]
|
||||||
: '',
|
: '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: t('label.algorithm'),
|
key: EntityInfo.ALGORITHM,
|
||||||
value: mlModelDetail.algorithm,
|
value: mlModelDetail.algorithm,
|
||||||
showLabel: true,
|
showLabel: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: t('label.target'),
|
key: EntityInfo.TARGET,
|
||||||
value: mlModelDetail.target,
|
value: mlModelDetail.target,
|
||||||
showLabel: true,
|
showLabel: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: t('label.server'),
|
key: EntityInfo.SERVER,
|
||||||
value: mlModelDetail.server,
|
value: mlModelDetail.server,
|
||||||
showLabel: true,
|
showLabel: true,
|
||||||
isLink: true,
|
isLink: true,
|
||||||
@ -211,7 +211,7 @@ const MlModelDetail: FC<MlModelDetailProp> = ({
|
|||||||
...(!isUndefined(mlModelDetail.dashboard)
|
...(!isUndefined(mlModelDetail.dashboard)
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
key: t('label.dashboard'),
|
key: EntityInfo.DASHBOARD,
|
||||||
value: getDashboardDetailsPath(
|
value: getDashboardDetailsPath(
|
||||||
mlModelDetail.dashboard?.fullyQualifiedName as string
|
mlModelDetail.dashboard?.fullyQualifiedName as string
|
||||||
),
|
),
|
||||||
|
@ -47,7 +47,7 @@ import {
|
|||||||
PIPELINE_DETAILS_TABS,
|
PIPELINE_DETAILS_TABS,
|
||||||
PIPELINE_TASK_TABS,
|
PIPELINE_TASK_TABS,
|
||||||
} from '../../constants/pipeline.constants';
|
} from '../../constants/pipeline.constants';
|
||||||
import { EntityType } from '../../enums/entity.enum';
|
import { EntityInfo, EntityType } from '../../enums/entity.enum';
|
||||||
import { FeedFilter } from '../../enums/mydata.enum';
|
import { FeedFilter } from '../../enums/mydata.enum';
|
||||||
import { OwnerType } from '../../enums/user.enum';
|
import { OwnerType } from '../../enums/user.enum';
|
||||||
import { CreateThread } from '../../generated/api/feed/createThread';
|
import { CreateThread } from '../../generated/api/feed/createThread';
|
||||||
@ -251,7 +251,7 @@ const PipelineDetails = ({
|
|||||||
|
|
||||||
const extraInfo: Array<ExtraInfo> = [
|
const extraInfo: Array<ExtraInfo> = [
|
||||||
{
|
{
|
||||||
key: 'Owner',
|
key: EntityInfo.OWNER,
|
||||||
value: owner && getOwnerValue(owner),
|
value: owner && getOwnerValue(owner),
|
||||||
placeholderText: getEntityPlaceHolder(
|
placeholderText: getEntityPlaceHolder(
|
||||||
getEntityName(owner),
|
getEntityName(owner),
|
||||||
@ -262,11 +262,11 @@ const PipelineDetails = ({
|
|||||||
profileName: owner?.type === OwnerType.USER ? owner?.name : undefined,
|
profileName: owner?.type === OwnerType.USER ? owner?.name : undefined,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'Tier',
|
key: EntityInfo.TIER,
|
||||||
value: tier?.tagFQN ? tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : '',
|
value: tier?.tagFQN ? tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: `${serviceType} Url`,
|
key: `${serviceType} ${EntityInfo.URL}`,
|
||||||
value: pipelineUrl,
|
value: pipelineUrl,
|
||||||
placeholderText: entityName,
|
placeholderText: entityName,
|
||||||
isLink: true,
|
isLink: true,
|
||||||
|
@ -26,7 +26,7 @@ import { restoreTopic } from '../../axiosAPIs/topicsAPI';
|
|||||||
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
|
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
|
||||||
import { EntityField } from '../../constants/Feeds.constants';
|
import { EntityField } from '../../constants/Feeds.constants';
|
||||||
import { observerOptions } from '../../constants/Mydata.constants';
|
import { observerOptions } from '../../constants/Mydata.constants';
|
||||||
import { EntityType } from '../../enums/entity.enum';
|
import { EntityInfo, EntityType } from '../../enums/entity.enum';
|
||||||
import { OwnerType } from '../../enums/user.enum';
|
import { OwnerType } from '../../enums/user.enum';
|
||||||
import { Topic } from '../../generated/entity/data/topic';
|
import { Topic } from '../../generated/entity/data/topic';
|
||||||
import { ThreadType } from '../../generated/entity/feed/thread';
|
import { ThreadType } from '../../generated/entity/feed/thread';
|
||||||
@ -167,22 +167,25 @@ const TopicDetails: React.FC<TopicDetailsProps> = ({
|
|||||||
|
|
||||||
const getConfigDetails = () => {
|
const getConfigDetails = () => {
|
||||||
return [
|
return [
|
||||||
{ key: 'Partitions', value: `${partitions} partitions` },
|
|
||||||
{
|
{
|
||||||
key: 'Replication Factor',
|
key: EntityInfo.PARTITIONS,
|
||||||
value: `${replicationFactor} replication factor`,
|
value: `${partitions} ${t('label.partitions')}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'Retention Size',
|
key: EntityInfo.REPLICATION_FACTOR,
|
||||||
value: `${bytesToSize(retentionSize)} retention size`,
|
value: `${replicationFactor} ${t('label.replication-factor')}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'Clean-up Policies',
|
key: EntityInfo.RETENTION_SIZE,
|
||||||
value: `${cleanupPolicies.join(', ')} clean-up policies`,
|
value: `${bytesToSize(retentionSize)} ${t('label.retention-size')}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'Max Message Size',
|
key: EntityInfo.CLEAN_UP_POLICIES,
|
||||||
value: `${bytesToSize(maximumMessageSize)} maximum size`,
|
value: `${cleanupPolicies.join(', ')} ${t('label.clean-up-policies')}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: EntityInfo.MAX_MESSAGE_SIZE,
|
||||||
|
value: `${bytesToSize(maximumMessageSize)} ${t('label.maximum-size')} `,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@ -262,7 +265,7 @@ const TopicDetails: React.FC<TopicDetailsProps> = ({
|
|||||||
|
|
||||||
const extraInfo: Array<ExtraInfo> = [
|
const extraInfo: Array<ExtraInfo> = [
|
||||||
{
|
{
|
||||||
key: t('label.owner'),
|
key: EntityInfo.OWNER,
|
||||||
value: getOwnerValue(owner),
|
value: getOwnerValue(owner),
|
||||||
placeholderText: getEntityPlaceHolder(
|
placeholderText: getEntityPlaceHolder(
|
||||||
getEntityName(owner),
|
getEntityName(owner),
|
||||||
@ -273,7 +276,7 @@ const TopicDetails: React.FC<TopicDetailsProps> = ({
|
|||||||
profileName: owner?.type === OwnerType.USER ? owner?.name : undefined,
|
profileName: owner?.type === OwnerType.USER ? owner?.name : undefined,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: t('label.tier'),
|
key: EntityInfo.TIER,
|
||||||
value: tier?.tagFQN ? tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : '',
|
value: tier?.tagFQN ? tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : '',
|
||||||
},
|
},
|
||||||
...getConfigDetails(),
|
...getConfigDetails(),
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
import { Button as AntdButton, Dropdown, Space } from 'antd';
|
import { Button as AntdButton, Dropdown, Space } from 'antd';
|
||||||
import Tooltip, { RenderFunction } from 'antd/lib/tooltip';
|
import Tooltip, { RenderFunction } from 'antd/lib/tooltip';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { isString, isUndefined } from 'lodash';
|
import { isString, isUndefined, toLower } from 'lodash';
|
||||||
import { ExtraInfo } from 'Models';
|
import { ExtraInfo } from 'Models';
|
||||||
import React, { useCallback, useMemo, useState } from 'react';
|
import React, { useCallback, useMemo, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -138,7 +138,7 @@ const EntitySummaryDetails = ({
|
|||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{t('label.no-entity', { entity: 'Owner' })}
|
{t('label.no-entity', { entity: t('label.owner') })}
|
||||||
<span
|
<span
|
||||||
data-testid={`edit-${data.key}-icon`}
|
data-testid={`edit-${data.key}-icon`}
|
||||||
onClick={() => setShow(!show)}>
|
onClick={() => setShow(!show)}>
|
||||||
@ -155,7 +155,7 @@ const EntitySummaryDetails = ({
|
|||||||
retVal =
|
retVal =
|
||||||
!displayVal || displayVal === '--' ? (
|
!displayVal || displayVal === '--' ? (
|
||||||
<>
|
<>
|
||||||
{t('label.no-entity', { entity: 'Tier' })}
|
{t('label.no-entity', { entity: t('label.tier') })}
|
||||||
<Dropdown
|
<Dropdown
|
||||||
overlay={
|
overlay={
|
||||||
<TierCard
|
<TierCard
|
||||||
@ -198,9 +198,11 @@ const EntitySummaryDetails = ({
|
|||||||
{data.key
|
{data.key
|
||||||
? displayVal
|
? displayVal
|
||||||
? data.showLabel
|
? data.showLabel
|
||||||
? `${data.key}: `
|
? `${t(`label.${toLower(data.key)}`)} : `
|
||||||
: null
|
: null
|
||||||
: `${t('label.no-entity', { entity: data.key })}`
|
: `${t('label.no-entity', {
|
||||||
|
entity: t(`label.${toLower(data.key)}`),
|
||||||
|
})}`
|
||||||
: null}
|
: null}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -97,3 +97,21 @@ export enum FqnPart {
|
|||||||
Column,
|
Column,
|
||||||
NestedColumn,
|
NestedColumn,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum EntityInfo {
|
||||||
|
OWNER = 'Owner',
|
||||||
|
TIER = 'Tier',
|
||||||
|
TYPE = 'Type',
|
||||||
|
COLUMNS = 'Columns',
|
||||||
|
ROWS = 'row-plural',
|
||||||
|
URL = 'Url',
|
||||||
|
ALGORITHM = 'Algorithm',
|
||||||
|
TARGET = 'Target',
|
||||||
|
SERVER = 'Server',
|
||||||
|
DASHBOARD = 'Dashboard',
|
||||||
|
PARTITIONS = 'Partitions',
|
||||||
|
REPLICATION_FACTOR = 'Replication Factor',
|
||||||
|
RETENTION_SIZE = 'Retention Size',
|
||||||
|
CLEAN_UP_POLICIES = 'Clean-up Policies',
|
||||||
|
MAX_MESSAGE_SIZE = 'Max Message Size',
|
||||||
|
}
|
||||||
|
@ -310,7 +310,6 @@
|
|||||||
"clear-all": "Clear All",
|
"clear-all": "Clear All",
|
||||||
"view-less": "View less",
|
"view-less": "View less",
|
||||||
"view-more": "View more",
|
"view-more": "View more",
|
||||||
"column-plural": "Columns",
|
|
||||||
"field-plural": "Fields",
|
"field-plural": "Fields",
|
||||||
"delete-group": "Delete Group",
|
"delete-group": "Delete Group",
|
||||||
"add-display-name": "Add display name",
|
"add-display-name": "Add display name",
|
||||||
@ -463,7 +462,12 @@
|
|||||||
"pipeline-lowercase": "pipeline",
|
"pipeline-lowercase": "pipeline",
|
||||||
"service-lowercase": "service",
|
"service-lowercase": "service",
|
||||||
"query-lowercase": "query",
|
"query-lowercase": "query",
|
||||||
"table-lowercase": "table"
|
"table-lowercase": "table",
|
||||||
|
"partitions": "Partitions",
|
||||||
|
"replication-factor": "replication factor",
|
||||||
|
"retention-size": "retention-size",
|
||||||
|
"clean-up-policies": "clean-up policies",
|
||||||
|
"maximum-size": "maximum size"
|
||||||
},
|
},
|
||||||
"message": {
|
"message": {
|
||||||
"service-email-required": "Service account Email is required",
|
"service-email-required": "Service account Email is required",
|
||||||
|
@ -313,7 +313,6 @@
|
|||||||
"clear-all": "Effacer tout",
|
"clear-all": "Effacer tout",
|
||||||
"view-less": "Voir moins",
|
"view-less": "Voir moins",
|
||||||
"view-more": "Voir plus",
|
"view-more": "Voir plus",
|
||||||
"column-plural": "Colonnes",
|
|
||||||
"field-plural": "Champs",
|
"field-plural": "Champs",
|
||||||
"delete-group": "Supprimer le Groupe",
|
"delete-group": "Supprimer le Groupe",
|
||||||
"add-display-name": "Ajouter un nom d'affichage",
|
"add-display-name": "Ajouter un nom d'affichage",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user