Skip to content

Commit 1b4dbba

Browse files
ref(onboarding): Split unity onboarding doc into multiple files (#102196)
Contributes to https://linear.app/getsentry/issue/TET-864/introduce-folders-for-onboarding-platforms
1 parent 3684804 commit 1b4dbba

File tree

4 files changed

+57
-52
lines changed

4 files changed

+57
-52
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import type {OnboardingConfig} from 'sentry/components/onboarding/gettingStartedDoc/types';
2+
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types';
3+
import {
4+
getCrashReportApiIntroduction,
5+
getCrashReportInstallDescription,
6+
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
7+
8+
export const crashReport: OnboardingConfig = {
9+
introduction: () => getCrashReportApiIntroduction(),
10+
install: () => [
11+
{
12+
type: StepType.INSTALL,
13+
content: [
14+
{
15+
type: 'text',
16+
text: getCrashReportInstallDescription(),
17+
},
18+
{
19+
type: 'code',
20+
tabs: [
21+
{
22+
label: 'C#',
23+
language: 'csharp',
24+
code: `var eventId = SentrySdk.CaptureMessage("An event that will receive user feedback.");
25+
26+
SentrySdk.CaptureUserFeedback(eventId, "user@example.com", "It broke.", "The User");`,
27+
},
28+
{
29+
label: 'F#',
30+
language: 'fsharp',
31+
code: `let eventId = SentrySdk.CaptureMessage("An event that will receive user feedback.")
32+
33+
SentrySdk.CaptureUserFeedback(eventId, "user@example.com", "It broke.", "The User")`,
34+
},
35+
],
36+
},
37+
],
38+
},
39+
],
40+
configure: () => [],
41+
verify: () => [],
42+
nextSteps: () => [],
43+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types';
2+
3+
import {crashReport} from './crashReport';
4+
import {onboarding} from './onboarding';
5+
6+
const docs: Docs = {
7+
onboarding,
8+
feedbackOnboardingCrashApi: crashReport,
9+
crashReportOnboarding: crashReport,
10+
};
11+
12+
export default docs;

static/app/gettingStartedDocs/unity/unity.spec.tsx renamed to static/app/gettingStartedDocs/unity/unity/onboarding.spec.tsx

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

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

99
function renderMockRequests() {
1010
MockApiClient.addMockResponse({

static/app/gettingStartedDocs/unity/unity.tsx renamed to static/app/gettingStartedDocs/unity/unity/onboarding.tsx

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
import {ExternalLink} from 'sentry/components/core/link';
22
import {StoreCrashReportsConfig} from 'sentry/components/onboarding/gettingStartedDoc/storeCrashReportsConfig';
33
import type {
4-
Docs,
54
OnboardingConfig,
65
OnboardingStep,
76
} from 'sentry/components/onboarding/gettingStartedDoc/types';
87
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types';
98
import {getConsoleExtensions} from 'sentry/components/onboarding/gettingStartedDoc/utils/consoleExtensions';
10-
import {
11-
getCrashReportApiIntroduction,
12-
getCrashReportInstallDescription,
13-
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
149
import {t, tct} from 'sentry/locale';
1510

1611
const getVerifySnippet = () => `
1712
using Sentry; // On the top of the script
1813
1914
SentrySdk.CaptureMessage("Test event");`;
2015

21-
const onboarding: OnboardingConfig = {
16+
export const onboarding: OnboardingConfig = {
2217
install: () => [
2318
{
2419
type: StepType.INSTALL,
@@ -135,48 +130,3 @@ const onboarding: OnboardingConfig = {
135130
},
136131
],
137132
};
138-
139-
export const feedbackOnboarding: OnboardingConfig = {
140-
introduction: () => getCrashReportApiIntroduction(),
141-
install: () => [
142-
{
143-
type: StepType.INSTALL,
144-
content: [
145-
{
146-
type: 'text',
147-
text: getCrashReportInstallDescription(),
148-
},
149-
{
150-
type: 'code',
151-
tabs: [
152-
{
153-
label: 'C#',
154-
language: 'csharp',
155-
code: `var eventId = SentrySdk.CaptureMessage("An event that will receive user feedback.");
156-
157-
SentrySdk.CaptureUserFeedback(eventId, "user@example.com", "It broke.", "The User");`,
158-
},
159-
{
160-
label: 'F#',
161-
language: 'fsharp',
162-
code: `let eventId = SentrySdk.CaptureMessage("An event that will receive user feedback.")
163-
164-
SentrySdk.CaptureUserFeedback(eventId, "user@example.com", "It broke.", "The User")`,
165-
},
166-
],
167-
},
168-
],
169-
},
170-
],
171-
configure: () => [],
172-
verify: () => [],
173-
nextSteps: () => [],
174-
};
175-
176-
const docs: Docs = {
177-
onboarding,
178-
feedbackOnboardingCrashApi: feedbackOnboarding,
179-
crashReportOnboarding: feedbackOnboarding,
180-
};
181-
182-
export default docs;

0 commit comments

Comments
 (0)