Skip to content

Commit 73b22af

Browse files
ref(onboarding): Split Aspnet onboarding docs (#102943)
Contributes to https://linear.app/getsentry/issue/TET-864/introduce-folders-for-onboarding-platforms
1 parent 673a3c6 commit 73b22af

File tree

4 files changed

+83
-76
lines changed

4 files changed

+83
-76
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import type {
2+
DocsParams,
3+
OnboardingConfig,
4+
} from 'sentry/components/onboarding/gettingStartedDoc/types';
5+
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types';
6+
import {
7+
getCrashReportModalConfigDescription,
8+
getCrashReportModalIntroduction,
9+
getCrashReportSDKInstallFirstBlocks,
10+
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
11+
import {tct} from 'sentry/locale';
12+
13+
export const crashReport: OnboardingConfig = {
14+
introduction: () => getCrashReportModalIntroduction(),
15+
install: (params: DocsParams) => [
16+
{
17+
type: StepType.INSTALL,
18+
content: [
19+
...getCrashReportSDKInstallFirstBlocks(params),
20+
{
21+
type: 'text',
22+
text: tct(
23+
'If you are rendering the page from the server, for example on ASP.NET MVC, the [code:Error.cshtml] razor page can be:',
24+
{code: <code />}
25+
),
26+
},
27+
{
28+
type: 'code',
29+
tabs: [
30+
{
31+
label: 'cshtml',
32+
value: 'html',
33+
language: 'html',
34+
code: `@if (SentrySdk.LastEventId != SentryId.Empty) {
35+
<script>
36+
Sentry.init({ dsn: "${params.dsn.public}" });
37+
Sentry.showReportDialog({ eventId: "@SentrySdk.LastEventId" });
38+
</script>
39+
}`,
40+
},
41+
],
42+
},
43+
],
44+
},
45+
],
46+
configure: () => [
47+
{
48+
type: StepType.CONFIGURE,
49+
content: [
50+
{
51+
type: 'text',
52+
text: getCrashReportModalConfigDescription({
53+
link: 'https://docs.sentry.io/platforms/dotnet/guides/aspnet/user-feedback/configuration/#crash-report-modal',
54+
}),
55+
},
56+
],
57+
},
58+
],
59+
verify: () => [],
60+
nextSteps: () => [],
61+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types';
2+
import {
3+
feedbackOnboardingJsLoader,
4+
replayOnboardingJsLoader,
5+
} from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader';
6+
7+
import {crashReport} from './crashReport';
8+
import {onboarding} from './onboarding';
9+
10+
const docs: Docs = {
11+
onboarding,
12+
replayOnboardingJsLoader,
13+
crashReportOnboarding: crashReport,
14+
feedbackOnboardingJsLoader,
15+
};
16+
17+
export default docs;

static/app/gettingStartedDocs/dotnet/aspnet.spec.tsx renamed to static/app/gettingStartedDocs/dotnet/aspnet/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 './aspnet';
7+
import docs from './index';
88

99
describe('aspnet onboarding docs', () => {
1010
it('renders errors onboarding docs correctly', async () => {

static/app/gettingStartedDocs/dotnet/aspnet.tsx renamed to static/app/gettingStartedDocs/dotnet/aspnet/onboarding.tsx

Lines changed: 4 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,27 @@
11
import {ExternalLink} from 'sentry/components/core/link';
22
import type {
3-
Docs,
43
DocsParams,
54
OnboardingConfig,
65
} from 'sentry/components/onboarding/gettingStartedDoc/types';
76
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types';
8-
import {
9-
getCrashReportModalConfigDescription,
10-
getCrashReportModalIntroduction,
11-
getCrashReportSDKInstallFirstBlocks,
12-
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
13-
import {
14-
feedbackOnboardingJsLoader,
15-
replayOnboardingJsLoader,
16-
} from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader';
177
import {t, tct} from 'sentry/locale';
188
import {getPackageVersion} from 'sentry/utils/gettingStartedDocs/getPackageVersion';
199

20-
type Params = DocsParams;
21-
22-
const getInstallSnippetPackageManager = (params: Params) => `
10+
const getInstallSnippetPackageManager = (params: DocsParams) => `
2311
Install-Package Sentry.AspNet -Version ${getPackageVersion(
2412
params,
2513
'sentry.dotnet.aspnet',
2614
'3.34.0'
2715
)}`;
2816

29-
const getInstallSnippetEntityFramework = (params: Params) => `
17+
const getInstallSnippetEntityFramework = (params: DocsParams) => `
3018
Install-Package Sentry.EntityFramework -Version ${getPackageVersion(
3119
params,
3220
'sentry.dotnet.aspnet',
3321
'3.34.0'
3422
)}`;
3523

36-
const getConfigureSnippet = (params: Params) => `
24+
const getConfigureSnippet = (params: DocsParams) => `
3725
using System;
3826
using System.Configuration;
3927
using System.Web.Mvc;
@@ -94,7 +82,7 @@ public class MvcApplication : HttpApplication
9482
}
9583
`;
9684

97-
const onboarding: OnboardingConfig = {
85+
export const onboarding: OnboardingConfig = {
9886
install: params => [
9987
{
10088
type: StepType.INSTALL,
@@ -197,62 +185,3 @@ const onboarding: OnboardingConfig = {
197185
},
198186
],
199187
};
200-
201-
const crashReportOnboarding: OnboardingConfig = {
202-
introduction: () => getCrashReportModalIntroduction(),
203-
install: (params: Params) => [
204-
{
205-
type: StepType.INSTALL,
206-
content: [
207-
...getCrashReportSDKInstallFirstBlocks(params),
208-
{
209-
type: 'text',
210-
text: tct(
211-
'If you are rendering the page from the server, for example on ASP.NET MVC, the [code:Error.cshtml] razor page can be:',
212-
{code: <code />}
213-
),
214-
},
215-
{
216-
type: 'code',
217-
tabs: [
218-
{
219-
label: 'cshtml',
220-
value: 'html',
221-
language: 'html',
222-
code: `@if (SentrySdk.LastEventId != SentryId.Empty) {
223-
<script>
224-
Sentry.init({ dsn: "${params.dsn.public}" });
225-
Sentry.showReportDialog({ eventId: "@SentrySdk.LastEventId" });
226-
</script>
227-
}`,
228-
},
229-
],
230-
},
231-
],
232-
},
233-
],
234-
configure: () => [
235-
{
236-
type: StepType.CONFIGURE,
237-
content: [
238-
{
239-
type: 'text',
240-
text: getCrashReportModalConfigDescription({
241-
link: 'https://docs.sentry.io/platforms/dotnet/guides/aspnet/user-feedback/configuration/#crash-report-modal',
242-
}),
243-
},
244-
],
245-
},
246-
],
247-
verify: () => [],
248-
nextSteps: () => [],
249-
};
250-
251-
const docs: Docs = {
252-
onboarding,
253-
replayOnboardingJsLoader,
254-
crashReportOnboarding,
255-
feedbackOnboardingJsLoader,
256-
};
257-
258-
export default docs;

0 commit comments

Comments
 (0)