Skip to content

Commit 52fe328

Browse files
priscilawebdevAhmed-Labs
authored andcommitted
ref(onboarding): Split React onboarding docs (#102564)
Contributes to https://linear.app/getsentry/issue/TET-864/introduce-folders-for-onboarding-platforms
1 parent 3aaedb7 commit 52fe328

File tree

11 files changed

+706
-670
lines changed

11 files changed

+706
-670
lines changed

static/app/gettingStartedDocs/javascript/react.tsx

Lines changed: 0 additions & 669 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import {widgetCalloutBlock} from 'sentry/components/onboarding/gettingStartedDoc/feedback/widgetCallout';
2+
import type {
3+
DocsParams,
4+
OnboardingConfig,
5+
} from 'sentry/components/onboarding/gettingStartedDoc/types';
6+
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types';
7+
import {
8+
getCrashReportJavaScriptInstallSteps,
9+
getCrashReportModalConfigDescription,
10+
getCrashReportModalIntroduction,
11+
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
12+
13+
export const crashReport: OnboardingConfig = {
14+
introduction: () => getCrashReportModalIntroduction(),
15+
install: (params: DocsParams) => getCrashReportJavaScriptInstallSteps(params),
16+
configure: () => [
17+
{
18+
type: StepType.CONFIGURE,
19+
content: [
20+
{
21+
type: 'text',
22+
text: getCrashReportModalConfigDescription({
23+
link: 'https://docs.sentry.io/platforms/javascript/guides/react/user-feedback/configuration/#crash-report-modal',
24+
}),
25+
},
26+
widgetCalloutBlock({
27+
link: 'https://docs.sentry.io/platforms/javascript/guides/react/user-feedback/#user-feedback-widget',
28+
}),
29+
],
30+
},
31+
],
32+
verify: () => [],
33+
nextSteps: () => [],
34+
};
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import crashReportCallout from 'sentry/components/onboarding/gettingStartedDoc/feedback/crashReportCallout';
2+
import type {
3+
DocsParams,
4+
OnboardingConfig,
5+
} from 'sentry/components/onboarding/gettingStartedDoc/types';
6+
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types';
7+
import {getFeedbackConfigureDescription} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
8+
import {tct} from 'sentry/locale';
9+
10+
import {getSdkSetupSnippet, installSnippetBlock} from './utils';
11+
12+
export const feedback: OnboardingConfig = {
13+
install: () => [
14+
{
15+
type: StepType.INSTALL,
16+
content: [
17+
{
18+
type: 'text',
19+
text: tct(
20+
'For the User Feedback integration to work, you must have the Sentry browser SDK package, or an equivalent framework SDK (e.g. [code:@sentry/react]) installed, minimum version 7.85.0.',
21+
{
22+
code: <code />,
23+
}
24+
),
25+
},
26+
installSnippetBlock,
27+
],
28+
},
29+
],
30+
configure: (params: DocsParams) => [
31+
{
32+
type: StepType.CONFIGURE,
33+
content: [
34+
{
35+
type: 'text',
36+
text: getFeedbackConfigureDescription({
37+
linkConfig:
38+
'https://docs.sentry.io/platforms/javascript/guides/react/user-feedback/configuration/',
39+
linkButton:
40+
'https://docs.sentry.io/platforms/javascript/guides/react/user-feedback/configuration/#bring-your-own-button',
41+
}),
42+
},
43+
{
44+
type: 'code',
45+
tabs: [
46+
{
47+
label: 'JavaScript',
48+
language: 'javascript',
49+
code: getSdkSetupSnippet(params),
50+
},
51+
],
52+
},
53+
{
54+
type: 'custom',
55+
content: crashReportCallout({
56+
link: 'https://docs.sentry.io/platforms/javascript/guides/react/user-feedback/#crash-report-modal',
57+
}),
58+
},
59+
],
60+
},
61+
],
62+
verify: () => [],
63+
nextSteps: () => [],
64+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types';
2+
import {featureFlag} from 'sentry/gettingStartedDocs/javascript/javascript/featureFlag';
3+
import {logs} from 'sentry/gettingStartedDocs/javascript/react/logs';
4+
5+
import {crashReport} from './crashReport';
6+
import {feedback} from './feedback';
7+
import {onboarding} from './onboarding';
8+
import {performance} from './performance';
9+
import {profiling} from './profiling';
10+
import {replay} from './replay';
11+
12+
const docs: Docs = {
13+
onboarding,
14+
feedbackOnboardingNpm: feedback,
15+
replayOnboarding: replay,
16+
performanceOnboarding: performance,
17+
crashReportOnboarding: crashReport,
18+
profilingOnboarding: profiling,
19+
logsOnboarding: logs,
20+
featureFlagOnboarding: featureFlag,
21+
};
22+
23+
export default docs;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {getJavascriptLogsOnboarding} from 'sentry/utils/gettingStartedDocs/javascript';
2+
3+
import {installSnippetBlock} from './utils';
4+
5+
export const logs = getJavascriptLogsOnboarding({
6+
installSnippetBlock,
7+
docsPlatform: 'react',
8+
packageName: '@sentry/react',
9+
});

static/app/gettingStartedDocs/javascript/react.spec.tsx renamed to static/app/gettingStartedDocs/javascript/react/onboarding.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {textWithMarkupMatcher} from 'sentry-test/utils';
44

55
import {ProductSolution} from 'sentry/components/onboarding/gettingStartedDoc/types';
66

7-
import docs from './react';
7+
import docs from '.';
88

99
describe('javascript-react onboarding docs', () => {
1010
it('renders onboarding docs correctly', () => {

0 commit comments

Comments
 (0)