diff --git a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableErrors/CustomMetricTableErrors.tsx b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableErrors/CustomMetricTableErrors.tsx index a7a18b50f..db430fc62 100644 --- a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableErrors/CustomMetricTableErrors.tsx +++ b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableErrors/CustomMetricTableErrors.tsx @@ -8,12 +8,13 @@ import { useStore } from "App/mstore"; import { overPastString } from "App/dateRange"; interface Props { metric: any; + data: any; isEdit: any; history: any; location: any; } -function CustomMetricTableErrors(props: RouteComponentProps) { - const { metric, isEdit = false } = props; +function CustomMetricTableErrors(props: RouteComponentProps & Props) { + const { metric, isEdit = false, data } = props; const errorId = new URLSearchParams(props.location.search).get("errorId"); const { showModal, hideModal } = useModal(); const { dashboardStore } = useStore(); @@ -46,12 +47,12 @@ function CustomMetricTableErrors(props: RouteComponentProps) { return (
- {metric.data.errors && - metric.data.errors.map((error: any, index: any) => ( + {data.errors && + data.errors.map((error: any, index: any) => (
) { metric.updateKey("page", page) @@ -77,16 +78,14 @@ function CustomMetricTableErrors(props: RouteComponentProps) { )} {!isEdit && ( - + )}
); } -export default withRouter(CustomMetricTableErrors) as React.FunctionComponent< - RouteComponentProps ->; +export default withRouter(CustomMetricTableErrors); const ViewMore = ({ total, limit }: any) => total > limit && ( diff --git a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableSessions/CustomMetricTableSessions.tsx b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableSessions/CustomMetricTableSessions.tsx index 4ca953dcc..c5aa85e0f 100644 --- a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableSessions/CustomMetricTableSessions.tsx +++ b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableSessions/CustomMetricTableSessions.tsx @@ -9,10 +9,11 @@ interface Props { metric: any; isTemplate?: boolean; isEdit?: boolean; + data: any; } function CustomMetricTableSessions(props: Props) { - const { isEdit = false, metric } = props; + const { isEdit = false, metric, data } = props; const { dashboardStore } = useStore(); const period = dashboardStore.period; @@ -20,16 +21,16 @@ function CustomMetricTableSessions(props: Props) {
- {metric.data.sessions && - metric.data.sessions.map((session: any, index: any) => ( + {data.sessions && + data.sessions.map((session: any, index: any) => (
metric.updateKey("page", page) } - limit={metric.data.total} + limit={data.total} debounceRequest={500} />
)} {!isEdit && ( - + )}
diff --git a/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx b/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx index 3b189fb52..9a7dee976 100644 --- a/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx +++ b/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx @@ -94,15 +94,15 @@ function WidgetChart(props: Props) { const metricWithData = { ...metric, data }; if (metricType === 'sessions') { - return + return } if (metricType === 'errors') { - return + return } if (metricType === 'funnel') { - return + return } if (metricType === 'predefined') { @@ -137,7 +137,8 @@ function WidgetChart(props: Props) { if (metricOf === FilterKey.SESSIONS) { return ( @@ -146,7 +147,8 @@ function WidgetChart(props: Props) { if (metricOf === FilterKey.ERRORS) { return ( diff --git a/frontend/app/components/Funnels/FunnelWidget/FunnelWidget.tsx b/frontend/app/components/Funnels/FunnelWidget/FunnelWidget.tsx index b843736df..3147b9c78 100644 --- a/frontend/app/components/Funnels/FunnelWidget/FunnelWidget.tsx +++ b/frontend/app/components/Funnels/FunnelWidget/FunnelWidget.tsx @@ -9,11 +9,12 @@ import { useModal } from 'App/components/Modal'; interface Props { metric: Widget; - isWidget?: boolean + isWidget?: boolean; + data: any; } function FunnelWidget(props: Props) { - const { metric, isWidget = false } = props; - const funnel = metric.data.funnel || { stages: [] }; + const { metric, isWidget = false, data } = props; + const funnel = data.funnel || { stages: [] }; const totalSteps = funnel.stages.length; const stages = isWidget ? [...funnel.stages.slice(0, 1), funnel.stages[funnel.stages.length - 1]] : funnel.stages; const hasMoreSteps = funnel.stages.length > 2; @@ -124,4 +125,4 @@ function BarActions({ bar }: any) { )) } -export default FunnelWidget; \ No newline at end of file +export default FunnelWidget;