Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup_number ping parameter #669

Merged
merged 16 commits into from Jan 29, 2021
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Move user to success screen if they get redirected to checkout-web in…

… a new tab
  • Loading branch information
benstrumeyer committed Jan 27, 2021
commit 2ae2f7de3e2b66ce8edf3450b8877a293c11c314
@@ -217,7 +217,7 @@ class ChoosePlanView extends React.Component {
};

premiumCard = (checked, handleClick, showCTAButton = false) => {
const { actions } = this.props;
const { actions, history } = this.props;
const { setSetupStep } = actions;
const cardClassNames = ClassNames('ChoosePlanView__card premium', {
checked
@@ -278,7 +278,7 @@ class ChoosePlanView extends React.Component {
</div>
</div>
{showCTAButton && (
<a className="ChoosePlanView__premiumCTAButton" href={premiumCheckoutLink} target="_blank" rel="noreferrer" onClick={() => setSetupStep({ setup_step: CHOOSE_PLAN, setup_number: 6, origin: ONBOARDING })}>{t('ghostery_dawn_onboarding_upgrade')}</a>
<a className="ChoosePlanView__premiumCTAButton" href={premiumCheckoutLink} target="_blank" rel="noreferrer" onClick={() => { setSetupStep({ setup_step: CHOOSE_PLAN, setup_number: 6, origin: ONBOARDING }); history.push('/onboarding/5'); }}>{t('ghostery_dawn_onboarding_upgrade')}</a>
)}
</Fragment>
);
@@ -289,7 +289,7 @@ class ChoosePlanView extends React.Component {
actions,
defaultSearch,
loggedIn,
next,
history,

This comment has been minimized.

@wlycdgr

wlycdgr Jan 28, 2021
Member

RIP StepNavigator ....you were so beautiful

Don't worry about removing it, I'll rip it out while you address these comments

This comment has been minimized.

@benstrumeyer

benstrumeyer Jan 28, 2021
Author Contributor

Sorry! I tried using it, but it brought me to a weird combination of a create account view and the Choose plan page

user,
} = this.props;
const { setSetupStep } = actions;
@@ -327,11 +327,12 @@ class ChoosePlanView extends React.Component {
and move them to Step 5 if signed in
2. DONE If user is signed out, clicking this should take them to Step 4b
*/}
{/* May have to change the below links depending on GH-2248 */}
{loggedIn && (
<a className="ChoosePlanView__searchCTAButton" href={plusCheckoutLink} target="_blank" rel="noreferrer" onClick={() => setSetupStep({ setup_step: CHOOSE_PLAN, setup_number: 2, origin: ONBOARDING })}>{t('ghostery_dawn_onboarding_start_trial')}</a>
<a className="ChoosePlanView__searchCTAButton" href={plusCheckoutLink} target="_blank" rel="noreferrer" onClick={() => { setSetupStep({ setup_step: CHOOSE_PLAN, setup_number: 2, origin: ONBOARDING }); history.push('/onboarding/5'); }}>{t('ghostery_dawn_onboarding_start_trial')}</a>
)}
{!loggedIn && (
<div className="ChoosePlanView__searchCTAButton" onClick={() => { setSetupStep({ setup_step: CHOOSE_PLAN, setup_number: 2, origin: ONBOARDING }); next(); }}>{t('ghostery_dawn_onboarding_start_trial')}</div>
<div className="ChoosePlanView__searchCTAButton" onClick={() => { setSetupStep({ setup_step: CHOOSE_PLAN, setup_number: 2, origin: ONBOARDING }); history.push('/onboarding/5'); }}>{t('ghostery_dawn_onboarding_start_trial')}</div>
)}
<div className="ChoosePlanView__seeAllPlans" onClick={this.toggleSection}>{t('ghostery_dawn_onboarding_see_all_plans')}</div>
<div className={arrowClassNames} onClick={this.toggleSection} />
@@ -370,10 +371,10 @@ class ChoosePlanView extends React.Component {
</NavLink>
)}
{selectedPlan === PLUS && (
<a className="ChoosePlanView__searchCTAButton" onClick={() => setSetupStep({ setup_step: CHOOSE_PLAN, setup_number: 3, origin: ONBOARDING })} href={plusCheckoutLink} target="_blank" rel="noreferrer">{t('next_or_start_trial')}</a>
<a className="ChoosePlanView__searchCTAButton" onClick={() => { setSetupStep({ setup_step: CHOOSE_PLAN, setup_number: 3, origin: ONBOARDING }); history.push('/onboarding/5'); }} href={plusCheckoutLink} target="_blank" rel="noreferrer">{t('next_or_start_trial')}</a>
)}
{selectedPlan === PREMIUM && (
<a className="ChoosePlanView__searchCTAButton" onClick={() => setSetupStep({ setup_step: CHOOSE_PLAN, setup_number: 4, origin: ONBOARDING })} href={premiumCheckoutLink} target="_blank" rel="noreferrer">{t('next_or_start_trial')}</a>
<a className="ChoosePlanView__searchCTAButton" onClick={() => { setSetupStep({ setup_step: CHOOSE_PLAN, setup_number: 4, origin: ONBOARDING }); history.push('/onboarding/5'); }} href={premiumCheckoutLink} target="_blank" rel="noreferrer">{t('next_or_start_trial')}</a>
)}
</div>
))}
@@ -11,6 +11,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import { withRouter } from 'react-router-dom';
import { buildReduxHOC } from '../../../../shared-hub/utils';
import ChoosePlanView from './ChoosePlanView';
import { setSetupStep } from '../../../../shared-hub/actions/SetupLifecycleActions';
@@ -19,4 +20,4 @@ const actionCreators = {
setSetupStep,
};

export default buildReduxHOC(['account', 'defaultSearch'], actionCreators, ChoosePlanView);
export default withRouter(buildReduxHOC(['account', 'defaultSearch'], actionCreators, ChoosePlanView));
ProTip! Use n and p to navigate between commits in a pull request.