File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
static/app/views/alerts/list/rules Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,10 @@ function AlertRulesList() {
195
195
< IconArrow color = "gray300" size = "xs" direction = { sort . asc ? 'up' : 'down' } />
196
196
) ;
197
197
198
+ const rulesWithMigrationWarnings = new Set (
199
+ ruleList . filter ( rule => hasMigrationUIFeatureFlag && ruleNeedsMigration ( rule ) )
200
+ ) ;
201
+
198
202
return (
199
203
< Fragment >
200
204
< SentryDocumentTitle title = { t ( 'Alerts' ) } orgSlug = { organization . slug } />
@@ -278,9 +282,8 @@ function AlertRulesList() {
278
282
key = { `${
279
283
isIssueAlert ( rule ) ? AlertRuleType . METRIC : AlertRuleType . ISSUE
280
284
} -${ rule . id } `}
281
- showMigrationWarning = {
282
- hasMigrationUIFeatureFlag && ruleNeedsMigration ( rule )
283
- }
285
+ showMigrationWarning = { rulesWithMigrationWarnings . has ( rule ) }
286
+ listHasMigrationWarnings = { rulesWithMigrationWarnings . size > 0 }
284
287
projectsLoaded = { initiallyLoaded }
285
288
projects = { projects as Project [ ] }
286
289
rule = { rule }
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import {isIssueAlert} from '../../utils';
43
43
44
44
type Props = {
45
45
hasEditAccess : boolean ;
46
+ listHasMigrationWarnings : boolean ;
46
47
onDelete : ( projectId : string , rule : CombinedMetricIssueAlerts ) => void ;
47
48
onOwnerChange : (
48
49
projectId : string ,
@@ -65,6 +66,7 @@ function RuleListRow({
65
66
onOwnerChange,
66
67
hasEditAccess,
67
68
showMigrationWarning,
69
+ listHasMigrationWarnings,
68
70
} : Props ) {
69
71
const { teams : userTeams } = useUserTeams ( ) ;
70
72
const [ assignee , setAssignee ] = useState < string > ( '' ) ;
@@ -319,13 +321,15 @@ function RuleListRow({
319
321
< ErrorBoundary >
320
322
< AlertNameWrapper isIssueAlert = { isIssueAlert ( rule ) } >
321
323
< FlexCenter >
322
- { showMigrationWarning && (
324
+ { showMigrationWarning ? (
323
325
< Tooltip
324
326
title = { t ( 'The current thresholds for this alert could use some review' ) }
325
327
>
326
328
< StyledIconWarning />
327
329
</ Tooltip >
328
- ) }
330
+ ) : listHasMigrationWarnings ? (
331
+ < WarningPlaceholder />
332
+ ) : null }
329
333
< Tooltip
330
334
title = {
331
335
isIssueAlert ( rule )
@@ -534,4 +538,10 @@ const StyledIconWarning = styled(IconWarning)`
534
538
color: ${ p => p . theme . yellow400 } ;
535
539
` ;
536
540
541
+ const WarningPlaceholder = styled ( 'div' ) `
542
+ margin-right: ${ space ( 1 ) } ;
543
+ width: 16px;
544
+ flex-shrink: 0;
545
+ ` ;
546
+
537
547
export default RuleListRow ;
You can’t perform that action at this time.
0 commit comments