Skip to content

Commit

Permalink
ref(ui): Remove unreachable ?? paths (#76744)
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper committed Aug 29, 2024
1 parent e96d095 commit 14b4c82
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 36 deletions.
2 changes: 1 addition & 1 deletion static/app/components/forms/model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class FormModel {
* Set form options
*/
setFormOptions(options: FormOptions) {
this.options = {...this.options, ...options} || {};
this.options = {...this.options, ...options};
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ export const getResourceTypeFilter = (
let resourceFilter: string[] = [`${SPAN_OP}:resource.*`];

if (selectedSpanOp) {
resourceFilter = [SPAN_OP_FILTER[selectedSpanOp].join(' OR ')] || [
`${SPAN_OP}:${selectedSpanOp}`,
];
resourceFilter = [SPAN_OP_FILTER[selectedSpanOp].join(' OR ')];
} else if (defaultResourceTypes) {
resourceFilter = [
defaultResourceTypes.map(type => SPAN_OP_FILTER[type].join(' OR ')).join(' OR '),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const useProjectWebVitalsScoresTimeseriesQuery = ({
data[webVital].push({
value:
result?.data?.[`weighted_performance_score(measurements.score.${webVital})`]
?.data[index][1][0].count * 100 ?? 0,
?.data[index][1][0].count * 100,
name: interval[0] * 1000,
});
});
Expand All @@ -148,7 +148,7 @@ export const useProjectWebVitalsScoresTimeseriesQuery = ({
value:
result?.data?.[`performance_score(measurements.score.${webVital})`]?.data[
index
][1][0].count * 100 ?? 0,
][1][0].count * 100,
name: interval[0] * 1000,
});
});
Expand Down
22 changes: 10 additions & 12 deletions static/app/views/insights/queues/charts/latencyChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,16 @@ export function LatencyChart({error, destination, referrer}: Props) {
top: '8px',
bottom: '0',
}}
data={
[
{
seriesName: t('Average Time in Queue'),
data: data['avg(messaging.message.receive.latency)'].data,
},
{
seriesName: t('Average Processing Time'),
data: data['avg(span.duration)'].data,
},
] ?? []
}
data={[
{
seriesName: t('Average Time in Queue'),
data: data['avg(messaging.message.receive.latency)'].data,
},
{
seriesName: t('Average Processing Time'),
data: data['avg(span.duration)'].data,
},
]}
loading={isPending}
error={error}
chartColors={CHART_PALETTE[2].slice(1)}
Expand Down
22 changes: 10 additions & 12 deletions static/app/views/insights/queues/charts/throughputChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,16 @@ export function ThroughputChart({error, destination, referrer}: Props) {
top: '8px',
bottom: '0',
}}
data={
[
{
seriesName: t('Published'),
data: publishData['spm()'].data,
},
{
seriesName: t('Processed'),
data: processData['spm()'].data,
},
] ?? []
}
data={[
{
seriesName: t('Published'),
data: publishData['spm()'].data,
},
{
seriesName: t('Processed'),
data: processData['spm()'].data,
},
]}
loading={isPublishDataLoading || isProcessDataLoading}
error={error}
chartColors={CHART_PALETTE[2].slice(1, 3)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export class TraceTextMeasurer {
return;
}

canvas.width = 50 * window.devicePixelRatio ?? 1;
canvas.height = 50 * window.devicePixelRatio ?? 1;
canvas.width = 50 * window.devicePixelRatio;
canvas.height = 50 * window.devicePixelRatio;

ctx.font = '11px' + theme.text.family;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class ProjectSessionsChartRequest extends Component<
const crashedSessionsPercent =
responseData.groups[0]?.series[field].slice(
fetchedWithPrevious ? dataMiddleIndex : 0
)[i] * 100 ?? 0;
)[i] * 100;

return {
name: interval,
Expand All @@ -271,8 +271,7 @@ class ProjectSessionsChartRequest extends Component<
seriesName: t('Previous Period'),
data: responseData.intervals.slice(0, dataMiddleIndex).map((_interval, i) => {
const crashedSessionsPercent =
responseData.groups[0]?.series[field].slice(0, dataMiddleIndex)[i] * 100 ??
0;
responseData.groups[0]?.series[field].slice(0, dataMiddleIndex)[i] * 100;

return {
name: responseData.intervals[i + dataMiddleIndex],
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const SENTRY_EXPERIMENTAL_SPA =
const SENTRY_SPA_DSN = SENTRY_EXPERIMENTAL_SPA ? env.SENTRY_SPA_DSN : undefined;
const CODECOV_TOKEN = env.CODECOV_TOKEN;
// value should come back as either 'true' or 'false' or undefined
const ENABLE_CODECOV_BA = env.CODECOV_ENABLE_BA === 'true' ?? false;
const ENABLE_CODECOV_BA = env.CODECOV_ENABLE_BA === 'true';

// this is the path to the django "sentry" app, we output the webpack build here to `dist`
// so that `django collectstatic` and so that we can serve the post-webpack bundles
Expand Down

0 comments on commit 14b4c82

Please sign in to comment.