@@ -10,7 +10,11 @@ import Link from 'sentry/components/links/link';
10
10
import Placeholder from 'sentry/components/placeholder' ;
11
11
import TextOverflow from 'sentry/components/textOverflow' ;
12
12
import { Tooltip } from 'sentry/components/tooltip' ;
13
- import { backend , frontend } from 'sentry/data/platformCategories' ;
13
+ import {
14
+ backend ,
15
+ featureFlagDrawerPlatforms ,
16
+ frontend ,
17
+ } from 'sentry/data/platformCategories' ;
14
18
import { t , tct } from 'sentry/locale' ;
15
19
import { space } from 'sentry/styles/space' ;
16
20
import type { Project } from 'sentry/types/project' ;
@@ -159,25 +163,24 @@ function TagPreviewProgressBar({tag, groupId}: {groupId: string; tag: GroupTag})
159
163
) ;
160
164
}
161
165
162
- function IssueTagButton ( {
166
+ function DistributionsDrawerButton ( {
163
167
tags,
168
+ includeFeatureFlags,
164
169
searchQuery,
165
170
isScreenSmall,
166
171
} : {
172
+ includeFeatureFlags : boolean ;
167
173
tags : GroupTag [ ] ;
168
174
isScreenSmall ?: boolean ;
169
175
searchQuery ?: string ;
170
176
} ) {
171
177
const { baseUrl} = useGroupDetailsRoute ( ) ;
172
178
const location = useLocation ( ) ;
173
179
const organization = useOrganization ( ) ;
174
- const hasFlagsDistributions = organization . features . includes (
175
- 'feature-flag-distribution-flyout'
176
- ) ;
177
180
178
181
if ( tags . length === 0 || searchQuery || isScreenSmall ) {
179
182
return (
180
- < VerticalIssueTagsButton
183
+ < VerticalDistributionsDrawerButton
181
184
aria-label = { t ( 'View issue tag distributions' ) }
182
185
size = "xs"
183
186
to = { {
@@ -187,19 +190,19 @@ function IssueTagButton({
187
190
replace
188
191
disabled = { tags . length === 0 }
189
192
>
190
- { hasFlagsDistributions
193
+ { includeFeatureFlags
191
194
? tct ( 'View[nbsp]All Tags[nbsp]&[nbsp]Flags' , {
192
195
nbsp : '\u00A0' , // non-breaking space unicode character.
193
196
} )
194
197
: tct ( 'View All[nbsp]Tags' , {
195
198
nbsp : '\u00A0' , // non-breaking space unicode character.
196
199
} ) }
197
- </ VerticalIssueTagsButton >
200
+ </ VerticalDistributionsDrawerButton >
198
201
) ;
199
202
}
200
203
201
204
return (
202
- < IssueTagsLink
205
+ < DistributionsDrawerLink
203
206
to = { {
204
207
pathname : `${ baseUrl } ${ TabPaths [ Tab . DISTRIBUTIONS ] } ` ,
205
208
query : location . query ,
@@ -208,8 +211,8 @@ function IssueTagButton({
208
211
trackAnalytics ( 'issue_details.issue_tags_click' , { organization} ) ;
209
212
} }
210
213
>
211
- { hasFlagsDistributions ? t ( 'View all tags and feature flags' ) : t ( 'View all tags' ) }
212
- </ IssueTagsLink >
214
+ { includeFeatureFlags ? t ( 'View all tags and feature flags' ) : t ( 'View all tags' ) }
215
+ </ DistributionsDrawerLink >
213
216
) ;
214
217
}
215
218
@@ -275,16 +278,21 @@ export default function IssueTagsPreview({
275
278
return uniqueTags . slice ( 0 , 4 ) ;
276
279
} , [ tags , project . platform , highlightTagKeys ] ) ;
277
280
281
+ const includeFeatureFlags =
282
+ featureFlagDrawerPlatforms . includes ( project . platform ?? 'other' ) &&
283
+ organization . features . includes ( 'feature-flag-distribution-flyout' ) ;
284
+
278
285
if (
279
286
searchQuery ||
280
287
isScreenSmall ||
281
288
( ! isPending && ! isHighlightPending && tagsToPreview . length === 0 )
282
289
) {
283
290
return (
284
- < IssueTagButton
291
+ < DistributionsDrawerButton
285
292
tags = { tagsToPreview }
286
293
searchQuery = { searchQuery }
287
294
isScreenSmall = { isScreenSmall }
295
+ includeFeatureFlags = { includeFeatureFlags }
288
296
/>
289
297
) ;
290
298
}
@@ -313,7 +321,10 @@ export default function IssueTagsPreview({
313
321
< TagPreviewProgressBar key = { tag . key } tag = { tag } groupId = { groupId } />
314
322
) ) }
315
323
</ TagsPreview >
316
- < IssueTagButton tags = { tagsToPreview } />
324
+ < DistributionsDrawerButton
325
+ tags = { tagsToPreview }
326
+ includeFeatureFlags = { includeFeatureFlags }
327
+ />
317
328
</ IssueTagPreviewSection >
318
329
</ Fragment >
319
330
) ;
@@ -422,7 +433,7 @@ const LegendTitle = styled('div')`
422
433
margin-bottom: ${ space ( 0.75 ) } ;
423
434
` ;
424
435
425
- const IssueTagsLink = styled ( Link ) `
436
+ const DistributionsDrawerLink = styled ( Link ) `
426
437
color: ${ p => p . theme . purple300 } ;
427
438
align-self: flex-start;
428
439
@@ -431,7 +442,7 @@ const IssueTagsLink = styled(Link)`
431
442
}
432
443
` ;
433
444
434
- const VerticalIssueTagsButton = styled ( LinkButton ) `
445
+ const VerticalDistributionsDrawerButton = styled ( LinkButton ) `
435
446
display: block;
436
447
flex: 0;
437
448
margin: ${ space ( 1 ) } ${ space ( 2 ) } ${ space ( 1 ) } ${ space ( 1 ) } ;
0 commit comments