diff --git a/frontend/app/Router.js b/frontend/app/Router.js index c5fe4b36c..143fda226 100644 --- a/frontend/app/Router.js +++ b/frontend/app/Router.js @@ -145,7 +145,7 @@ class Router extends React.Component { } componentDidUpdate(prevProps, prevState) { - this.props.setSessionPath(prevProps.location.pathname) + this.props.setSessionPath(prevProps.location) if (prevProps.email !== this.props.email && !this.props.email) { this.props.fetchTenants(); } diff --git a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableErrors/CustomMetricTableErrors.tsx b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableErrors/CustomMetricTableErrors.tsx index d47e4b321..c12acf4fd 100644 --- a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableErrors/CustomMetricTableErrors.tsx +++ b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableErrors/CustomMetricTableErrors.tsx @@ -11,11 +11,12 @@ interface Props { isTemplate?: boolean; isEdit?: boolean; history: any, + location: any, } function CustomMetricTableErrors(props: RouteComponentProps) { const { metric, isEdit = false } = props; const errorId = new URLSearchParams(props.location.search).get("errorId"); - const { showModal } = useModal(); + const { showModal, hideModal } = useModal(); const onErrorClick = (error: any) => { props.history.replace({search: (new URLSearchParams({errorId : error.errorId})).toString()}); @@ -25,8 +26,14 @@ function CustomMetricTableErrors(props: RouteComponentProps) { if (!errorId) return; showModal(, { right: true, onClose: () => { - props.history.replace({search: ""}); + if (props.history.location.pathname.includes("/metric/")) { + props.history.replace({search: ""}); + } }}); + + return () => { + hideModal(); + } }, [errorId]) return ( diff --git a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableSessions/CustomMetricTableSessions.tsx b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableSessions/CustomMetricTableSessions.tsx index 0e5ff0587..f258dba8c 100644 --- a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableSessions/CustomMetricTableSessions.tsx +++ b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableSessions/CustomMetricTableSessions.tsx @@ -1,7 +1,8 @@ import { useObserver } from 'mobx-react-lite'; -import React from 'react'; +import React, { useEffect } from 'react'; import SessionItem from 'Shared/SessionItem'; import { Pagination, NoContent } from 'UI'; +import { useModal } from 'App/components/Modal'; interface Props { metric: any; diff --git a/frontend/app/components/Dashboard/components/Funnels/FunnelIssueDetails/FunnelIssueDetails.tsx b/frontend/app/components/Dashboard/components/Funnels/FunnelIssueDetails/FunnelIssueDetails.tsx index 215c5f0cc..13074ece8 100644 --- a/frontend/app/components/Dashboard/components/Funnels/FunnelIssueDetails/FunnelIssueDetails.tsx +++ b/frontend/app/components/Dashboard/components/Funnels/FunnelIssueDetails/FunnelIssueDetails.tsx @@ -19,7 +19,8 @@ function FunnelIssueDetails(props: Props) { useEffect(() => { setLoading(true); - widget.fetchIssue(widget.metricId, issueId, filter).then((resp: any) => { + const _filters = { ...filter, series: widget.toJsonDrilldown() }; + widget.fetchIssue(widget.metricId, issueId, _filters).then((resp: any) => { setFunnelIssue(resp.issue); setSessions(resp.sessions); }).finally(() => { diff --git a/frontend/app/components/Dashboard/components/Funnels/FunnelIssueModal/FunnelIssueModal.tsx b/frontend/app/components/Dashboard/components/Funnels/FunnelIssueModal/FunnelIssueModal.tsx index bf9b6acf8..939517928 100644 --- a/frontend/app/components/Dashboard/components/Funnels/FunnelIssueModal/FunnelIssueModal.tsx +++ b/frontend/app/components/Dashboard/components/Funnels/FunnelIssueModal/FunnelIssueModal.tsx @@ -9,7 +9,7 @@ interface Props { } function FunnelIssueModal(props: Props) { const { issueId } = props; - const { hideModal } = useModal(); + // const { hideModal } = useModal(); return (
) { if (!issueId) return; showModal(, { right: true, onClose: () => { - props.history.replace({search: ""}); + if (props.history.location.pathname.includes("/metric/")) { + props.history.replace({search: ""}); + } }}); }, [issueId]); diff --git a/frontend/app/components/Funnels/FunnelWidget/FunnelWidget.tsx b/frontend/app/components/Funnels/FunnelWidget/FunnelWidget.tsx index 020250603..e0c00035e 100644 --- a/frontend/app/components/Funnels/FunnelWidget/FunnelWidget.tsx +++ b/frontend/app/components/Funnels/FunnelWidget/FunnelWidget.tsx @@ -6,6 +6,7 @@ import stl from './FunnelWidget.module.css'; import { Icon } from 'UI'; import { useObserver } from 'mobx-react-lite'; import { NoContent } from 'UI'; +import { useModal } from 'App/components/Modal'; interface Props { metric: Widget; @@ -19,6 +20,14 @@ function FunnelWidget(props: Props) { const hasMoreSteps = funnel.stages.length > 2; const lastStage = funnel.stages[funnel.stages.length - 1]; const remainingSteps = totalSteps - 2; + const { hideModal } = useModal(); + + useEffect(() => { + return () => { + if (isWidget) return; + hideModal(); + } + }, []); return useObserver(() => ( diff --git a/frontend/app/components/Session/LiveSession.js b/frontend/app/components/Session/LiveSession.js index 08d941be5..673e0c701 100644 --- a/frontend/app/components/Session/LiveSession.js +++ b/frontend/app/components/Session/LiveSession.js @@ -47,7 +47,7 @@ function LiveSession({ export default withPermissions(['ASSIST_LIVE'], '', true)(connect((state, props) => { const { match: { params: { sessionId } } } = props; const isAssist = state.getIn(['sessions', 'activeTab']).type === 'live'; - const hasSessiosPath = state.getIn([ 'sessions', 'sessionPath' ]).includes('/sessions'); + const hasSessiosPath = state.getIn([ 'sessions', 'sessionPath' ]).pathname.includes('/sessions'); return { sessionId, loading: state.getIn([ 'sessions', 'loading' ]), diff --git a/frontend/app/components/Session_/PlayerBlockHeader.js b/frontend/app/components/Session_/PlayerBlockHeader.js index 55f59e73d..7f9aed6c7 100644 --- a/frontend/app/components/Session_/PlayerBlockHeader.js +++ b/frontend/app/components/Session_/PlayerBlockHeader.js @@ -55,10 +55,10 @@ export default class PlayerBlockHeader extends React.PureComponent { backHandler = () => { const { history, siteId, sessionPath, isAssist } = this.props; - if (sessionPath === history.location.pathname || sessionPath.includes("/session/") || isAssist) { + if (sessionPath.pathname === history.location.pathname || sessionPath.pathname.includes("/session/") || isAssist) { history.push(withSiteId(isAssist ? ASSIST_ROUTE: SESSIONS_ROUTE, siteId)); } else { - history.push(sessionPath ? sessionPath : withSiteId(SESSIONS_ROUTE, siteId)); + history.push(sessionPath ? sessionPath.pathname + sessionPath.search : withSiteId(SESSIONS_ROUTE, siteId)); } } diff --git a/frontend/app/components/shared/SessionItem/SessionItem.tsx b/frontend/app/components/shared/SessionItem/SessionItem.tsx index b6b0f4832..23aeab9f6 100644 --- a/frontend/app/components/shared/SessionItem/SessionItem.tsx +++ b/frontend/app/components/shared/SessionItem/SessionItem.tsx @@ -118,7 +118,7 @@ function SessionItem(props: RouteComponentProps) {
-
+
{formatTimeOrDate(startedAt, timezone) }
{!isAssist && ( diff --git a/frontend/app/duck/sessions.js b/frontend/app/duck/sessions.js index 8887b03f2..57fdcbf5d 100644 --- a/frontend/app/duck/sessions.js +++ b/frontend/app/duck/sessions.js @@ -60,7 +60,7 @@ const initialState = Map({ host: '', funnelPage: Map(), timelinePointer: null, - sessionPath: '', + sessionPath: {}, lastPlayedSessionId: null, });