Skip to content

Commit 87a5844

Browse files
committed
move settings to existing file, and tidy up params in NewAndResolvedIssueChart
1 parent e6b92e1 commit 87a5844

12 files changed

+26
-37
lines changed

static/app/views/insights/sessions/charts/crashFreeSessionsChart.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import {tct} from 'sentry/locale';
33
import {formatSeriesName} from 'sentry/views/dashboards/widgets/timeSeriesWidget/formatters/formatSeriesName';
44
import {InsightsLineChartWidget} from 'sentry/views/insights/common/components/insightsLineChartWidget';
55
import ChartSelectionTitle from 'sentry/views/insights/sessions/components/chartSelectionTitle';
6-
import {CHART_TITLES} from 'sentry/views/insights/sessions/components/settings';
76
import useCrashFreeSessions from 'sentry/views/insights/sessions/queries/useCrashFreeSessions';
7+
import {CHART_TITLES} from 'sentry/views/insights/sessions/settings';
88

99
export default function CrashFreeSessionsChart() {
1010
const {series, releases, isPending, error} = useCrashFreeSessions();

static/app/views/insights/sessions/charts/errorFreeSessionsChart.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import ExternalLink from 'sentry/components/links/externalLink';
22
import {t, tct} from 'sentry/locale';
33
import {InsightsLineChartWidget} from 'sentry/views/insights/common/components/insightsLineChartWidget';
44
import ChartSelectionTitle from 'sentry/views/insights/sessions/components/chartSelectionTitle';
5-
import {CHART_TITLES} from 'sentry/views/insights/sessions/components/settings';
65
import useErrorFreeSessions from 'sentry/views/insights/sessions/queries/useErrorFreeSessions';
6+
import {CHART_TITLES} from 'sentry/views/insights/sessions/settings';
77

88
export default function ErrorFreeSessionsChart() {
99
const {series, isPending, error} = useErrorFreeSessions();

static/app/views/insights/sessions/charts/newAndResolvedIssueChart.tsx

+7-17
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,22 @@
11
import {t} from 'sentry/locale';
22
import {InsightsBarChartWidget} from 'sentry/views/insights/common/components/insightsBarChartWidget';
33
import ChartSelectionTitle from 'sentry/views/insights/sessions/components/chartSelectionTitle';
4-
import {CHART_TITLES} from 'sentry/views/insights/sessions/components/settings';
54
import useNewAndResolvedIssues from 'sentry/views/insights/sessions/queries/useNewAndResolvedIssues';
5+
import {CHART_TITLES} from 'sentry/views/insights/sessions/settings';
66

7-
export default function NewAndResolvedIssueChart({type}: {type: 'issue' | 'feedback'}) {
8-
const {series, isPending, error} = useNewAndResolvedIssues({type});
7+
export default function NewAndResolvedIssueChart({type}: {type: 'issue'}) {
8+
const {series, isPending, error} = useNewAndResolvedIssues({type: 'issue'});
99

1010
const aliases = {
11-
new_issues_count: `new_${type}s`,
12-
resolved_issues_count: `resolved_${type}s`,
11+
new_issues_count: 'new_issues',
12+
resolved_issues_count: 'resolved_issues',
1313
};
1414

1515
return (
1616
<InsightsBarChartWidget
17-
title={
18-
type === 'issue'
19-
? CHART_TITLES.NewAndResolvedIssueChart
20-
: CHART_TITLES.NewAndResolvedFeedbackChart
21-
}
17+
title={CHART_TITLES.NewAndResolvedIssueChart}
2218
interactiveTitle={() => (
23-
<ChartSelectionTitle
24-
title={
25-
type === 'issue'
26-
? CHART_TITLES.NewAndResolvedIssueChart
27-
: CHART_TITLES.NewAndResolvedFeedbackChart
28-
}
29-
/>
19+
<ChartSelectionTitle title={CHART_TITLES.NewAndResolvedIssueChart} />
3020
)}
3121
description={t('New and resolved %s counts over time.', type)}
3222
aliases={aliases}

static/app/views/insights/sessions/charts/releaseNewIssuesChart.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {t} from 'sentry/locale';
22
import {InsightsLineChartWidget} from 'sentry/views/insights/common/components/insightsLineChartWidget';
33
import ChartSelectionTitle from 'sentry/views/insights/sessions/components/chartSelectionTitle';
4-
import {CHART_TITLES} from 'sentry/views/insights/sessions/components/settings';
54
import useReleaseNewIssues from 'sentry/views/insights/sessions/queries/useReleaseNewIssues';
5+
import {CHART_TITLES} from 'sentry/views/insights/sessions/settings';
66

77
export default function ReleaseNewIssuesChart() {
88
const {series, isPending, error} = useReleaseNewIssues();

static/app/views/insights/sessions/charts/releaseSessionCountChart.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {t} from 'sentry/locale';
22
import {formatSeriesName} from 'sentry/views/dashboards/widgets/timeSeriesWidget/formatters/formatSeriesName';
33
import {InsightsLineChartWidget} from 'sentry/views/insights/common/components/insightsLineChartWidget';
44
import ChartSelectionTitle from 'sentry/views/insights/sessions/components/chartSelectionTitle';
5-
import {CHART_TITLES} from 'sentry/views/insights/sessions/components/settings';
65
import useReleaseSessionCounts from 'sentry/views/insights/sessions/queries/useReleaseSessionCounts';
6+
import {CHART_TITLES} from 'sentry/views/insights/sessions/settings';
77

88
export default function ReleaseSessionCountChart() {
99
const {series, releases, isPending, error} = useReleaseSessionCounts();

static/app/views/insights/sessions/charts/releaseSessionPercentageChart.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {t} from 'sentry/locale';
22
import {formatSeriesName} from 'sentry/views/dashboards/widgets/timeSeriesWidget/formatters/formatSeriesName';
33
import {InsightsAreaChartWidget} from 'sentry/views/insights/common/components/insightsAreaChartWidget';
44
import ChartSelectionTitle from 'sentry/views/insights/sessions/components/chartSelectionTitle';
5-
import {CHART_TITLES} from 'sentry/views/insights/sessions/components/settings';
65
import useReleaseSessionPercentage from 'sentry/views/insights/sessions/queries/useReleaseSessionPercentage';
6+
import {CHART_TITLES} from 'sentry/views/insights/sessions/settings';
77

88
export default function ReleaseSessionPercentageChart() {
99
const {series, releases, isPending, error} = useReleaseSessionPercentage();

static/app/views/insights/sessions/charts/sessionHealthRateChart.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import ExternalLink from 'sentry/components/links/externalLink';
22
import {tct} from 'sentry/locale';
33
import {InsightsAreaChartWidget} from 'sentry/views/insights/common/components/insightsAreaChartWidget';
44
import ChartSelectionTitle from 'sentry/views/insights/sessions/components/chartSelectionTitle';
5-
import {CHART_TITLES} from 'sentry/views/insights/sessions/components/settings';
65
import useSessionHealthBreakdown from 'sentry/views/insights/sessions/queries/useSessionHealthBreakdown';
6+
import {CHART_TITLES} from 'sentry/views/insights/sessions/settings';
77

88
export default function SessionHealthRateChart() {
99
const {series, isPending, error} = useSessionHealthBreakdown({type: 'rate'});

static/app/views/insights/sessions/charts/userHealthCountChart.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import ExternalLink from 'sentry/components/links/externalLink';
22
import {tct} from 'sentry/locale';
33
import {InsightsLineChartWidget} from 'sentry/views/insights/common/components/insightsLineChartWidget';
44
import ChartSelectionTitle from 'sentry/views/insights/sessions/components/chartSelectionTitle';
5-
import {CHART_TITLES} from 'sentry/views/insights/sessions/components/settings';
65
import useUserHealthBreakdown from 'sentry/views/insights/sessions/queries/useUserHealthBreakdown';
6+
import {CHART_TITLES} from 'sentry/views/insights/sessions/settings';
77

88
export default function UserHealthCountChart() {
99
const {series, isPending, error} = useUserHealthBreakdown({type: 'count'});

static/app/views/insights/sessions/charts/userHealthRateChart.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import ExternalLink from 'sentry/components/links/externalLink';
22
import {tct} from 'sentry/locale';
33
import {InsightsAreaChartWidget} from 'sentry/views/insights/common/components/insightsAreaChartWidget';
44
import ChartSelectionTitle from 'sentry/views/insights/sessions/components/chartSelectionTitle';
5-
import {CHART_TITLES} from 'sentry/views/insights/sessions/components/settings';
65
import useUserHealthBreakdown from 'sentry/views/insights/sessions/queries/useUserHealthBreakdown';
6+
import {CHART_TITLES} from 'sentry/views/insights/sessions/settings';
77

88
export default function UserHealthRateChart() {
99
const {series, isPending, error} = useUserHealthBreakdown({type: 'rate'});

static/app/views/insights/sessions/components/chartPlacement.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
CHART_TITLES,
1212
DEFAULT_LAYOUTS,
1313
PAGE_CHART_OPTIONS,
14-
} from 'sentry/views/insights/sessions/components/settings';
14+
} from 'sentry/views/insights/sessions/settings';
1515

1616
type TChart = keyof typeof CHART_MAP;
1717
type Option = {label: string; value: TChart};

static/app/views/insights/sessions/settings.ts

-11
This file was deleted.

static/app/views/insights/sessions/components/settings.tsx static/app/views/insights/sessions/settings.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ import SessionHealthRateChart from 'sentry/views/insights/sessions/charts/sessio
1111
import UserHealthCountChart from 'sentry/views/insights/sessions/charts/userHealthCountChart';
1212
import UserHealthRateChart from 'sentry/views/insights/sessions/charts/userHealthRateChart';
1313

14+
export const MODULE_TITLE = t('Session Health');
15+
16+
export const DATA_TYPE = t('Session');
17+
export const DATA_TYPE_PLURAL = t('Sessions');
18+
export const BASE_URL = 'sessions';
19+
20+
export const MODULE_DOC_LINK = 'https://docs.sentry.io/product/releases/setup/';
21+
22+
export const MODULE_VISIBLE_FEATURES = ['insights-session-health-tab-ui'];
23+
1424
export const CHART_MAP = {
1525
CrashFreeSessionsChart,
1626
ErrorFreeSessionsChart,

0 commit comments

Comments
 (0)