|
@@ -1,4 +1,5 @@
|
|
|
import {Fragment} from 'react';
|
|
|
+import {Link} from 'react-router';
|
|
|
import styled from '@emotion/styled';
|
|
|
|
|
|
import ErrorCounts from 'sentry/components/replays/header/errorCounts';
|
|
@@ -7,7 +8,11 @@ import TimeSince from 'sentry/components/timeSince';
|
|
|
import {IconCalendar, IconCursorArrow} from 'sentry/icons';
|
|
|
import {t} from 'sentry/locale';
|
|
|
import {space} from 'sentry/styles/space';
|
|
|
+import EventView from 'sentry/utils/discover/eventView';
|
|
|
+import getRouteStringFromRoutes from 'sentry/utils/getRouteStringFromRoutes';
|
|
|
import {ColorOrAlias} from 'sentry/utils/theme';
|
|
|
+import {useLocation} from 'sentry/utils/useLocation';
|
|
|
+import {useRoutes} from 'sentry/utils/useRoutes';
|
|
|
import type {ReplayError, ReplayRecord} from 'sentry/views/replays/types';
|
|
|
|
|
|
type Props = {
|
|
@@ -16,15 +21,32 @@ type Props = {
|
|
|
};
|
|
|
|
|
|
function ReplayMetaData({replayErrors, replayRecord}: Props) {
|
|
|
+ const location = useLocation();
|
|
|
+ const routes = useRoutes();
|
|
|
+ const referrer = getRouteStringFromRoutes(routes);
|
|
|
+ const eventView = EventView.fromLocation(location);
|
|
|
+
|
|
|
+ const domEventsTab = {
|
|
|
+ ...location,
|
|
|
+ query: {
|
|
|
+ referrer,
|
|
|
+ ...eventView.generateQueryStringObject(),
|
|
|
+ t_main: 'dom',
|
|
|
+ f_d_type: 'ui.slowClickDetected',
|
|
|
+ },
|
|
|
+ };
|
|
|
+
|
|
|
return (
|
|
|
<KeyMetrics>
|
|
|
<KeyMetricLabel>{t('Dead Clicks')}</KeyMetricLabel>
|
|
|
<KeyMetricData>
|
|
|
{replayRecord?.count_dead_clicks ? (
|
|
|
- <ClickCount color="yellow300">
|
|
|
- <IconCursorArrow size="sm" />
|
|
|
- {replayRecord.count_dead_clicks}
|
|
|
- </ClickCount>
|
|
|
+ <Link to={domEventsTab}>
|
|
|
+ <ClickCount color="yellow300">
|
|
|
+ <IconCursorArrow size="sm" />
|
|
|
+ {replayRecord.count_dead_clicks}
|
|
|
+ </ClickCount>
|
|
|
+ </Link>
|
|
|
) : (
|
|
|
<Count>0</Count>
|
|
|
)}
|
|
@@ -33,10 +55,12 @@ function ReplayMetaData({replayErrors, replayRecord}: Props) {
|
|
|
<KeyMetricLabel>{t('Rage Clicks')}</KeyMetricLabel>
|
|
|
<KeyMetricData>
|
|
|
{replayRecord?.count_rage_clicks ? (
|
|
|
- <ClickCount color="red300">
|
|
|
- <IconCursorArrow size="sm" />
|
|
|
- {replayRecord.count_rage_clicks}
|
|
|
- </ClickCount>
|
|
|
+ <Link to={domEventsTab} color="red300">
|
|
|
+ <ClickCount color="red300">
|
|
|
+ <IconCursorArrow size="sm" />
|
|
|
+ {replayRecord.count_rage_clicks}
|
|
|
+ </ClickCount>
|
|
|
+ </Link>
|
|
|
) : (
|
|
|
<Count>0</Count>
|
|
|
)}
|