diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2018-09-18 17:43:42 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-09-25 20:21:00 +0200 |
commit | abb68832ff18c47f502cd2ab097b5b4b9fc3a509 (patch) | |
tree | dacf53d56390dc2855fa3d8c04ec02c25000beb9 /server/sonar-web/src/main/js/apps/tutorials | |
parent | c003387eb63a644d9e887dcb7799d962ec27310c (diff) | |
download | sonarqube-abb68832ff18c47f502cd2ab097b5b4b9fc3a509.tar.gz sonarqube-abb68832ff18c47f502cd2ab097b5b4b9fc3a509.zip |
SONARCLOUD-43 Allow users to select the plan when creating an org (#705)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/tutorials')
-rw-r--r-- | server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx index baca2d16467..039574a03fb 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx @@ -20,6 +20,7 @@ import * as React from 'react'; import * as PropTypes from 'prop-types'; import { connect } from 'react-redux'; +import { InjectedRouter } from 'react-router'; import OnboardingModal from './OnboardingModal'; import { skipOnboarding } from '../../../api/users'; import { skipOnboarding as skipOnboardingAction } from '../../../store/users'; @@ -30,6 +31,10 @@ interface DispatchProps { skipOnboardingAction: () => void; } +interface OwnProps { + router: InjectedRouter; +} + enum ModalKey { onboarding, teamOnboarding @@ -39,10 +44,9 @@ interface State { modal?: ModalKey; } -export class OnboardingPage extends React.PureComponent<DispatchProps, State> { +export class OnboardingPage extends React.PureComponent<OwnProps & DispatchProps, State> { static contextTypes = { - openProjectOnboarding: PropTypes.func.isRequired, - router: PropTypes.object.isRequired + openProjectOnboarding: PropTypes.func.isRequired }; state: State = { modal: ModalKey.onboarding }; @@ -50,16 +54,16 @@ export class OnboardingPage extends React.PureComponent<DispatchProps, State> { closeOnboarding = () => { skipOnboarding(); this.props.skipOnboardingAction(); - this.context.router.replace('/'); + this.props.router.replace('/'); }; closeOrganizationOnboarding = ({ key }: Pick<Organization, 'key'>) => { this.closeOnboarding(); - this.context.router.push(`/organizations/${key}`); + this.props.router.push(`/organizations/${key}`); }; openOrganizationOnboarding = () => { - this.context.router.push('/create-organizations'); + this.props.router.push({ pathname: '/create-organization', state: { paid: true } }); }; openTeamOnboarding = () => { |