Browse Source

feat(feedback): adjust copy wording and add another more platforms (#65797)

relates to https://github.com/getsentry/sentry/issues/65728
Michelle Zhang 1 year ago
parent
commit
55d5952612

+ 3 - 1
static/app/components/feedback/feedbackOnboarding/useLoadFeedbackOnboardingDoc.tsx

@@ -27,7 +27,9 @@ function useLoadFeedbackOnboardingDoc({
     platform?.type === 'framework'
       ? platform?.id === 'capacitor'
         ? `capacitor/capacitor`
-        : platform?.id.replace(`${platform.language}-`, `${platform.language}/`)
+        : platform?.id === 'dart'
+          ? `dart/dart`
+          : platform?.id.replace(`${platform.language}-`, `${platform.language}/`)
       : `${platform?.language}/${platform?.id}`;
 
   const {

+ 2 - 2
static/app/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding.tsx

@@ -31,11 +31,11 @@ colorScheme: "light",
 
 export const getCrashReportApiIntroduction = () =>
   t(
-    'When a user experiences an error, Sentry provides the ability to collect additional feedback. The user feedback API allows you to collect user feedback while utilizing your own UI. You can use the same programming language you have in your app to send user feedback.'
+    'When a user experiences an error, Sentry provides the ability to collect additional feedback from the user via a form. The user feedback API allows you to collect user feedback while utilizing your own UI for the form. You can use the same programming language you have in your app to send user feedback.'
   );
 
 export const getCrashReportInstallDescription = () =>
   tct(
-    'Sentry pairs the feedback with the original event, giving you additional insight into issues. Sentry needs the [codeEvent:eventId] to be able to associate the user feedback to the corresponding event. To get the [codeEvent:eventId], you can use [codeBefore:beforeSend] or the return value of the method capturing an event.',
+    'Sentry needs the error [codeEvent:eventId] to be able to associate the user feedback to the corresponding event. To get the [codeEvent:eventId], you can use [codeBefore:beforeSend] or the return value of the method capturing an event.',
     {codeEvent: <code />, codeBefore: <code />}
   );

+ 2 - 0
static/app/data/platformCategories.tsx

@@ -381,6 +381,8 @@ export const replayJsLoaderInstructionsPlatformList: readonly PlatformKey[] = [
 
 export const feedbackOnboardingPlatforms: readonly PlatformKey[] = [
   'java',
+  'java-log4j2',
+  'dart',
   ...replayPlatforms,
 ];
 

+ 41 - 0
static/app/gettingStartedDocs/dart/dart.tsx

@@ -5,6 +5,10 @@ import type {
   DocsParams,
   OnboardingConfig,
 } from 'sentry/components/onboarding/gettingStartedDoc/types';
+import {
+  getCrashReportApiIntroduction,
+  getCrashReportInstallDescription,
+} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
 import {t, tct} from 'sentry/locale';
 import {getPackageVersion} from 'sentry/utils/gettingStartedDocs/getPackageVersion';
 
@@ -154,8 +158,45 @@ const onboarding: OnboardingConfig = {
   ],
 };
 
+export const feedbackOnboardingCrashApi: OnboardingConfig = {
+  introduction: () => getCrashReportApiIntroduction(),
+  install: () => [
+    {
+      type: StepType.INSTALL,
+      description: getCrashReportInstallDescription(),
+      configurations: [
+        {
+          code: [
+            {
+              label: 'Dart',
+              value: 'dart',
+              language: 'dart',
+              code: `import 'package:sentry/sentry.dart';
+
+SentryId sentryId = Sentry.captureMessage("My message");
+
+final userFeedback = SentryUserFeedback(
+    eventId: sentryId,
+    comments: 'Hello World!',
+    email: 'foo@bar.org',
+    name: 'John Doe',
+);
+
+Sentry.captureUserFeedback(userFeedback);`,
+            },
+          ],
+        },
+      ],
+    },
+  ],
+  configure: () => [],
+  verify: () => [],
+  nextSteps: () => [],
+};
+
 const docs: Docs = {
   onboarding,
+  feedbackOnboardingCrashApi,
 };
 
 export default docs;

+ 2 - 2
static/app/gettingStartedDocs/java/java.tsx

@@ -296,7 +296,7 @@ const onboarding: OnboardingConfig<PlatformOptions> = {
   ],
 };
 
-const feedbackOnboardingCrashApi: OnboardingConfig = {
+export const feedbackOnboardingCrashApiJava: OnboardingConfig = {
   introduction: () => getCrashReportApiIntroduction(),
   install: () => [
     {
@@ -348,7 +348,7 @@ Sentry.captureUserFeedback(userFeedback)`,
 
 const docs: Docs<PlatformOptions> = {
   platformOptions,
-  feedbackOnboardingCrashApi,
+  feedbackOnboardingCrashApi: feedbackOnboardingCrashApiJava,
   onboarding,
 };
 

+ 2 - 0
static/app/gettingStartedDocs/java/log4j2.tsx

@@ -9,6 +9,7 @@ import type {
   DocsParams,
   OnboardingConfig,
 } from 'sentry/components/onboarding/gettingStartedDoc/types';
+import {feedbackOnboardingCrashApiJava} from 'sentry/gettingStartedDocs/java/java';
 import {t, tct} from 'sentry/locale';
 import {getPackageVersion} from 'sentry/utils/gettingStartedDocs/getPackageVersion';
 
@@ -331,6 +332,7 @@ const onboarding: OnboardingConfig<PlatformOptions> = {
 
 const docs: Docs<PlatformOptions> = {
   platformOptions,
+  feedbackOnboardingCrashApi: feedbackOnboardingCrashApiJava,
   onboarding,
 };