From c705586a6375faac5b5017d51fb477c672eed057 Mon Sep 17 00:00:00 2001 From: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> Date: Fri, 13 Oct 2023 13:04:38 +0530 Subject: [PATCH] feat(ui): support table partitioned details (#13294) * feat(ui): support table partitioned details * fix import --------- Co-authored-by: Sriharsha Chintalapani --- .../ui/src/locale/languages/en-us.json | 1 + .../ui/src/locale/languages/es-es.json | 1 + .../ui/src/locale/languages/fr-fr.json | 1 + .../ui/src/locale/languages/ja-jp.json | 1 + .../ui/src/locale/languages/pt-br.json | 1 + .../ui/src/locale/languages/ru-ru.json | 1 + .../ui/src/locale/languages/zh-cn.json | 1 + .../PartitionedKeys.component.tsx | 37 +++++++++++++++++++ .../TableDetailsPageV1/TableDetailsPageV1.tsx | 4 ++ 9 files changed, 48 insertions(+) create mode 100644 openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/PartitionedKeys/PartitionedKeys.component.tsx diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json index 521fb86b4ef..0e69122d4a6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json @@ -970,6 +970,7 @@ "table-entity-text": "Table {{entityText}}", "table-lowercase": "table", "table-lowercase-plural": "tables", + "table-partitioned": "Table Partitioned", "table-plural": "Tables", "table-profile": "Table Profile", "table-tests-summary": "Table Tests Summary", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json index a627a8b962f..6976bbefd17 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json @@ -970,6 +970,7 @@ "table-entity-text": "Tabla {{entityText}}", "table-lowercase": "tabla", "table-lowercase-plural": "tablas", + "table-partitioned": "Table Partitioned", "table-plural": "Tablas", "table-profile": "Table Profile", "table-tests-summary": "Resumen de Tests de la Tabla", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json index c7daa29eb78..f24e7e101ec 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json @@ -970,6 +970,7 @@ "table-entity-text": "Table {{entityText}}", "table-lowercase": "table", "table-lowercase-plural": "tables", + "table-partitioned": "Table Partitioned", "table-plural": "Tables", "table-profile": "Profil de Table", "table-tests-summary": "Résumé des Tests de la Table", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json index 8a5303f445c..c49c80847a9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json @@ -970,6 +970,7 @@ "table-entity-text": "テーブル {{entityText}}", "table-lowercase": "テーブル", "table-lowercase-plural": "tables", + "table-partitioned": "Table Partitioned", "table-plural": "テーブル", "table-profile": "Table Profile", "table-tests-summary": "Table Tests Summary", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json index 8d6b58575b6..4ae0f57bab3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json @@ -970,6 +970,7 @@ "table-entity-text": "Tabela {{entityText}}", "table-lowercase": "tabela", "table-lowercase-plural": "tables", + "table-partitioned": "Table Partitioned", "table-plural": "Tabelas", "table-profile": "Table Profile", "table-tests-summary": "Resumo dos Testes da Tabela", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json index 1da7abd1c20..33a2a654c97 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json @@ -970,6 +970,7 @@ "table-entity-text": "Таблица {{entityText}}", "table-lowercase": "таблица", "table-lowercase-plural": "таблицы", + "table-partitioned": "Table Partitioned", "table-plural": "Таблицы", "table-profile": "Профиль таблицы", "table-tests-summary": "Сводка по тестам", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json index 95a266603da..f09ea323b7e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json @@ -970,6 +970,7 @@ "table-entity-text": "数据表{{entityText}}", "table-lowercase": "数据表", "table-lowercase-plural": "数据表", + "table-partitioned": "Table Partitioned", "table-plural": "数据表", "table-profile": "数据表分析", "table-tests-summary": "数据表测试概要", diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/PartitionedKeys/PartitionedKeys.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/PartitionedKeys/PartitionedKeys.component.tsx new file mode 100644 index 00000000000..9d1aa6b84b3 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/PartitionedKeys/PartitionedKeys.component.tsx @@ -0,0 +1,37 @@ +/* + * Copyright 2023 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Space, Typography } from 'antd'; +import { t } from 'i18next'; +import React from 'react'; +import { TablePartition } from '../../../generated/entity/data/table'; + +interface PartitionedKeysProps { + tablePartition: TablePartition; +} + +export const PartitionedKeys = ({ tablePartition }: PartitionedKeysProps) => { + return ( + + + {t('label.table-partitioned')} + + + {`${t('label.interval')} - ${tablePartition.intervalType}`} + + + {`${t('label.column-plural')} - + ${tablePartition.columns?.map((column) => column)}`} + + + ); +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx index fec2c73063f..c4dc3fb7251 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx @@ -93,6 +93,7 @@ import { getTagsWithoutTier, getTierTags } from '../../utils/TableUtils'; import { createTagObject, updateTierTag } from '../../utils/TagsUtils'; import { showErrorToast, showSuccessToast } from '../../utils/ToastUtils'; import { FrequentlyJoinedTables } from './FrequentlyJoinedTables/FrequentlyJoinedTables.component'; +import { PartitionedKeys } from './PartitionedKeys/PartitionedKeys.component'; import './table-details-page-v1.less'; import TableConstraints from './TableConstraints/TableConstraints'; @@ -530,6 +531,9 @@ const TableDetailsPageV1 = () => { onThreadLinkSelect={onThreadLinkSelect} /> + {tableDetails?.tablePartition ? ( + + ) : null}