Skip to content

Commit be8e52b

Browse files
scttcperclaude
andcommitted
ref(shared-issues): Replace EventEntries with SharedEventContent
Replace the generic EventEntries component with a focused SharedEventContent component co-located with its only consumer, the shared issue details page. The old component had an isShare prop that was always true in practice, dead code branches for non-share rendering, and rendered components (EventContexts, EventSdk, EventDevice, etc.) for data the SharedEventSerializer never sends. The new component only renders what the backend actually provides: entries, evidence, packages, and user feedback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 89ef2bd commit be8e52b

5 files changed

Lines changed: 125 additions & 300 deletions

File tree

static/app/components/events/eventEntries.spec.tsx

Lines changed: 0 additions & 68 deletions
This file was deleted.

static/app/components/events/eventEntries.tsx

Lines changed: 0 additions & 229 deletions
This file was deleted.

static/app/views/sharedGroupDetails/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {Container} from '@sentry/scraps/layout';
44
import {Link} from '@sentry/scraps/link';
55

66
import {NotFound} from 'sentry/components/errors/notFound';
7-
import {BorderlessEventEntries} from 'sentry/components/events/eventEntries';
87
import {Footer} from 'sentry/components/footer';
98
import {LoadingError} from 'sentry/components/loadingError';
109
import {LoadingIndicator} from 'sentry/components/loadingIndicator';
@@ -16,6 +15,7 @@ import {useApiQuery} from 'sentry/utils/queryClient';
1615
import {useParams} from 'sentry/utils/useParams';
1716
import {OrganizationContext} from 'sentry/views/organizationContext';
1817

18+
import {SharedEventContent} from './sharedEventContent';
1919
import {SharedGroupHeader} from './sharedGroupHeader';
2020

2121
function SharedGroupDetails() {
@@ -94,12 +94,11 @@ function SharedGroupDetails() {
9494
padding="3xl"
9595
className="group-overview event-details-container"
9696
>
97-
<BorderlessEventEntries
97+
<SharedEventContent
9898
organization={org}
9999
group={group}
100100
event={group.latestEvent}
101101
project={group.project}
102-
isShare
103102
/>
104103
</Container>
105104
<Footer />
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import {EventFixture} from 'sentry-fixture/event';
2+
import {EventEntryFixture} from 'sentry-fixture/eventEntry';
3+
import {GroupFixture} from 'sentry-fixture/group';
4+
import {OrganizationFixture} from 'sentry-fixture/organization';
5+
import {ProjectFixture} from 'sentry-fixture/project';
6+
7+
import {render, screen} from 'sentry-test/reactTestingLibrary';
8+
9+
import {SharedEventContent} from './sharedEventContent';
10+
11+
describe('SharedEventContent', () => {
12+
const organization = OrganizationFixture();
13+
const project = ProjectFixture();
14+
15+
it('renders event entries', () => {
16+
render(
17+
<SharedEventContent
18+
organization={organization}
19+
project={project}
20+
event={EventFixture({
21+
entries: [EventEntryFixture()],
22+
})}
23+
/>
24+
);
25+
26+
expect(screen.getByText(/message/i)).toBeInTheDocument();
27+
});
28+
29+
it('renders latest event not available when no event', () => {
30+
render(<SharedEventContent organization={organization} project={project} />);
31+
32+
expect(screen.getByText('Latest Event Not Available')).toBeInTheDocument();
33+
});
34+
35+
it('renders user feedback when present', () => {
36+
const group = GroupFixture();
37+
render(
38+
<SharedEventContent
39+
organization={organization}
40+
project={project}
41+
group={group}
42+
event={EventFixture({
43+
userReport: {
44+
comments: 'This is broken!',
45+
dateCreated: '2024-01-01',
46+
email: 'user@example.com',
47+
eventID: '1',
48+
id: '1',
49+
issue: null,
50+
name: 'Test User',
51+
user: null,
52+
},
53+
entries: [],
54+
})}
55+
/>
56+
);
57+
58+
expect(screen.getByText('This is broken!')).toBeInTheDocument();
59+
});
60+
});

0 commit comments

Comments
 (0)