diff --git a/frontend/app/components/Dashboard/components/WidgetSessions/WidgetSessions.tsx b/frontend/app/components/Dashboard/components/WidgetSessions/WidgetSessions.tsx index 9600f5c97..41f42619b 100644 --- a/frontend/app/components/Dashboard/components/WidgetSessions/WidgetSessions.tsx +++ b/frontend/app/components/Dashboard/components/WidgetSessions/WidgetSessions.tsx @@ -11,7 +11,7 @@ import { debounce } from 'App/utils'; import useIsMounted from 'App/hooks/useIsMounted'; import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG'; import { numberWithCommas } from 'App/utils'; -import { HEATMAP, USER_PATH } from "App/constants/card"; +import { HEATMAP, USER_PATH, FUNNEL } from "App/constants/card"; interface Props { className?: string; @@ -59,6 +59,13 @@ function WidgetSessions(props: Props) { if (!isMounted()) return; setLoading(true); delete filter.eventsOrderSupport; + if (widget.metricType === FUNNEL) { + if (filter.series[0].filter.filters.length === 0) { + setLoading(false); + return setData([]); + } + } + widget .fetchSessions(metricId, filter) .then((res: any) => { diff --git a/frontend/app/components/Funnels/FunnelWidget/FunnelWidget.tsx b/frontend/app/components/Funnels/FunnelWidget/FunnelWidget.tsx index 3380445fc..3a4365876 100644 --- a/frontend/app/components/Funnels/FunnelWidget/FunnelWidget.tsx +++ b/frontend/app/components/Funnels/FunnelWidget/FunnelWidget.tsx @@ -87,18 +87,26 @@ function FunnelWidget(props: Props) { const viewType = metric?.viewType; const isHorizontal = viewType === 'columnChart'; + const noEvents = metric.series[0].filter.filters.length === 0; return ( - No data available for the selected period. + {noEvents ? 'Select an event to start seeing the funnel' : 'No data available for the selected period.'} } show={!stages || stages.length === 0} > -
+
{!isWidget && shownStages.map((stage: any, index: any) => (