Skip to content

Commit fb1d633

Browse files
committed
wip, show eventgraph in drawer
1 parent ddcbe84 commit fb1d633

File tree

2 files changed

+49
-26
lines changed

2 files changed

+49
-26
lines changed

static/app/views/issueDetails/streamline/eventGraph.tsx

+49-25
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ interface EventGraphProps {
4848
event: Event | undefined;
4949
group: Group;
5050
className?: string;
51+
showReleasesAs?: 'line' | 'bubble';
52+
showSummary?: boolean;
5153
style?: CSSProperties;
5254
}
5355

@@ -70,7 +72,13 @@ function createSeriesAndCount(stats: EventsStats) {
7072
);
7173
}
7274

73-
export function EventGraph({group, event, ...styleProps}: EventGraphProps) {
75+
export function EventGraph({
76+
group,
77+
event,
78+
showReleasesAs,
79+
showSummary = true,
80+
...styleProps
81+
}: EventGraphProps) {
7482
const theme = useTheme();
7583
const organization = useOrganization();
7684
const location = useLocation();
@@ -197,7 +205,7 @@ export function EventGraph({group, event, ...styleProps}: EventGraphProps) {
197205

198206
const releaseSeries = useReleaseMarkLineSeries({
199207
group,
200-
releases: hasReleaseBubblesSeries ? [] : releases,
208+
releases: hasReleaseBubblesSeries && showReleasesAs !== 'line' ? [] : releases,
201209
});
202210

203211
const {
@@ -207,14 +215,25 @@ export function EventGraph({group, event, ...styleProps}: EventGraphProps) {
207215
releaseBubbleXAxis,
208216
releaseBubbleGrid,
209217
} = useReleaseBubbles({
218+
chartRenderer: ({start: trimStart, end: trimEnd}) => {
219+
return (
220+
<EventGraph
221+
group={group}
222+
event={event}
223+
showSummary={false}
224+
showReleasesAs="line"
225+
{...styleProps}
226+
/>
227+
);
228+
},
210229
minTime: eventSeries.length && (eventSeries[0]!.name as number),
211230
maxTime: eventSeries.length && (eventSeries[eventSeries.length - 1]!.name as number),
212231
bubbleSize: 4,
213232
bubblePadding: {
214233
x: 1,
215234
y: 2,
216235
},
217-
releases,
236+
releases: hasReleaseBubblesSeries && showReleasesAs !== 'line' ? releases : [],
218237
});
219238
const flagSeries = useFlagSeries({
220239
query: {
@@ -378,28 +397,32 @@ export function EventGraph({group, event, ...styleProps}: EventGraphProps) {
378397

379398
return (
380399
<GraphWrapper {...styleProps}>
381-
<SummaryContainer>
382-
<GraphButton
383-
onClick={() =>
384-
visibleSeries === EventGraphSeries.USER &&
385-
setVisibleSeries(EventGraphSeries.EVENT)
386-
}
387-
isActive={visibleSeries === EventGraphSeries.EVENT}
388-
disabled={visibleSeries === EventGraphSeries.EVENT}
389-
label={tn('Event', 'Events', eventCount)}
390-
count={String(eventCount)}
391-
/>
392-
<GraphButton
393-
onClick={() =>
394-
visibleSeries === EventGraphSeries.EVENT &&
395-
setVisibleSeries(EventGraphSeries.USER)
396-
}
397-
isActive={visibleSeries === EventGraphSeries.USER}
398-
disabled={visibleSeries === EventGraphSeries.USER}
399-
label={tn('User', 'Users', userCount)}
400-
count={String(userCount)}
401-
/>
402-
</SummaryContainer>
400+
{showSummary ? (
401+
<SummaryContainer>
402+
<GraphButton
403+
onClick={() =>
404+
visibleSeries === EventGraphSeries.USER &&
405+
setVisibleSeries(EventGraphSeries.EVENT)
406+
}
407+
isActive={visibleSeries === EventGraphSeries.EVENT}
408+
disabled={visibleSeries === EventGraphSeries.EVENT}
409+
label={tn('Event', 'Events', eventCount)}
410+
count={String(eventCount)}
411+
/>
412+
<GraphButton
413+
onClick={() =>
414+
visibleSeries === EventGraphSeries.EVENT &&
415+
setVisibleSeries(EventGraphSeries.USER)
416+
}
417+
isActive={visibleSeries === EventGraphSeries.USER}
418+
disabled={visibleSeries === EventGraphSeries.USER}
419+
label={tn('User', 'Users', userCount)}
420+
count={String(userCount)}
421+
/>
422+
</SummaryContainer>
423+
) : (
424+
<div />
425+
)}
403426
<ChartContainer role="figure">
404427
<BarChart
405428
{...releaseBubbleEventHandlers}
@@ -481,6 +504,7 @@ function GraphButton({
481504
const GraphWrapper = styled('div')`
482505
display: grid;
483506
grid-template-columns: auto 1fr;
507+
min-height: 100px;
484508
`;
485509

486510
const SummaryContainer = styled('div')`

static/app/views/releases/drawer/releasesDrawerList.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,5 @@ export function ReleasesDrawerList({
8484
}
8585

8686
const ChartContainer = styled('div')`
87-
height: 220px;
8887
margin-bottom: ${space(2)};
8988
`;

0 commit comments

Comments
 (0)