Skip to content

Commit 9740cd8

Browse files
authored
fix(releases): Fix user release adoption for single series (#91250)
TBH not familiar with this code, following comment instructions for the session adoption. Fixes JAVASCRIPT-2YXM
1 parent 33e0fe2 commit 9740cd8

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

static/app/views/releases/detail/overview/sidebar/releaseAdoption.tsx

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,6 @@ function ReleaseAdoption({
7171
return [];
7272
}
7373

74-
const sessionsMarkLines = generateReleaseMarkLines(
75-
release,
76-
project,
77-
theme,
78-
location,
79-
{
80-
hideLabel: true,
81-
axisIndex: sessionsAxisIndex,
82-
}
83-
);
8474
const sessionSeriesData = getAdoptionSeries(
8575
releaseSessions.groups,
8676
allSessions?.groups,
@@ -91,7 +81,12 @@ function ReleaseAdoption({
9181
// Usually, there is one data point because there is very little sessions data.
9282
const hasMultipleDataPoints = sessionSeriesData.length > 1;
9383
const series = [
94-
...(hasMultipleDataPoints ? sessionsMarkLines : []),
84+
...(hasMultipleDataPoints
85+
? generateReleaseMarkLines(release, project, theme, location, {
86+
hideLabel: true,
87+
axisIndex: sessionsAxisIndex,
88+
})
89+
: []),
9590
{
9691
seriesName: t('Sessions'),
9792
connectNulls: true,
@@ -102,23 +97,28 @@ function ReleaseAdoption({
10297
];
10398

10499
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+
: [];
109114

110115
series.push(...usersMarkLines);
111116
series.push({
112117
seriesName: t('Users'),
113118
connectNulls: true,
114119
yAxisIndex: usersAxisIndex,
115120
xAxisIndex: usersAxisIndex,
116-
data: getAdoptionSeries(
117-
releaseSessions.groups,
118-
allSessions?.groups,
119-
releaseSessions.intervals,
120-
SessionFieldWithOperation.USERS
121-
),
121+
data: usersSeriesData,
122122
});
123123
}
124124

0 commit comments

Comments
 (0)