Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions src/components/onboarding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ const optionDetails: Record<
name: 'Error Monitoring',
description: "Let's admit it, we all have errors.",
},
logs: {
name: 'Logs',
description: (
<span>
Send text-based log information from your applications to Sentry for viewing
alongside relevant errors and searching by text-string or individual attributes.
</span>
),
},
'session-replay': {
name: 'Session Replay',
description: (
<span>
Video-like reproductions of user sessions with debugging context to help you
confirm issue impact and troubleshoot faster.
</span>
),
},
performance: {
name: 'Tracing',
description: (
Expand All @@ -41,15 +59,6 @@ const optionDetails: Record<
),
deps: ['performance'],
},
'session-replay': {
name: 'Session Replay',
description: (
<span>
Video-like reproductions of user sessions with debugging context to help you
confirm issue impact and troubleshoot faster.
</span>
),
},
'user-feedback': {
name: 'User Feedback',
description: (
Expand All @@ -59,15 +68,6 @@ const optionDetails: Record<
</span>
),
},
logs: {
name: 'Logs (Beta)',
description: (
<span>
Send text-based log information from your applications to Sentry for viewing
alongside relevant errors and searching by text-string or individual attributes.
</span>
),
},
'source-context': {
name: 'Source Context',
description: (
Expand Down Expand Up @@ -101,20 +101,20 @@ const optionDetails: Record<
},
};

const OPTION_IDS = [
const OPTION_IDS = new Set([
'error-monitoring',
'logs',
'session-replay',
'performance',
'profiling',
'session-replay',
'source-maps',
'user-feedback',
'logs',
'source-context',
'dsym',
'source-maps',
'opentelemetry',
] as const;
] as const);

type OptionId = (typeof OPTION_IDS)[number];
type OptionId = typeof OPTION_IDS extends Set<infer T> ? T : never;

export type OnboardingOptionType = {
/**
Expand All @@ -132,9 +132,11 @@ export type OnboardingOptionType = {

const validateOptionIds = (options: Pick<OnboardingOptionType, 'id'>[]) => {
options.forEach(option => {
if (!OPTION_IDS.includes(option.id)) {
if (!OPTION_IDS.has(option.id)) {
throw new Error(
`Invalid option id: ${option.id}.\nValid options are: ${OPTION_IDS.map(opt => `"${opt}"`).join(', ')}`
`Invalid option id: ${option.id}.\nValid options are: ${Array.from(OPTION_IDS)
.map(opt => `"${opt}"`)
.join(', ')}`
);
}
});
Expand Down
Loading