Skip to content

Commit

Permalink
Fix to display column statics (#771)
Browse files Browse the repository at this point in the history
Signed-off-by: hyein <hyen.seo@samsung.com>

Co-authored-by: hyein <hyen.seo@samsung.com>
  • Loading branch information
bogo96 and hyein authored Nov 23, 2020
1 parent 2be9cb3 commit 15ff010
Showing 1 changed file with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {

import {
TableColumn,
TableColumnStats,
RequestMetadataType,
SortCriteria,
SortDirection,
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -191,15 +186,7 @@ const ExpandedRowComponent: React.FC<ExpandedRowProps> = (
/>
</EditableSection>
)}
{rowValue.stats && (
<div className="stat-collection-info">
<span className="stat-title">{COLUMN_STATS_TITLE} </span>
{getStatsInfoText(
rowValue.stats.start_epoch,
rowValue.stats.end_epoch
)}
</div>
)}
{rowValue.stats && <ColumnStats stats={rowValue.stats} />}
</div>
);
};
Expand Down Expand Up @@ -228,7 +215,7 @@ const ColumnList: React.FC<ColumnListProps> = ({
},
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,
Expand Down

0 comments on commit 15ff010

Please sign in to comment.