Skip to content

Commit 8033ef3

Browse files
authored
fix(alerts-migration): Align icons in list (#60079)
1 parent 5c364ba commit 8033ef3

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

static/app/views/alerts/list/rules/alertRulesList.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ function AlertRulesList() {
195195
<IconArrow color="gray300" size="xs" direction={sort.asc ? 'up' : 'down'} />
196196
);
197197

198+
const rulesWithMigrationWarnings = new Set(
199+
ruleList.filter(rule => hasMigrationUIFeatureFlag && ruleNeedsMigration(rule))
200+
);
201+
198202
return (
199203
<Fragment>
200204
<SentryDocumentTitle title={t('Alerts')} orgSlug={organization.slug} />
@@ -278,9 +282,8 @@ function AlertRulesList() {
278282
key={`${
279283
isIssueAlert(rule) ? AlertRuleType.METRIC : AlertRuleType.ISSUE
280284
}-${rule.id}`}
281-
showMigrationWarning={
282-
hasMigrationUIFeatureFlag && ruleNeedsMigration(rule)
283-
}
285+
showMigrationWarning={rulesWithMigrationWarnings.has(rule)}
286+
listHasMigrationWarnings={rulesWithMigrationWarnings.size > 0}
284287
projectsLoaded={initiallyLoaded}
285288
projects={projects as Project[]}
286289
rule={rule}

static/app/views/alerts/list/rules/row.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {isIssueAlert} from '../../utils';
4343

4444
type Props = {
4545
hasEditAccess: boolean;
46+
listHasMigrationWarnings: boolean;
4647
onDelete: (projectId: string, rule: CombinedMetricIssueAlerts) => void;
4748
onOwnerChange: (
4849
projectId: string,
@@ -65,6 +66,7 @@ function RuleListRow({
6566
onOwnerChange,
6667
hasEditAccess,
6768
showMigrationWarning,
69+
listHasMigrationWarnings,
6870
}: Props) {
6971
const {teams: userTeams} = useUserTeams();
7072
const [assignee, setAssignee] = useState<string>('');
@@ -319,13 +321,15 @@ function RuleListRow({
319321
<ErrorBoundary>
320322
<AlertNameWrapper isIssueAlert={isIssueAlert(rule)}>
321323
<FlexCenter>
322-
{showMigrationWarning && (
324+
{showMigrationWarning ? (
323325
<Tooltip
324326
title={t('The current thresholds for this alert could use some review')}
325327
>
326328
<StyledIconWarning />
327329
</Tooltip>
328-
)}
330+
) : listHasMigrationWarnings ? (
331+
<WarningPlaceholder />
332+
) : null}
329333
<Tooltip
330334
title={
331335
isIssueAlert(rule)
@@ -534,4 +538,10 @@ const StyledIconWarning = styled(IconWarning)`
534538
color: ${p => p.theme.yellow400};
535539
`;
536540

541+
const WarningPlaceholder = styled('div')`
542+
margin-right: ${space(1)};
543+
width: 16px;
544+
flex-shrink: 0;
545+
`;
546+
537547
export default RuleListRow;

0 commit comments

Comments
 (0)