Skip to content

Commit

Permalink
feat(feedback onboarding): add angular, astro, ember docs (#65662)
Browse files Browse the repository at this point in the history
Adds Angular, Astro, and Ember onboarding docs for user feedback
Relates to #62792
  • Loading branch information
michellewzhang authored Feb 22, 2024
1 parent 1237a32 commit 4303b28
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 3 deletions.
19 changes: 19 additions & 0 deletions static/app/components/onboarding/gettingStartedDoc/utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,22 @@ export const getReplayConfigOptions = ({
blockAllMedia: false,
}`;
};

export const getFeedbackSDKSetupSnippet = ({
importStatement,
dsn,
}: {
dsn: string;
importStatement: string;
}) =>
`${importStatement}
Sentry.init({
dsn: "${dsn}",
integrations: [
Sentry.feedbackIntegration({
// Additional SDK configuration goes in here, for example:
colorScheme: "light",
}),
],
});`;
54 changes: 51 additions & 3 deletions static/app/gettingStartedDocs/javascript/angular.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
PlatformOption,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {
getFeedbackConfigureDescription,
getReplayConfigOptions,
getReplayConfigureDescription,
getUploadSourceMapsStep,
Expand Down Expand Up @@ -105,7 +106,7 @@ const onboarding: OnboardingConfig<PlatformOptions> = {
configurations: getInstallConfig(params),
},
],
configure: params => [
configure: (params: Params) => [
{
type: StepType.CONFIGURE,
configurations: [
Expand Down Expand Up @@ -164,7 +165,7 @@ const onboarding: OnboardingConfig<PlatformOptions> = {
],
},
],
nextSteps: params => getNextStep(params),
nextSteps: (params: Params) => getNextStep(params),
};

export const nextSteps = [
Expand Down Expand Up @@ -208,6 +209,14 @@ function getSdkSetupSnippet(params: Params) {
? `
Sentry.browserTracingIntegration(),`
: ''
}${
params.isFeedbackSelected
? `
Sentry.feedbackIntegration({
// Additional SDK configuration goes in here, for example:
colorScheme: "light",
}),`
: ''
}${
params.isReplaySelected
? `
Expand Down Expand Up @@ -268,7 +277,7 @@ const replayOnboarding: OnboardingConfig<PlatformOptions> = {
configurations: getInstallConfig(params),
},
],
configure: params => [
configure: (params: Params) => [
{
type: StepType.CONFIGURE,
description: getReplayConfigureDescription({
Expand All @@ -293,9 +302,48 @@ const replayOnboarding: OnboardingConfig<PlatformOptions> = {
nextSteps: () => [],
};

const feedbackOnboarding: OnboardingConfig<PlatformOptions> = {
install: (params: Params) => [
{
type: StepType.INSTALL,
description: tct(
'For the User Feedback integration to work, you must have the Sentry browser SDK package, or an equivalent framework SDK (e.g. [codeAngular:@sentry/angular] or [codeIvy:@sentry/angular-ivy]) installed, minimum version 7.85.0.',
{
codeAngular: <code />,
codeIvy: <code />,
}
),
configurations: getInstallConfig(params),
},
],
configure: (params: Params) => [
{
type: StepType.CONFIGURE,
description: getFeedbackConfigureDescription({
link: 'https://docs.sentry.io/platforms/javascript/guides/angular/user-feedback/',
}),
configurations: [
{
code: [
{
label: 'JavaScript',
value: 'javascript',
language: 'javascript',
code: getSdkSetupSnippet(params),
},
],
},
],
},
],
verify: () => [],
nextSteps: () => [],
};

const docs: Docs<PlatformOptions> = {
onboarding,
platformOptions,
feedbackOnboardingNpm: feedbackOnboarding,
replayOnboardingNpm: replayOnboarding,
customMetricsOnboarding: getJSMetricsOnboarding({getInstallConfig}),
};
Expand Down
43 changes: 43 additions & 0 deletions static/app/gettingStartedDocs/javascript/astro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import type {
OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {
getFeedbackConfigureDescription,
getFeedbackSDKSetupSnippet,
getReplayConfigureDescription,
getReplaySDKSetupSnippet,
} from 'sentry/components/onboarding/gettingStartedDoc/utils';
Expand Down Expand Up @@ -228,8 +230,49 @@ const replayOnboarding: OnboardingConfig = {
nextSteps: () => [],
};

const feedbackOnboarding: OnboardingConfig = {
install: () => [
{
type: StepType.INSTALL,
description: tct(
'For the User Feedback integration to work, you must have the Sentry browser SDK package, or an equivalent framework SDK (e.g. [code:@sentry/astro]) installed, minimum version 7.85.0.',
{
code: <code />,
}
),
configurations: getInstallConfig(),
},
],
configure: (params: Params) => [
{
type: StepType.CONFIGURE,
description: getFeedbackConfigureDescription({
link: 'https://docs.sentry.io/platforms/javascript/guides/astro/user-feedback/',
}),
configurations: [
{
code: [
{
label: 'JavaScript',
value: 'javascript',
language: 'javascript',
code: getFeedbackSDKSetupSnippet({
importStatement: `import * as Sentry from "@sentry/astro";`,
dsn: params.dsn,
}),
},
],
},
],
},
],
verify: () => [],
nextSteps: () => [],
};

const docs: Docs = {
onboarding,
feedbackOnboardingNpm: feedbackOnboarding,
replayOnboardingNpm: replayOnboarding,
customMetricsOnboarding: getJSMetricsOnboarding({getInstallConfig}),
};
Expand Down
47 changes: 47 additions & 0 deletions static/app/gettingStartedDocs/javascript/ember.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {
OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {
getFeedbackConfigureDescription,
getReplayConfigOptions,
getReplayConfigureDescription,
getUploadSourceMapsStep,
Expand All @@ -30,6 +31,14 @@ Sentry.init({
? `
Sentry.replayIntegration(${getReplayConfigOptions(params.replayOptions)}),`
: ''
}${
params.isFeedbackSelected
? `
Sentry.feedbackIntegration({
// Additional SDK configuration goes in here, for example:
colorScheme: "light",
}),`
: ''
}
],${
params.isPerformanceSelected
Expand Down Expand Up @@ -184,8 +193,46 @@ const replayOnboarding: OnboardingConfig = {
nextSteps: () => [],
};

const feedbackOnboarding: OnboardingConfig = {
install: () => [
{
type: StepType.INSTALL,
description: tct(
'For the User Feedback integration to work, you must have the Sentry browser SDK package, or an equivalent framework SDK (e.g. [code:@sentry/ember]) installed, minimum version 7.85.0.',
{
code: <code />,
}
),
configurations: getInstallConfig(),
},
],
configure: (params: Params) => [
{
type: StepType.CONFIGURE,
description: getFeedbackConfigureDescription({
link: 'https://docs.sentry.io/platforms/javascript/guides/ember/user-feedback/',
}),
configurations: [
{
code: [
{
label: 'JavaScript',
value: 'javascript',
language: 'javascript',
code: getSdkSetupSnippet(params),
},
],
},
],
},
],
verify: () => [],
nextSteps: () => [],
};

const docs: Docs = {
onboarding,
feedbackOnboardingNpm: feedbackOnboarding,
replayOnboardingNpm: replayOnboarding,
customMetricsOnboarding: getJSMetricsOnboarding({getInstallConfig}),
};
Expand Down

0 comments on commit 4303b28

Please sign in to comment.