@@ -26,6 +26,7 @@ import type {ReactEchartsRef, SeriesDataUnit} from 'sentry/types/echarts';
26
26
import type { Event } from 'sentry/types/event' ;
27
27
import type { Group } from 'sentry/types/group' ;
28
28
import type { EventsStats , MultiSeriesEventsStats } from 'sentry/types/organization' ;
29
+ import type EventView from 'sentry/utils/discover/eventView' ;
29
30
import { DiscoverDatasets } from 'sentry/utils/discover/types' ;
30
31
import { formatAbbreviatedNumber } from 'sentry/utils/formatters' ;
31
32
import { getConfigForIssueType } from 'sentry/utils/issueTypeConfig' ;
@@ -37,6 +38,7 @@ import useOrganization from 'sentry/utils/useOrganization';
37
38
import { useReleaseStats } from 'sentry/utils/useReleaseStats' ;
38
39
import { getBucketSize } from 'sentry/views/dashboards/utils/getBucketSize' ;
39
40
import { useIssueDetails } from 'sentry/views/issueDetails/streamline/context' ;
41
+ import { EVENT_GRAPH_WIDGET_ID } from 'sentry/views/issueDetails/streamline/eventGraphWidget' ;
40
42
import useFlagSeries from 'sentry/views/issueDetails/streamline/hooks/featureFlags/useFlagSeries' ;
41
43
import { useCurrentEventMarklineSeries } from 'sentry/views/issueDetails/streamline/hooks/useEventMarkLineSeries' ;
42
44
import {
@@ -48,7 +50,7 @@ import {Tab} from 'sentry/views/issueDetails/types';
48
50
import { useGroupDetailsRoute } from 'sentry/views/issueDetails/useGroupDetailsRoute' ;
49
51
import { useReleaseBubbles } from 'sentry/views/releases/releaseBubbles/useReleaseBubbles' ;
50
52
51
- const enum EventGraphSeries {
53
+ enum EventGraphSeries {
52
54
EVENT = 'event' ,
53
55
USER = 'user' ,
54
56
}
@@ -64,6 +66,7 @@ interface EventGraphProps {
64
66
* chart).
65
67
*/
66
68
disableZoomNavigation ?: boolean ;
69
+ eventView ?: EventView ;
67
70
ref ?: React . Ref < ReactEchartsRef > ;
68
71
/**
69
72
* Configures showing releases on the chart as bubbles or lines. This is used
@@ -100,6 +103,7 @@ function createSeriesAndCount(stats: EventsStats) {
100
103
export function EventGraph ( {
101
104
group,
102
105
event,
106
+ eventView : eventViewProps ,
103
107
disableZoomNavigation = false ,
104
108
showReleasesAs,
105
109
showSummary = true ,
@@ -131,7 +135,8 @@ export function EventGraph({
131
135
ref : chartContainerRef ,
132
136
onResize,
133
137
} ) ;
134
- const eventView = useIssueDetailsEventView ( { group, isSmallContainer} ) ;
138
+ const eventViewHook = useIssueDetailsEventView ( { group, isSmallContainer} ) ;
139
+ const eventView = eventViewProps || eventViewHook ;
135
140
136
141
const {
137
142
data : groupStats = { } ,
@@ -447,18 +452,22 @@ export function EventGraph({
447
452
if ( isLoadingStats || isPendingUniqueUsersCount ) {
448
453
return (
449
454
< GraphWrapper { ...styleProps } >
450
- < SummaryContainer >
451
- < GraphButton
452
- isActive = { visibleSeries === EventGraphSeries . EVENT }
453
- disabled
454
- label = { t ( 'Events' ) }
455
- />
456
- < GraphButton
457
- isActive = { visibleSeries === EventGraphSeries . USER }
458
- disabled
459
- label = { t ( 'Users' ) }
460
- />
461
- </ SummaryContainer >
455
+ { showSummary ? (
456
+ < SummaryContainer >
457
+ < GraphButton
458
+ isActive = { visibleSeries === EventGraphSeries . EVENT }
459
+ disabled
460
+ label = { t ( 'Events' ) }
461
+ />
462
+ < GraphButton
463
+ isActive = { visibleSeries === EventGraphSeries . USER }
464
+ disabled
465
+ label = { t ( 'Users' ) }
466
+ />
467
+ </ SummaryContainer >
468
+ ) : (
469
+ < div />
470
+ ) }
462
471
< LoadingChartContainer ref = { chartContainerRef } >
463
472
< Placeholder height = "96px" testId = "event-graph-loading" />
464
473
</ LoadingChartContainer >
@@ -561,7 +570,11 @@ function GraphButton({
561
570
label,
562
571
count,
563
572
...props
564
- } : { isActive : boolean ; label : string ; count ?: string } & Partial < ButtonProps > ) {
573
+ } : {
574
+ isActive : boolean ;
575
+ label : string ;
576
+ count ?: string ;
577
+ } & Partial < ButtonProps > ) {
565
578
return (
566
579
< CalloutButton
567
580
isActive = { isActive }
0 commit comments