Unverified Commit 23964d1c authored by bogo96's avatar bogo96 Committed by GitHub

Fix to display column statics (#771)

Signed-off-by: 's avatarhyein <hyen.seo@samsung.com>
Co-authored-by: 's avatarhyein <hyen.seo@samsung.com>
parent 58ff2da7
...@@ -21,6 +21,7 @@ import { ...@@ -21,6 +21,7 @@ import {
import { import {
TableColumn, TableColumn,
TableColumnStats,
RequestMetadataType, RequestMetadataType,
SortCriteria, SortCriteria,
SortDirection, SortDirection,
...@@ -30,6 +31,7 @@ import { ...@@ -30,6 +31,7 @@ import {
import BadgeList from 'components/common/BadgeList'; import BadgeList from 'components/common/BadgeList';
import ColumnType from './ColumnType'; import ColumnType from './ColumnType';
import ColumnDescEditableText from './ColumnDescEditableText'; import ColumnDescEditableText from './ColumnDescEditableText';
import ColumnStats from './ColumnStats';
import { getStatsInfoText } from './utils'; import { getStatsInfoText } from './utils';
import { import {
...@@ -65,18 +67,11 @@ type DatatypeType = { ...@@ -65,18 +67,11 @@ type DatatypeType = {
type: string; type: string;
}; };
type StatType = {
end_epoch: number;
start_epoch: number;
stat_type: string;
stat_val: string;
};
type FormattedDataType = { type FormattedDataType = {
content: ContentType; content: ContentType;
type: DatatypeType; type: DatatypeType;
usage: number | null; usage: number | null;
stats: StatType | null; stats: TableColumnStats[] | null;
action: string; action: string;
editText: string | null; editText: string | null;
editUrl: string | null; editUrl: string | null;
...@@ -191,15 +186,7 @@ const ExpandedRowComponent: React.FC<ExpandedRowProps> = ( ...@@ -191,15 +186,7 @@ const ExpandedRowComponent: React.FC<ExpandedRowProps> = (
/> />
</EditableSection> </EditableSection>
)} )}
{rowValue.stats && ( {rowValue.stats && <ColumnStats stats={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>
)}
</div> </div>
); );
}; };
...@@ -228,7 +215,7 @@ const ColumnList: React.FC<ColumnListProps> = ({ ...@@ -228,7 +215,7 @@ const ColumnList: React.FC<ColumnListProps> = ({
}, },
sort_order: item.sort_order, sort_order: item.sort_order,
usage: getUsageStat(item), usage: getUsageStat(item),
stats: hasItemStats ? item.stats[0] : null, stats: hasItemStats ? item.stats : null,
badges: hasColumnBadges ? item.badges : [], badges: hasColumnBadges ? item.badges : [],
action: item.name, action: item.name,
name: item.name, name: item.name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment