From c4fc8981aae339b995b9c806bd34876cd4ed46cf Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Wed, 7 Jun 2023 14:25:42 +0200 Subject: [PATCH] change(ui): improve insights --- .../InsightsCard/InsightItem.tsx | 71 ++++++++++++------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/InsightsCard/InsightItem.tsx b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/InsightsCard/InsightItem.tsx index 31c8370c2..f6d96e44e 100644 --- a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/InsightsCard/InsightItem.tsx +++ b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/InsightsCard/InsightItem.tsx @@ -2,7 +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' +import { numberWithCommas } from 'App/utils'; interface Props { item: any; @@ -29,8 +29,7 @@ function InsightItem(props: Props) { export default InsightItem; - -function Change({ change, isIncreased, unit = "%" }: any) { +function Change({ change, isIncreased, unit = '%' }: any) { return (
{item.isNew ? ( <> +
Users are experimenting a new error
{item.name}
-
error observed
+
- this error has arisen a total of
{item.ratio}%
-
more than other new errors
+
times
) : ( <> -
{item.isIncreased ? 'Increase' : 'Decrease'}
-
in
+
There is been an
+
{item.isIncreased ? 'increase' : 'decrease'}
+
of error
{item.name}
+
from
+
{item.oldValue}
+
to
+
{item.value},
+
representing a
+
among all sessions.
)}
@@ -75,10 +82,12 @@ function NetworkItem({ item, className, onClick }: any) { return (
-
Network request to path
-
{item.name}
-
has {item.change > 0 ? 'increased' : 'decreased'}
- +
+
Network request to path
+
{item.name}
+
has {item.change > 0 ? 'increased' : 'decreased'}
+ +
); } @@ -87,11 +96,14 @@ function ResourcesItem({ item, className, onClick }: any) { return (
-
{item.change > 0 ? 'Increase' : 'Decrease'}
-
in
-
{item.name}
-
usage by
- +
+
There has been
+
{item.change > 0 ? 'Increase' : 'Decrease'}
+
in
+
{item.name}
+
usage by
+ +
); } @@ -100,16 +112,25 @@ function RageItem({ item, className, onClick }: any) { return (
-
{item.isNew ? item.name : 'Click Rage'}
- {item.isNew &&
has
} - {!item.isNew &&
on {item.name}
} - {item.isNew &&
{item.ratio}%
} - {item.isNew &&
more clickrage than other raged elements.
} - {!item.isNew && ( - <> -
{item.isIncreased ? 'increased' : 'decreased'} by
+ {item.isNew ? ( +
+
New Click Rage detected
+
{item.value}
+
times on
+
{item.name}
+
+ ) : ( +
+
Click rage has
+
{item.isIncreased ? 'increased' : 'decreased'} on
+
{item.name}
+
passing from
+
{item.oldValue}
+
to
+
{item.value}
+
representing a
- +
)}
);