Skip to content

Commit

Permalink
ref(onobarding): Remove old onboarding experience
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Jul 17, 2019
1 parent 6d249e6 commit 6581a1d
Show file tree
Hide file tree
Showing 26 changed files with 67 additions and 1,960 deletions.
30 changes: 8 additions & 22 deletions src/sentry/static/sentry/app/components/createProject.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {openCreateTeamModal} from 'app/actionCreators/modal';
import {t} from 'app/locale';
import Alert from 'app/components/alert';
import Button from 'app/components/button';
import HookStore from 'app/stores/hookStore';
import PageHeading from 'app/components/pageHeading';
import PlatformIconTile from 'app/components/platformIconTile';
import PlatformPicker from 'app/components/platformPicker';
Expand All @@ -28,12 +27,6 @@ class CreateProject extends React.Component {
api: PropTypes.object,
teams: PropTypes.arrayOf(SentryTypes.Team),
organization: SentryTypes.Organization,
nextStepUrl: PropTypes.func,
};

static defaultProps = {
nextStepUrl: ({slug, projectSlug, platform}) =>
`/onboarding/${slug}/${projectSlug}/configure/${platform}`,
};

static contextTypes = {
Expand Down Expand Up @@ -61,7 +54,7 @@ class CreateProject extends React.Component {

createProject = e => {
e.preventDefault();
const {organization, api, nextStepUrl} = this.props;
const {organization, api} = this.props;
const {projectName, platform, team} = this.state;
const {slug} = organization;

Expand All @@ -71,7 +64,7 @@ class CreateProject extends React.Component {
Sentry.withScope(scope => {
scope.setExtra('props', this.props);
scope.setExtra('state', this.state);
Sentry.captureMessage('Onboarding no project name');
Sentry.captureMessage('No project name');
});
}

Expand All @@ -84,19 +77,12 @@ class CreateProject extends React.Component {
success: data => {
ProjectActions.createSuccess(data);

const urlData = {
slug: organization.slug,
projectSlug: data.slug,
platform: platform || 'other',
};

const defaultNextUrl = nextStepUrl(urlData);
const hookNextUrl =
organization.projects.length === 0 &&
HookStore.get('utils:onboarding-survey-url').length &&
HookStore.get('utils:onboarding-survey-url')[0](urlData, organization);
const platformKey = platform || 'other';
const nextUrl = `/${organization.slug}/${
data.slug
}/getting-started/${platformKey}/`;

browserHistory.push(hookNextUrl || defaultNextUrl);
browserHistory.push(nextUrl);
},
error: err => {
this.setState({
Expand All @@ -112,7 +98,7 @@ class CreateProject extends React.Component {
scope.setExtra('err', err);
scope.setExtra('props', this.props);
scope.setExtra('state', this.state);
Sentry.captureMessage('Onboarding project creation failed');
Sentry.captureMessage('Project creation failed');
});
}
},
Expand Down
27 changes: 1 addition & 26 deletions src/sentry/static/sentry/app/routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ const OrganizationMembersView = HookOrDefault({
import(/* webpackChunkName: "OrganizationMembers" */ 'app/views/settings/organizationMembers'),
});

const OnboardingNewProjectView = HookOrDefault({
hookName: 'component:onboarding-new-project',
defaultComponentPromise: () =>
import(/* webpackChunkName: "OnboardingNewProject" */ 'app/views/onboarding/newProject'),
});

function routes() {
const accountSettingsRoutes = (
<React.Fragment>
Expand Down Expand Up @@ -786,33 +780,14 @@ function routes() {
/>

<Route path="/onboarding/:orgId/" component={errorHandler(OrganizationContext)}>
{/* The current (old) version of the onboarding experience does not
route to anything here. So even though this is new, the route can
live where it will eventually live. */}
<IndexRedirect to="welcome/" />
<Route
path=":step/"
componentPromise={() =>
import(/* webpackChunkName: "OnboardingWizardNew" */ 'app/views/onboarding/wizardNew')
}
component={errorHandler(LazyLoad)}
/>
{/* TODO(epurkhiser): Old style onboarding experience routes. To be removed in the future */}
<Route
componentPromise={() =>
import(/* webpackChunkName: "OnboardingWizard" */ 'app/views/onboarding/wizard')
}
component={errorHandler(LazyLoad)}
>
<IndexRoute component={errorHandler(OnboardingNewProjectView)} />
<Route
path=":projectId/configure/:platform/"
componentPromise={() =>
import(/* webpackChunkName: "OnboardingConfigure" */ 'app/views/onboarding/configure')
}
component={errorHandler(LazyLoad)}
/>
{hook('routes:onboarding')}
</Route>
</Route>
<Route component={errorHandler(OrganizationDetails)}>
<Route path="/settings/" name="Settings" component={SettingsWrapper}>
Expand Down
5 changes: 0 additions & 5 deletions src/sentry/static/sentry/app/stores/hookStore.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const validHookNames = new Set([
// Additional routes
'routes',
'routes:admin',
'routes:onboarding',
'routes:organization',
'routes:organization-root',

Expand Down Expand Up @@ -40,11 +39,7 @@ const validHookNames = new Set([
'sidebar:item-label',

// Onboarding experience
// TODO(epurkhiser): These all should become less getsentry specific
'utils:onboarding-survey-url',
'sidebar:onboarding-assets',
'onboarding:invite-members',
'component:onboarding-new-project',

// Used to provide a component for integration features.
'integrations:feature-gates',
Expand Down
115 changes: 0 additions & 115 deletions src/sentry/static/sentry/app/views/onboarding/configure.jsx

This file was deleted.

14 changes: 0 additions & 14 deletions src/sentry/static/sentry/app/views/onboarding/newProject.jsx

This file was deleted.

3 changes: 2 additions & 1 deletion src/sentry/static/sentry/app/views/onboarding/platform.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class OnboardingPlatform extends React.Component {
progressing: false,
};

componentDidUpdate(prevProps, prevState) {
componentDidUpdate(prevProps) {
if (prevProps.active && !this.props.active) {
// eslint-disable-next-line react/no-did-update-set-state
this.setState({progressing: false});
Expand Down Expand Up @@ -144,6 +144,7 @@ class OnboardingPlatform extends React.Component {
setPlatform={this.handleSetPlatform}
/>
<Button
data-test-id="platform-select-next"
priority="primary"
disabled={continueDisabled}
onClick={this.handleContinue}
Expand Down
Loading

0 comments on commit 6581a1d

Please sign in to comment.