@@ -11,12 +11,14 @@ import {URL_PARAM} from 'sentry/constants/pageFilters';
11
11
import { t } from 'sentry/locale' ;
12
12
import type { PageFilters } from 'sentry/types/core' ;
13
13
import type { Organization , SessionApiResponse } from 'sentry/types/organization' ;
14
+ import type { PlatformKey } from 'sentry/types/project' ;
14
15
import { defined } from 'sentry/utils' ;
15
16
import { trackAnalytics } from 'sentry/utils/analytics' ;
16
17
import { getPeriod } from 'sentry/utils/duration/getPeriod' ;
17
18
import useApi from 'sentry/utils/useApi' ;
18
19
import { BigNumberWidgetVisualization } from 'sentry/views/dashboards/widgets/bigNumberWidget/bigNumberWidgetVisualization' ;
19
20
import { Widget } from 'sentry/views/dashboards/widgets/widget/widget' ;
21
+ import { getANRIssueQueryText , getANRRateText } from 'sentry/views/projectDetail/utils' ;
20
22
import {
21
23
getSessionTermDescription ,
22
24
SessionTerm ,
@@ -27,6 +29,7 @@ type Props = {
27
29
location : Location ;
28
30
organization : Organization ;
29
31
selection : PageFilters ;
32
+ platform ?: PlatformKey ;
30
33
query ?: string ;
31
34
} ;
32
35
@@ -36,6 +39,7 @@ export function ProjectAnrScoreCard({
36
39
selection,
37
40
location,
38
41
query,
42
+ platform,
39
43
} : Props ) {
40
44
const { environments, projects, datetime} = selection ;
41
45
const { start, end, period} = datetime ;
@@ -128,7 +132,7 @@ export function ProjectAnrScoreCard({
128
132
129
133
const endpointPath = `/organizations/${ organization . slug } /issues/` ;
130
134
131
- const issueQuery = [ 'mechanism:[ANR,AppExitInfo]' , query ] . join ( ' ' ) . trim ( ) ;
135
+ const issueQuery = [ getANRIssueQueryText ( platform ) , query ] . join ( ' ' ) . trim ( ) ;
132
136
133
137
const queryParams = {
134
138
...normalizeDateTimeParams ( pick ( location . query , [ ...Object . values ( URL_PARAM ) ] ) ) ,
@@ -141,9 +145,8 @@ export function ProjectAnrScoreCard({
141
145
query : queryParams ,
142
146
} ;
143
147
144
- const cardTitle = t ( 'ANR Rate' ) ;
145
-
146
- const cardHelp = getSessionTermDescription ( SessionTerm . ANR_RATE , null ) ;
148
+ const cardTitle = getANRRateText ( platform ) ;
149
+ const cardHelp = getSessionTermDescription ( SessionTerm . ANR_RATE , platform || null ) ;
147
150
148
151
const Title = < Widget . WidgetTitle title = { cardTitle } /> ;
149
152
0 commit comments