@@ -71,16 +71,6 @@ function ReleaseAdoption({
71
71
return [ ] ;
72
72
}
73
73
74
- const sessionsMarkLines = generateReleaseMarkLines (
75
- release ,
76
- project ,
77
- theme ,
78
- location ,
79
- {
80
- hideLabel : true ,
81
- axisIndex : sessionsAxisIndex ,
82
- }
83
- ) ;
84
74
const sessionSeriesData = getAdoptionSeries (
85
75
releaseSessions . groups ,
86
76
allSessions ?. groups ,
@@ -91,7 +81,12 @@ function ReleaseAdoption({
91
81
// Usually, there is one data point because there is very little sessions data.
92
82
const hasMultipleDataPoints = sessionSeriesData . length > 1 ;
93
83
const series = [
94
- ...( hasMultipleDataPoints ? sessionsMarkLines : [ ] ) ,
84
+ ...( hasMultipleDataPoints
85
+ ? generateReleaseMarkLines ( release , project , theme , location , {
86
+ hideLabel : true ,
87
+ axisIndex : sessionsAxisIndex ,
88
+ } )
89
+ : [ ] ) ,
95
90
{
96
91
seriesName : t ( 'Sessions' ) ,
97
92
connectNulls : true ,
@@ -102,23 +97,28 @@ function ReleaseAdoption({
102
97
] ;
103
98
104
99
if ( hasUsers ) {
105
- const usersMarkLines = generateReleaseMarkLines ( release , project , theme , location , {
106
- hideLabel : true ,
107
- axisIndex : usersAxisIndex ,
108
- } ) ;
100
+ const usersSeriesData = getAdoptionSeries (
101
+ releaseSessions . groups ,
102
+ allSessions ?. groups ,
103
+ releaseSessions . intervals ,
104
+ SessionFieldWithOperation . USERS
105
+ ) ;
106
+ // See note re: sessions about why we need to check for a single data point.
107
+ const hasMultipleDataPointsUsers = usersSeriesData . length > 1 ;
108
+ const usersMarkLines = hasMultipleDataPointsUsers
109
+ ? generateReleaseMarkLines ( release , project , theme , location , {
110
+ hideLabel : true ,
111
+ axisIndex : usersAxisIndex ,
112
+ } )
113
+ : [ ] ;
109
114
110
115
series . push ( ...usersMarkLines ) ;
111
116
series . push ( {
112
117
seriesName : t ( 'Users' ) ,
113
118
connectNulls : true ,
114
119
yAxisIndex : usersAxisIndex ,
115
120
xAxisIndex : usersAxisIndex ,
116
- data : getAdoptionSeries (
117
- releaseSessions . groups ,
118
- allSessions ?. groups ,
119
- releaseSessions . intervals ,
120
- SessionFieldWithOperation . USERS
121
- ) ,
121
+ data : usersSeriesData ,
122
122
} ) ;
123
123
}
124
124
0 commit comments