|
@@ -20,6 +20,7 @@ import withProjects from 'sentry/utils/withProjects';
|
|
|
import PageCorners from 'sentry/views/onboarding/components/pageCorners';
|
|
|
|
|
|
import Stepper from './components/stepper';
|
|
|
+import MobileRedirect from './mobileRedirect';
|
|
|
import PlatformSelection from './platform';
|
|
|
import SetupDocs from './setupDocs';
|
|
|
import {StepDescriptor} from './types';
|
|
@@ -59,6 +60,14 @@ const ONBOARDING_STEPS: StepDescriptor[] = [
|
|
|
},
|
|
|
];
|
|
|
|
|
|
+const MobileRedirectStep: StepDescriptor = {
|
|
|
+ id: 'setup-docs',
|
|
|
+ title: t('Install the Sentry SDK'),
|
|
|
+ Component: MobileRedirect,
|
|
|
+ hasFooter: true,
|
|
|
+ cornerVariant: 'top-left',
|
|
|
+};
|
|
|
+
|
|
|
function Onboarding(props: Props) {
|
|
|
const {
|
|
|
organization,
|
|
@@ -73,7 +82,7 @@ function Onboarding(props: Props) {
|
|
|
};
|
|
|
}, []);
|
|
|
|
|
|
- const stepObj = ONBOARDING_STEPS.find(({id}) => stepId === id);
|
|
|
+ let stepObj = ONBOARDING_STEPS.find(({id}) => stepId === id);
|
|
|
const stepIndex = ONBOARDING_STEPS.findIndex(({id}) => stepId === id);
|
|
|
|
|
|
const cornerVariantControl = useAnimation();
|
|
@@ -101,12 +110,6 @@ function Onboarding(props: Props) {
|
|
|
|
|
|
useEffect(updateAnimationState, []);
|
|
|
|
|
|
- if (!stepObj || stepIndex === -1) {
|
|
|
- return (
|
|
|
- <Redirect to={`/onboarding/${organization.slug}/${ONBOARDING_STEPS[0].id}/`} />
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
const goToStep = (step: StepDescriptor) => {
|
|
|
if (!stepObj) {
|
|
|
return;
|
|
@@ -165,18 +168,26 @@ function Onboarding(props: Props) {
|
|
|
};
|
|
|
|
|
|
if (!stepObj || stepIndex === -1) {
|
|
|
- return <div>Can't find</div>;
|
|
|
+ if (props.params.step === 'mobile-redirect') {
|
|
|
+ stepObj = MobileRedirectStep;
|
|
|
+ } else {
|
|
|
+ return (
|
|
|
+ <Redirect to={`/onboarding/${organization.slug}/${ONBOARDING_STEPS[0].id}/`} />
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
return (
|
|
|
<OnboardingWrapper data-test-id="targeted-onboarding">
|
|
|
<SentryDocumentTitle title={stepObj.title} />
|
|
|
<Header>
|
|
|
<LogoSvg />
|
|
|
- <StyledStepper
|
|
|
- numSteps={ONBOARDING_STEPS.length}
|
|
|
- currentStepIndex={stepIndex}
|
|
|
- onClick={i => goToStep(ONBOARDING_STEPS[i])}
|
|
|
- />
|
|
|
+ {stepIndex !== -1 && (
|
|
|
+ <StyledStepper
|
|
|
+ numSteps={ONBOARDING_STEPS.length}
|
|
|
+ currentStepIndex={stepIndex}
|
|
|
+ onClick={i => goToStep(ONBOARDING_STEPS[i])}
|
|
|
+ />
|
|
|
+ )}
|
|
|
<UpsellWrapper>
|
|
|
<Hook
|
|
|
name="onboarding:targeted-onboarding-header"
|
|
@@ -192,7 +203,7 @@ function Onboarding(props: Props) {
|
|
|
<stepObj.Component
|
|
|
active
|
|
|
stepIndex={stepIndex}
|
|
|
- onComplete={() => goNextStep(stepObj)}
|
|
|
+ onComplete={() => stepObj && goNextStep(stepObj)}
|
|
|
orgId={props.params.orgId}
|
|
|
organization={props.organization}
|
|
|
search={props.location.search}
|