Skip to content

Commit 598d753

Browse files
fix(workflow): Removing metric stat column from alert list (#19350)
1 parent f26b81b commit 598d753

File tree

4 files changed

+2
-59
lines changed

4 files changed

+2
-59
lines changed

src/sentry/static/sentry/app/views/alerts/list/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ class IncidentsList extends AsyncComponent<Props, State & AsyncComponent['state'
163163
<div>{t('Alert')}</div>
164164
{status === 'open' && <div>{t('Graph')}</div>}
165165
</PaddedTitleAndSparkLine>
166-
{status === 'open' && <div>{t('Current Status')}</div>}
167166
<div>{t('Project')}</div>
168167
<div>{t('Triggered')}</div>
169168
{status === 'closed' && <div>{t('Duration')}</div>}

src/sentry/static/sentry/app/views/alerts/list/row.tsx

+1-41
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ import {IconWarning} from 'app/icons';
77
import {PanelItem} from 'app/components/panels';
88
import {t, tct} from 'app/locale';
99
import AsyncComponent from 'app/components/asyncComponent';
10-
import Count from 'app/components/count';
1110
import DateTime from 'app/components/dateTime';
1211
import Duration from 'app/components/duration';
1312
import ErrorBoundary from 'app/components/errorBoundary';
1413
import IdBadge from 'app/components/idBadge';
1514
import Link from 'app/components/links/link';
16-
import Placeholder from 'app/components/placeholder';
1715
import Projects from 'app/utils/projects';
1816
import theme from 'app/utils/theme';
1917
import TimeSince from 'app/components/timeSince';
@@ -99,14 +97,12 @@ class AlertListRow extends AsyncComponent<Props, State> {
9997

10098
renderBody() {
10199
const {incident, orgId, projectsLoaded, projects, filteredStatus} = this.props;
102-
const {loading, error, stats} = this.state;
100+
const {error, stats} = this.state;
103101
const started = moment(incident.dateStarted);
104102
const duration = moment
105103
.duration(moment(incident.dateClosed || new Date()).diff(started))
106104
.as('seconds');
107105
const slug = incident.projects[0];
108-
const lastEventStatsValue =
109-
stats?.eventStats.data[stats.eventStats.data.length - 1]?.[1]?.[0]?.count || 0;
110106

111107
return (
112108
<ErrorBoundary>
@@ -131,22 +127,6 @@ class AlertListRow extends AsyncComponent<Props, State> {
131127
)}
132128
</TitleAndSparkLine>
133129

134-
{filteredStatus === 'open' && (
135-
<NumericColumn>
136-
{!loading && !error ? (
137-
<React.Fragment>
138-
<MetricName>
139-
{this.metricPreset?.name ?? t('Custom metric')}
140-
{':'}
141-
</MetricName>
142-
<Count value={lastEventStatsValue} />
143-
</React.Fragment>
144-
) : (
145-
<NumericPlaceholder error={error && <ErrorLoadingStatsIcon />} />
146-
)}
147-
</NumericColumn>
148-
)}
149-
150130
<ProjectBadge
151131
avatarSize={18}
152132
project={!projectsLoaded ? {slug} : this.getProject(slug, projects)}
@@ -204,10 +184,6 @@ const Title = styled('span')`
204184
${overflowEllipsis}
205185
`;
206186

207-
const MetricName = styled('span')`
208-
margin-right: ${space(0.5)};
209-
`;
210-
211187
const IncidentLink = styled(Link)`
212188
padding: 0 ${space(1)};
213189
`;
@@ -217,20 +193,4 @@ const IncidentPanelItem = styled(PanelItem)`
217193
padding: ${space(1.5)} ${space(2)} ${space(1.5)} 0;
218194
`;
219195

220-
const NumericPlaceholder = styled(Placeholder)<{error?: React.ReactNode}>`
221-
${p =>
222-
p.error &&
223-
`
224-
align-items: center;
225-
line-height: 1;
226-
`}
227-
height: 100%;
228-
`;
229-
230-
const NumericColumn = styled('div')`
231-
height: 100%;
232-
display: flex;
233-
align-items: center;
234-
`;
235-
236196
export default AlertListRow;

src/sentry/static/sentry/app/views/alerts/list/styles.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import space from 'app/styles/space';
55
const TableLayout = styled('div')<{status: 'open' | 'closed'}>`
66
display: grid;
77
grid-template-columns: ${p =>
8-
p.status === 'open' ? '4fr 2fr 1fr 2fr' : '3fr 2fr 2fr 1fr 2fr'};
8+
p.status === 'open' ? '4fr 1fr 2fr' : '3fr 2fr 2fr 1fr 2fr'};
99
grid-column-gap: ${space(1.5)};
1010
width: 100%;
1111
align-items: center;

tests/js/spec/views/alerts/list/index.spec.jsx

-16
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,6 @@ describe('IncidentsList', function() {
115115
).toMatchObject({
116116
slug: 'a',
117117
});
118-
119-
expect(
120-
items
121-
.at(0)
122-
.find('Count')
123-
.at(0)
124-
.text()
125-
).toBe('0');
126-
127-
expect(
128-
items
129-
.at(1)
130-
.find('Count')
131-
.at(0)
132-
.text()
133-
).toBe('42');
134118
});
135119

136120
it('displays empty state', async function() {

0 commit comments

Comments
 (0)