From 5d9cc9b7eabd8b72b4cb6afe14c3c8975ed21172 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Thu, 23 Jun 2022 12:35:50 +0200 Subject: [PATCH] change(ui) - errors and sessions widget click --- .../CustomMetricTableErrors/CustomMetricTableErrors.tsx | 7 ++++--- .../Dashboard/components/WidgetChart/WidgetChart.tsx | 2 +- .../Dashboard/components/WidgetWrapper/WidgetWrapper.tsx | 3 ++- frontend/app/components/shared/SessionItem/SessionItem.tsx | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableErrors/CustomMetricTableErrors.tsx b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableErrors/CustomMetricTableErrors.tsx index d497eb4b7..b4ec284b0 100644 --- a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableErrors/CustomMetricTableErrors.tsx +++ b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableErrors/CustomMetricTableErrors.tsx @@ -18,7 +18,8 @@ function CustomMetricTableErrors(props: RouteComponentProps) { const errorId = new URLSearchParams(props.location.search).get("errorId"); const { showModal, hideModal } = useModal(); - const onErrorClick = (error: any) => { + const onErrorClick = (e: any, error: any) => { + e.stopPropagation(); props.history.replace({search: (new URLSearchParams({errorId : error.errorId})).toString()}); } @@ -26,7 +27,7 @@ function CustomMetricTableErrors(props: RouteComponentProps) { if (!errorId) return; showModal(, { right: true, onClose: () => { - if (props.history.location.pathname.includes("/metric")) { + if (props.history.location.pathname.includes("/dashboard")) { props.history.replace({search: ""}); } }}); @@ -44,7 +45,7 @@ function CustomMetricTableErrors(props: RouteComponentProps) { size="small" > {metric.data.errors && metric.data.errors.map((error: any, index: any) => ( - onErrorClick(error)} /> + onErrorClick(e, error)} /> ))} {isEdit && ( diff --git a/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx b/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx index af32c1318..e6553dcc8 100644 --- a/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx +++ b/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx @@ -165,7 +165,7 @@ function WidgetChart(props: Props) { metric={metric} data={data[0]} colors={colors} - params={params} + // params={params} onClick={onChartClick} /> ) diff --git a/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx b/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx index 505b674e2..b8e0a44d1 100644 --- a/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx +++ b/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx @@ -10,6 +10,7 @@ import { withSiteId, dashboardMetricDetails } from 'App/routes'; import TemplateOverlay from './TemplateOverlay'; import AlertButton from './AlertButton'; import stl from './widgetWrapper.module.css'; +import { FilterKey } from 'App/types/filter/filterType'; interface Props { className?: string; @@ -66,7 +67,7 @@ function WidgetWrapper(props: Props) { const ref: any = useRef(null) const dragDropRef: any = dragRef(dropRef(ref)) - const addOverlay = isTemplate || (!isPredefined && isWidget) + const addOverlay = isTemplate || (!isPredefined && isWidget && widget.metricOf !== FilterKey.ERRORS && widget.metricOf !== FilterKey.SESSIONS) return useObserver(() => (
) { }); return ( -
+
e.stopPropagation()}>