From f4961547a98013368e392e21de064416a5ba0492 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Tue, 25 Apr 2023 16:56:00 +0200 Subject: [PATCH] change(ui) - insights improvements --- .../InsightsCard/InsightItem.tsx | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/InsightsCard/InsightItem.tsx b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/InsightsCard/InsightItem.tsx index a8ac5b54d..31c8370c2 100644 --- a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/InsightsCard/InsightItem.tsx +++ b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/InsightsCard/InsightItem.tsx @@ -2,6 +2,7 @@ import { IssueCategory } from 'App/types/filter/filterType'; import React from 'react'; import { Icon } from 'UI'; import cn from 'classnames'; +import { numberWithCommas } from 'App/utils' interface Props { item: any; @@ -29,7 +30,7 @@ function InsightItem(props: Props) { export default InsightItem; -function Change({ change, isIncreased }: any) { +function Change({ change, isIncreased, unit = "%" }: any) { return (
- {change}% + {numberWithCommas(Math.abs(change)) + unit}
); } @@ -60,9 +61,9 @@ function ErrorItem({ item, className, onClick }: any) { ) : ( <> -
Increase
+
{item.isIncreased ? 'Increase' : 'Decrease'}
in
-
{item.name}
+
{item.name}
)} @@ -74,10 +75,10 @@ function NetworkItem({ item, className, onClick }: any) { return (
-
Network request
+
Network request to path
{item.name}
-
{item.change > 0 ? 'increased' : 'decreased'}
- +
has {item.change > 0 ? 'increased' : 'decreased'}
+
); } @@ -86,9 +87,10 @@ function ResourcesItem({ item, className, onClick }: any) { return (
-
{item.change > 0 ? 'Inrease' : 'Decrease'}
+
{item.change > 0 ? 'Increase' : 'Decrease'}
in
{item.name}
+
usage by
); @@ -105,7 +107,7 @@ function RageItem({ item, className, onClick }: any) { {item.isNew &&
more clickrage than other raged elements.
} {!item.isNew && ( <> -
increase by
+
{item.isIncreased ? 'increased' : 'decreased'} by
)}