Skip to content

Commit cc65e22

Browse files
priscilawebdevandrewshie-sentry
authored andcommitted
ref(onboarding): Split aspnet core onboarding docs (#102946)
Contributes to https://linear.app/getsentry/issue/TET-864/introduce-folders-for-onboarding-platforms
1 parent 65c490a commit cc65e22

File tree

4 files changed

+87
-80
lines changed

4 files changed

+87
-80
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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: `@using Sentry
35+
@using Sentry.AspNetCore
36+
@inject Microsoft.Extensions.Options.IOptions<SentryAspNetCoreOptions> SentryOptions
37+
38+
@if (SentrySdk.LastEventId != SentryId.Empty) {
39+
<script>
40+
Sentry.init({ dsn: "@(SentryOptions.Value.Dsn)" });
41+
Sentry.showReportDialog({ eventId: "@SentrySdk.LastEventId" });
42+
</script>
43+
}`,
44+
},
45+
],
46+
},
47+
],
48+
},
49+
],
50+
configure: () => [
51+
{
52+
type: StepType.CONFIGURE,
53+
content: [
54+
{
55+
type: 'text',
56+
text: getCrashReportModalConfigDescription({
57+
link: 'https://docs.sentry.io/platforms/dotnet/guides/aspnetcore/user-feedback/configuration/#crash-report-modal',
58+
}),
59+
},
60+
],
61+
},
62+
],
63+
verify: () => [],
64+
nextSteps: () => [],
65+
};
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/aspnetcore.spec.tsx renamed to static/app/gettingStartedDocs/dotnet/aspnetcore/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 './aspnetcore';
7+
import docs from './index';
88

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

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

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

21-
type Params = DocsParams;
22-
23-
const getInstallSnippetPackageManager = (params: Params) => `
11+
const getInstallSnippetPackageManager = (params: DocsParams) => `
2412
Install-Package Sentry.AspNetCore -Version ${getPackageVersion(
2513
params,
2614
'sentry.dotnet.aspnetcore',
2715
'4.3.0'
2816
)}`;
2917

30-
const getInstallSnippetCoreCli = (params: Params) => `
18+
const getInstallSnippetCoreCli = (params: DocsParams) => `
3119
dotnet add package Sentry.AspNetCore -v ${getPackageVersion(
3220
params,
3321
'sentry.dotnet.aspnetcore',
3422
'4.3.0'
3523
)}`;
3624

37-
const getConfigureSnippet = (params: Params) => `
25+
const getConfigureSnippet = (params: DocsParams) => `
3826
public static IHostBuilder CreateHostBuilder(string[] args) =>
3927
Host.CreateDefaultBuilder(args)
4028
.ConfigureWebHostDefaults(webBuilder =>
@@ -85,7 +73,7 @@ public class HomeController : Controller
8573
}
8674
}`;
8775

88-
const onboarding: OnboardingConfig = {
76+
export const onboarding: OnboardingConfig = {
8977
install: params => [
9078
{
9179
type: StepType.INSTALL,
@@ -225,66 +213,3 @@ const onboarding: OnboardingConfig = {
225213
},
226214
],
227215
};
228-
229-
const crashReportOnboarding: OnboardingConfig = {
230-
introduction: () => getCrashReportModalIntroduction(),
231-
install: (params: Params) => [
232-
{
233-
type: StepType.INSTALL,
234-
content: [
235-
...getCrashReportSDKInstallFirstBlocks(params),
236-
{
237-
type: 'text',
238-
text: tct(
239-
'If you are rendering the page from the server, for example on ASP.NET MVC, the [code:Error.cshtml] razor page can be:',
240-
{code: <code />}
241-
),
242-
},
243-
{
244-
type: 'code',
245-
tabs: [
246-
{
247-
label: 'cshtml',
248-
value: 'html',
249-
language: 'html',
250-
code: `@using Sentry
251-
@using Sentry.AspNetCore
252-
@inject Microsoft.Extensions.Options.IOptions<SentryAspNetCoreOptions> SentryOptions
253-
254-
@if (SentrySdk.LastEventId != SentryId.Empty) {
255-
<script>
256-
Sentry.init({ dsn: "@(SentryOptions.Value.Dsn)" });
257-
Sentry.showReportDialog({ eventId: "@SentrySdk.LastEventId" });
258-
</script>
259-
}`,
260-
},
261-
],
262-
},
263-
],
264-
},
265-
],
266-
configure: () => [
267-
{
268-
type: StepType.CONFIGURE,
269-
content: [
270-
{
271-
type: 'text',
272-
text: getCrashReportModalConfigDescription({
273-
link: 'https://docs.sentry.io/platforms/dotnet/guides/aspnetcore/user-feedback/configuration/#crash-report-modal',
274-
}),
275-
},
276-
],
277-
},
278-
],
279-
verify: () => [],
280-
nextSteps: () => [],
281-
};
282-
283-
const docs: Docs = {
284-
onboarding,
285-
replayOnboardingJsLoader,
286-
crashReportOnboarding,
287-
feedbackOnboardingJsLoader,
288-
};
289-
290-
export default docs;

0 commit comments

Comments
 (0)