|
@@ -17,9 +17,12 @@ import {space} from 'sentry/styles/space';
|
|
|
import getRouteStringFromRoutes from 'sentry/utils/getRouteStringFromRoutes';
|
|
|
import {TabKey} from 'sentry/utils/replays/hooks/useActiveReplayTab';
|
|
|
import useReplayReader from 'sentry/utils/replays/hooks/useReplayReader';
|
|
|
+import RequestError from 'sentry/utils/requestError/requestError';
|
|
|
+import useRouteAnalyticsParams from 'sentry/utils/routeAnalytics/useRouteAnalyticsParams';
|
|
|
import {useRoutes} from 'sentry/utils/useRoutes';
|
|
|
import {normalizeUrl} from 'sentry/utils/withDomainRequired';
|
|
|
import FluidHeight from 'sentry/views/replays/detail/layout/fluidHeight';
|
|
|
+import {ReplayRecord} from 'sentry/views/replays/types';
|
|
|
|
|
|
type Props = {
|
|
|
eventTimestampMs: number;
|
|
@@ -29,6 +32,28 @@ type Props = {
|
|
|
focusTab?: TabKey;
|
|
|
};
|
|
|
|
|
|
+function getReplayAnalyticsStatus({
|
|
|
+ fetchError,
|
|
|
+ replayRecord,
|
|
|
+}: {
|
|
|
+ fetchError?: RequestError;
|
|
|
+ replayRecord?: ReplayRecord;
|
|
|
+}) {
|
|
|
+ if (fetchError) {
|
|
|
+ return 'error';
|
|
|
+ }
|
|
|
+
|
|
|
+ if (replayRecord?.is_archived) {
|
|
|
+ return 'archived';
|
|
|
+ }
|
|
|
+
|
|
|
+ if (replayRecord) {
|
|
|
+ return 'success';
|
|
|
+ }
|
|
|
+
|
|
|
+ return 'none';
|
|
|
+}
|
|
|
+
|
|
|
function ReplayPreview({
|
|
|
buttonProps,
|
|
|
eventTimestampMs,
|
|
@@ -51,6 +76,10 @@ function ReplayPreview({
|
|
|
return 0;
|
|
|
}, [eventTimestampMs, startTimestampMs]);
|
|
|
|
|
|
+ useRouteAnalyticsParams({
|
|
|
+ event_replay_status: getReplayAnalyticsStatus({fetchError, replayRecord}),
|
|
|
+ });
|
|
|
+
|
|
|
if (replayRecord?.is_archived) {
|
|
|
return (
|
|
|
<Alert type="warning" data-test-id="replay-error">
|