Skip to content

Commit 7f04a3b

Browse files
ref(onboarding): Split GCP Functions onboarding docs (#102942)
Contributes to https://linear.app/getsentry/issue/TET-864/introduce-folders-for-onboarding-platforms
1 parent 70e3a64 commit 7f04a3b

File tree

4 files changed

+47
-44
lines changed

4 files changed

+47
-44
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import type {OnboardingConfig} from 'sentry/components/onboarding/gettingStartedDoc/types';
2+
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types';
3+
import {
4+
getCrashReportGenericInstallSteps,
5+
getCrashReportModalConfigDescription,
6+
getCrashReportModalIntroduction,
7+
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
8+
9+
export const crashReport: OnboardingConfig = {
10+
introduction: () => getCrashReportModalIntroduction(),
11+
install: params => getCrashReportGenericInstallSteps(params),
12+
configure: () => [
13+
{
14+
type: StepType.CONFIGURE,
15+
content: [
16+
{
17+
type: 'text',
18+
text: getCrashReportModalConfigDescription({
19+
link: 'https://docs.sentry.io/platforms/dotnet/guides/google-cloud-functions/user-feedback/configuration/#crash-report-modal',
20+
}),
21+
},
22+
],
23+
},
24+
],
25+
verify: () => [],
26+
nextSteps: () => [],
27+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types';
2+
import {feedback} from 'sentry/gettingStartedDocs/dotnet/dotnet/feedback';
3+
4+
import {crashReport} from './crashReport';
5+
import {onboarding} from './onboarding';
6+
7+
const docs: Docs = {
8+
onboarding,
9+
feedbackOnboardingCrashApi: feedback,
10+
crashReportOnboarding: crashReport,
11+
};
12+
13+
export default docs;

static/app/gettingStartedDocs/dotnet/gcpfunctions.spec.tsx renamed to static/app/gettingStartedDocs/dotnet/gcpfunctions/onboarding.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboa
22
import {screen} from 'sentry-test/reactTestingLibrary';
33
import {textWithMarkupMatcher} from 'sentry-test/utils';
44

5-
import docs from './gcpfunctions';
5+
import docs from './index';
66

77
describe('gcpfunctions onboarding docs', () => {
88
it('renders docs correctly', async () => {
@@ -24,7 +24,7 @@ describe('gcpfunctions onboarding docs', () => {
2424
expect(
2525
await screen.findByText(
2626
textWithMarkupMatcher(
27-
/Install-Package Sentry.Google.Cloud.Functions -Version 1\.99\.9/
27+
/Install-Package Sentry\.Google\.Cloud\.Functions -Version 1\.99\.9/
2828
)
2929
)
3030
).toBeInTheDocument();

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

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +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-
getCrashReportGenericInstallSteps,
10-
getCrashReportModalConfigDescription,
11-
getCrashReportModalIntroduction,
12-
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
13-
import {feedback} from 'sentry/gettingStartedDocs/dotnet/dotnet/feedback';
147
import {t, tct} from 'sentry/locale';
158
import {getPackageVersion} from 'sentry/utils/gettingStartedDocs/getPackageVersion';
169

17-
type Params = DocsParams;
18-
19-
const getInstallSnippetPackageManager = (params: Params) => `
10+
const getInstallSnippetPackageManager = (params: DocsParams) => `
2011
Install-Package Sentry.Google.Cloud.Functions -Version ${getPackageVersion(
2112
params,
2213
'sentry.dotnet.google-cloud-function',
2314
'3.34.0'
2415
)}`;
2516

26-
const getInstallSnippetCoreCli = (params: Params) => `
17+
const getInstallSnippetCoreCli = (params: DocsParams) => `
2718
dotnet add package Sentry.Google.Cloud.Functions -v ${getPackageVersion(
2819
params,
2920
'sentry.dotnet.google-cloud-function',
3021
'3.34.0'
3122
)}`;
3223

33-
const getInstallSnippetManual = (params: Params) => `
24+
const getInstallSnippetManual = (params: DocsParams) => `
3425
<ItemGroup>
3526
<PackageReference Include="Sentry.Google.Cloud.Functions" Version="${getPackageVersion(
3627
params,
@@ -51,7 +42,7 @@ public class Function : IHttpFunction
5142
}
5243
}`;
5344

54-
const getConfigureJsonSnippet = (params: Params) => `
45+
const getConfigureJsonSnippet = (params: DocsParams) => `
5546
{
5647
"Sentry": {
5748
"Dsn": "${params.dsn.public}",
@@ -81,7 +72,7 @@ public Task HandleAsync(HttpContext context)
8172
SentrySdk.CaptureMessage("Hello Sentry");
8273
}`;
8374

84-
const onboarding: OnboardingConfig = {
75+
export const onboarding: OnboardingConfig = {
8576
install: params => [
8677
{
8778
type: StepType.INSTALL,
@@ -207,31 +198,3 @@ const onboarding: OnboardingConfig = {
207198
},
208199
],
209200
};
210-
211-
const crashReportOnboarding: OnboardingConfig = {
212-
introduction: () => getCrashReportModalIntroduction(),
213-
install: (params: Params) => getCrashReportGenericInstallSteps(params),
214-
configure: () => [
215-
{
216-
type: StepType.CONFIGURE,
217-
content: [
218-
{
219-
type: 'text',
220-
text: getCrashReportModalConfigDescription({
221-
link: 'https://docs.sentry.io/platforms/dotnet/guides/google-cloud-functions/user-feedback/configuration/#crash-report-modal',
222-
}),
223-
},
224-
],
225-
},
226-
],
227-
verify: () => [],
228-
nextSteps: () => [],
229-
};
230-
231-
const docs: Docs = {
232-
onboarding,
233-
feedbackOnboardingCrashApi: feedback,
234-
crashReportOnboarding,
235-
};
236-
237-
export default docs;

0 commit comments

Comments
 (0)