From 1fb6e4a38b760b1f9d2c1a4c4a26a9b17ff8c353 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 16 Sep 2022 18:33:11 +0530 Subject: [PATCH] fix(ui) - fetch calls with errors - crash --- .../CallWithErrors/CallWithErrors.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/app/components/Dashboard/Widgets/PredefinedWidgets/CallWithErrors/CallWithErrors.tsx b/frontend/app/components/Dashboard/Widgets/PredefinedWidgets/CallWithErrors/CallWithErrors.tsx index 47c88c0aa..209128cdf 100644 --- a/frontend/app/components/Dashboard/Widgets/PredefinedWidgets/CallWithErrors/CallWithErrors.tsx +++ b/frontend/app/components/Dashboard/Widgets/PredefinedWidgets/CallWithErrors/CallWithErrors.tsx @@ -7,6 +7,7 @@ import MethodType from './MethodType'; import cn from 'classnames'; import stl from './callWithErrors.module.css'; import { NO_METRIC_DATA } from 'App/constants/messages' ++import { List } from 'immutable'; const cols = [ { @@ -51,10 +52,10 @@ interface Props { function CallWithErrors(props: Props) { const { data, metric } = props; const [search, setSearch] = React.useState('') - const test = (value = '', serach) => getRE(serach, 'i').test(value); - const _data = search ? metric.data.chart.filter(i => test(i.urlHostpath, search)) : metric.data.chart.images; + const test = (value = '', serach: any) => getRE(serach, 'i').test(value); + const _data = search ? metric.data.chart.filter((i: any) => test(i.urlHostpath, search)) : metric.data.chart; - const write = ({ target: { name, value } }) => { + const write = ({ target: { name, value } }: any) => { setSearch(value) }; @@ -71,8 +72,9 @@ function CallWithErrors(props: Props) {