123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- import {Fragment} from 'react';
- import ExternalLink from 'sentry/components/links/externalLink';
- import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
- import type {
- Docs,
- DocsParams,
- OnboardingConfig,
- } from 'sentry/components/onboarding/gettingStartedDoc/types';
- import {
- getCrashReportJavaScriptInstallStep,
- getCrashReportModalConfigDescription,
- getCrashReportModalIntroduction,
- } from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
- import {t, tct} from 'sentry/locale';
- type Params = DocsParams;
- const getConfigureSnippet = (params: Params) => `
- onDeviceReady: function() {
- var Sentry = cordova.require('sentry-cordova.Sentry');
- Sentry.init({ dsn: '${params.dsn.public}' });
- }`;
- const onboarding: OnboardingConfig = {
- install: () => [
- {
- type: StepType.INSTALL,
- description: t('Install our SDK using the cordova command:'),
- configurations: [
- {
- language: 'bash',
- code: 'cordova plugin add sentry-cordova',
- },
- ],
- },
- ],
- configure: params => [
- {
- type: StepType.CONFIGURE,
- description: tct(
- 'You should [code:init] the SDK in the [code:deviceReady] function, to make sure the native integrations runs. For more details about Cordova [link:click here]',
- {
- code: <code />,
- link: (
- <ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/cordova/" />
- ),
- }
- ),
- configurations: [
- {
- language: 'javascript',
- code: getConfigureSnippet(params),
- },
- ],
- },
- ],
- verify: () => [
- {
- type: StepType.VERIFY,
- description: (
- <Fragment>
- {t(
- 'One way to verify your setup is by intentionally causing an error that breaks your application.'
- )}
- <p>{t('Calling an undefined function will throw an exception:')}</p>
- </Fragment>
- ),
- configurations: [
- {
- language: 'javascript',
- code: 'myUndefinedFunction();',
- },
- ],
- },
- ],
- };
- const crashReportOnboarding: OnboardingConfig = {
- introduction: () => getCrashReportModalIntroduction(),
- install: (params: Params) => getCrashReportJavaScriptInstallStep(params),
- configure: () => [
- {
- type: StepType.CONFIGURE,
- description: getCrashReportModalConfigDescription({
- link: 'https://docs.sentry.io/platforms/javascript/guides/cordova/user-feedback/configuration/#crash-report-modal',
- }),
- },
- ],
- verify: () => [],
- nextSteps: () => [],
- };
- const docs: Docs = {
- onboarding,
- crashReportOnboarding,
- };
- export default docs;
|