|
@@ -30,7 +30,7 @@ import {defined, percent} from 'app/utils';
|
|
|
import {decodeScalar} from 'app/utils/queryString';
|
|
|
import {getCount, getCrashFreeRate, getCrashFreeSeries} from 'app/utils/sessions';
|
|
|
import {Color, Theme} from 'app/utils/theme';
|
|
|
-import {displayCrashFreePercent} from 'app/views/releases/utils';
|
|
|
+import {displayCrashFreeDiff, displayCrashFreePercent} from 'app/views/releases/utils';
|
|
|
|
|
|
import {generateReleaseMarkLines, releaseComparisonChartLabels} from '../../utils';
|
|
|
import {
|
|
@@ -126,7 +126,7 @@ function ReleaseComparisonChart({
|
|
|
? displayCrashFreePercent(allCrashFreeSessions)
|
|
|
: null,
|
|
|
diff: defined(diffCrashFreeSessions)
|
|
|
- ? `${Math.abs(round(diffCrashFreeSessions, 3))}%`
|
|
|
+ ? displayCrashFreeDiff(diffCrashFreeSessions, releaseCrashFreeSessions)
|
|
|
: null,
|
|
|
diffDirection: diffCrashFreeSessions
|
|
|
? diffCrashFreeSessions > 0
|
|
@@ -148,7 +148,7 @@ function ReleaseComparisonChart({
|
|
|
? displayCrashFreePercent(allCrashFreeUsers)
|
|
|
: null,
|
|
|
diff: defined(diffCrashFreeUsers)
|
|
|
- ? `${Math.abs(round(diffCrashFreeUsers, 3))}%`
|
|
|
+ ? displayCrashFreeDiff(diffCrashFreeUsers, releaseCrashFreeUsers)
|
|
|
: null,
|
|
|
diffDirection: diffCrashFreeUsers ? (diffCrashFreeUsers > 0 ? 'up' : 'down') : null,
|
|
|
diffColor: diffCrashFreeUsers
|
|
@@ -287,8 +287,9 @@ function ReleaseComparisonChart({
|
|
|
}
|
|
|
|
|
|
const {series, previousSeries, markLines} = getSeries(activeChart);
|
|
|
+ const chart = charts.find(ch => ch.type === activeChart);
|
|
|
|
|
|
- if (errored) {
|
|
|
+ if (errored || !chart) {
|
|
|
return (
|
|
|
<Panel>
|
|
|
<ErrorPanel>
|
|
@@ -310,6 +311,15 @@ function ReleaseComparisonChart({
|
|
|
previousSeries={previousSeries ?? []}
|
|
|
chartType={activeChart}
|
|
|
platform={platform}
|
|
|
+ value={chart.thisRelease}
|
|
|
+ diff={
|
|
|
+ <Change color={defined(chart.diffColor) ? chart.diffColor : undefined}>
|
|
|
+ {chart.diff}{' '}
|
|
|
+ {defined(chart.diffDirection) && (
|
|
|
+ <IconArrow direction={chart.diffDirection} size="xs" />
|
|
|
+ )}
|
|
|
+ </Change>
|
|
|
+ }
|
|
|
/>
|
|
|
</TransitionChart>
|
|
|
</ChartContainer>
|
|
@@ -413,6 +423,7 @@ const ChartToggle = styled('label')`
|
|
|
`;
|
|
|
|
|
|
const Change = styled('div')<{color?: Color}>`
|
|
|
+ font-size: ${p => p.theme.fontSizeLarge};
|
|
|
${p => p.color && `color: ${p.theme[p.color]}`}
|
|
|
`;
|
|
|
|