From 15ff01043534ebe15471186097fee59c1a692696 Mon Sep 17 00:00:00 2001 From: bogo96 Date: Tue, 24 Nov 2020 03:53:17 +0900 Subject: [PATCH] Fix to display column statics (#771) Signed-off-by: hyein Co-authored-by: hyein --- .../static/js/components/ColumnList/index.tsx | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/frontend/amundsen_application/static/js/components/ColumnList/index.tsx b/frontend/amundsen_application/static/js/components/ColumnList/index.tsx index 8972fd27ee..7486c4389f 100644 --- a/frontend/amundsen_application/static/js/components/ColumnList/index.tsx +++ b/frontend/amundsen_application/static/js/components/ColumnList/index.tsx @@ -21,6 +21,7 @@ import { import { TableColumn, + TableColumnStats, RequestMetadataType, SortCriteria, SortDirection, @@ -30,6 +31,7 @@ import { import BadgeList from 'components/common/BadgeList'; import ColumnType from './ColumnType'; import ColumnDescEditableText from './ColumnDescEditableText'; +import ColumnStats from './ColumnStats'; import { getStatsInfoText } from './utils'; import { @@ -65,18 +67,11 @@ type DatatypeType = { type: string; }; -type StatType = { - end_epoch: number; - start_epoch: number; - stat_type: string; - stat_val: string; -}; - type FormattedDataType = { content: ContentType; type: DatatypeType; usage: number | null; - stats: StatType | null; + stats: TableColumnStats[] | null; action: string; editText: string | null; editUrl: string | null; @@ -191,15 +186,7 @@ const ExpandedRowComponent: React.FC = ( /> )} - {rowValue.stats && ( -
- {COLUMN_STATS_TITLE} - {getStatsInfoText( - rowValue.stats.start_epoch, - rowValue.stats.end_epoch - )} -
- )} + {rowValue.stats && } ); }; @@ -228,7 +215,7 @@ const ColumnList: React.FC = ({ }, sort_order: item.sort_order, usage: getUsageStat(item), - stats: hasItemStats ? item.stats[0] : null, + stats: hasItemStats ? item.stats : null, badges: hasColumnBadges ? item.badges : [], action: item.name, name: item.name,