@@ -3,14 +3,17 @@ import styled from '@emotion/styled';
3
3
import { Location } from 'history' ;
4
4
5
5
import { Alert } from 'sentry/components/alert' ;
6
+ import ExternalLink from 'sentry/components/links/externalLink' ;
6
7
import LoadingIndicator from 'sentry/components/loadingIndicator' ;
7
8
import PanelTable from 'sentry/components/panels/panelTable' ;
8
- import { t } from 'sentry/locale' ;
9
+ import { t , tct } from 'sentry/locale' ;
9
10
import EventView from 'sentry/utils/discover/eventView' ;
10
11
import type { Sort } from 'sentry/utils/discover/fields' ;
11
12
import getRouteStringFromRoutes from 'sentry/utils/getRouteStringFromRoutes' ;
12
13
import { useLocation } from 'sentry/utils/useLocation' ;
13
14
import useOrganization from 'sentry/utils/useOrganization' ;
15
+ import usePageFilters from 'sentry/utils/usePageFilters' ;
16
+ import useProjectSdkNeedsUpdate from 'sentry/utils/useProjectSdkNeedsUpdate' ;
14
17
import { useRoutes } from 'sentry/utils/useRoutes' ;
15
18
import type { ReplayListRecordWithTx } from 'sentry/views/performance/transactionSummary/transactionReplays/useReplaysWithTxData' ;
16
19
import HeaderCell from 'sentry/views/replays/replayTable/headerCell' ;
@@ -28,6 +31,8 @@ import {
28
31
import { ReplayColumn } from 'sentry/views/replays/replayTable/types' ;
29
32
import type { ReplayListRecord } from 'sentry/views/replays/types' ;
30
33
34
+ const MIN_DEAD_RAGE_CLICK_SDK = '7.60.1' ;
35
+
31
36
type Props = {
32
37
fetchError : undefined | Error ;
33
38
isFetching : boolean ;
@@ -53,6 +58,18 @@ function ReplayTable({
53
58
const newLocation = useLocation ( ) ;
54
59
const organization = useOrganization ( ) ;
55
60
61
+ const {
62
+ selection : { projects} ,
63
+ } = usePageFilters ( ) ;
64
+
65
+ const needSDKUpgrade = useProjectSdkNeedsUpdate ( {
66
+ minVersion : MIN_DEAD_RAGE_CLICK_SDK ,
67
+ organization,
68
+ projectId : projects . map ( String ) ,
69
+ } ) ;
70
+
71
+ const showBottomBorder = visibleColumns . includes ( ReplayColumn . MOST_RAGE_CLICKS ) ;
72
+
56
73
const location : Location = saveLocation
57
74
? {
58
75
pathname : '' ,
@@ -78,7 +95,7 @@ function ReplayTable({
78
95
data-test-id = "replay-table"
79
96
gridRows = { undefined }
80
97
>
81
- < StyledAlert type = "error" showIcon >
98
+ < StyledAlert type = "error" showIcon showBottomBorder = { showBottomBorder } >
82
99
{ typeof fetchError === 'string'
83
100
? fetchError
84
101
: t (
@@ -89,6 +106,32 @@ function ReplayTable({
89
106
) ;
90
107
}
91
108
109
+ if (
110
+ needSDKUpgrade . needsUpdate &&
111
+ visibleColumns . includes ( ReplayColumn . COUNT_DEAD_CLICKS )
112
+ ) {
113
+ return (
114
+ < StyledPanelTable
115
+ headers = { tableHeaders }
116
+ visibleColumns = { visibleColumns }
117
+ data-test-id = "replay-table"
118
+ gridRows = { undefined }
119
+ loader = { < LoadingIndicator style = { { margin : '54px auto' } } /> }
120
+ disablePadding
121
+ >
122
+ < StyledAlert type = "info" showIcon showBottomBorder = { showBottomBorder } >
123
+ { tct ( '[data] requires [sdkPrompt]. [link:Upgrade now.]' , {
124
+ data : < strong > Rage and dead clicks</ strong > ,
125
+ sdkPrompt : < strong > { t ( 'SDK version >= 7.60.1' ) } </ strong > ,
126
+ link : (
127
+ < ExternalLink href = "https://docs.sentry.io/platforms/javascript/install/npm/" />
128
+ ) ,
129
+ } ) }
130
+ </ StyledAlert >
131
+ </ StyledPanelTable >
132
+ ) ;
133
+ }
134
+
92
135
const referrer = getRouteStringFromRoutes ( routes ) ;
93
136
const eventView = EventView . fromLocation ( location ) ;
94
137
@@ -207,14 +250,18 @@ const StyledPanelTable = styled(PanelTable)<{
207
250
)
208
251
. join ( ' ' ) } ;
209
252
210
- ${ props => ( props . gridRows ? `grid-template-rows: ${ props . gridRows } ;` : '' ) }
253
+ ${ props =>
254
+ props . gridRows
255
+ ? `grid-template-rows: ${ props . gridRows } ;`
256
+ : `grid-template-rows: 44px max-content;` }
211
257
` ;
212
258
213
- const StyledAlert = styled ( Alert ) `
259
+ const StyledAlert = styled ( Alert ) < { showBottomBorder ?: boolean } > `
214
260
border-radius: 0;
215
- border-width: 1px 0 0 0;
216
261
grid-column: 1/-1;
217
262
margin-bottom: 0;
263
+ ${ props =>
264
+ props . showBottomBorder ? `border-width: 1px 0 1px 0;` : `border-width: 1px 0 0 0;` }
218
265
` ;
219
266
220
267
export default ReplayTable ;
0 commit comments