diff --git a/app/ghostery-browser-hub/Views/OnboardingView/OnboardingViewContainer.jsx b/app/ghostery-browser-hub/Views/OnboardingView/OnboardingViewContainer.jsx
index 8295db886..a09ada285 100644
--- a/app/ghostery-browser-hub/Views/OnboardingView/OnboardingViewContainer.jsx
+++ b/app/ghostery-browser-hub/Views/OnboardingView/OnboardingViewContainer.jsx
@@ -18,7 +18,7 @@ import { BLOCKING_POLICY_RECOMMENDED } from '../../../shared-hub/constants/Block
// Component Views
import WelcomeView from '../OnboardingViews/Step0_WelcomeView';
-import LoginView from '../OnboardingViews/Step1_LoginView';
+import Step1_CreateAccountView from '../OnboardingViews/Step1_CreateAccountView';
import BlockSettingsView from '../OnboardingViews/Step2_BlockSettingsView';
import ChooseDefaultSearchView from '../OnboardingViews/Step3_ChooseDefaultSearchView';
import ChoosePlanView from '../OnboardingViews/Step4_ChoosePlanView';
@@ -54,7 +54,7 @@ class OnboardingViewContainer extends Component {
// TODO modify this as needed
const { actions, setup } = this.props;
- actions.setSetupStep({ setup_step: 7 });
+ actions.setSetupStep({ setup_step: 7, origin: ONBOARDING });
actions.initSetupProps(setup);
// TODO modify this as needed
@@ -66,7 +66,7 @@ class OnboardingViewContainer extends Component {
this.state = {
sendMountActions: true
};
- actions.setSetupStep({ setup_step: 8 });
+ actions.setSetupStep({ setup_step: 8, origin: ONBOARDING });
actions.setBlockingPolicy({ blockingPolicy: BLOCKING_POLICY_RECOMMENDED });
actions.setAntiTracking({ enable_anti_tracking: true }); // covered
actions.setAdBlock({ enable_ad_block: true }); // covered
@@ -89,7 +89,7 @@ class OnboardingViewContainer extends Component {
{
index: 1,
path: `/${ONBOARDING}/${LOGIN}`,
- bodyComponents: [LoginView],
+ bodyComponents: [Step1_CreateAccountView],
},
{
index: 2,
@@ -104,7 +104,7 @@ class OnboardingViewContainer extends Component {
{
index: 4,
path: `/${ONBOARDING}/${CHOOSE_PLAN}`,
- bodyComponents: [ChoosePlanView, LoginView],
+ bodyComponents: [ChoosePlanView],
},
{
index: 5,
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step0_WelcomeView/WelcomeView.jsx b/app/ghostery-browser-hub/Views/OnboardingViews/Step0_WelcomeView/WelcomeView.jsx
index 6b7fab917..d11dbfe1a 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step0_WelcomeView/WelcomeView.jsx
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step0_WelcomeView/WelcomeView.jsx
@@ -13,21 +13,26 @@
import React from 'react';
import { NavLink } from 'react-router-dom';
+import { LOGIN, WELCOME } from '../../OnboardingView/OnboardingConstants';
/**
* A Functional React component for rendering the Browser Welcome View
* @return {JSX} JSX for rendering the Browser Welcome View of the Hub app
* @memberof GhosteryBrowserHubViews
*/
-const WelcomeView = () => (
-
-
{t('ghostery_browser_hub_onboarding_welcome')}
-
{t('ghostery_browser_hub_onboarding_lets_begin')}
-

-
- { t('ghostery_browser_hub_onboarding_lets_do_this') }
-
-
-);
+const WelcomeView = (props) => {
+ const { actions } = props;
+ const { setSetupStep } = actions;
+ return (
+
+
{t('ghostery_browser_hub_onboarding_welcome')}
+
{t('ghostery_browser_hub_onboarding_lets_begin')}
+

+
setSetupStep({ setup_step: LOGIN, origin: WELCOME })}>
+ {t('ghostery_browser_hub_onboarding_lets_do_this')}
+
+
+ );
+};
export default WelcomeView;
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step0_WelcomeView/index.js b/app/ghostery-browser-hub/Views/OnboardingViews/Step0_WelcomeView/index.js
index d5f22aa58..c649d5a74 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step0_WelcomeView/index.js
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step0_WelcomeView/index.js
@@ -11,6 +11,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/
+import { buildReduxHOC } from '../../../../shared-hub/utils';
import WelcomeView from './WelcomeView';
+import { setSetupStep } from '../../../../shared-hub/actions/SetupLifecycleActions';
-export default WelcomeView;
+const actionCreators = {
+ setSetupStep,
+};
+
+export default buildReduxHOC([], actionCreators, WelcomeView);
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step1_CreateAccountForm/Step1_CreateAccountFormContainer.jsx b/app/ghostery-browser-hub/Views/OnboardingViews/Step1_CreateAccountForm/Step1_CreateAccountFormContainer.jsx
index 8c0180897..31f9ffc76 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step1_CreateAccountForm/Step1_CreateAccountFormContainer.jsx
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step1_CreateAccountForm/Step1_CreateAccountFormContainer.jsx
@@ -162,6 +162,7 @@ class CreateAccountFormContainer extends Component {
});
actions.register(email, confirmEmail, firstName, lastName, password).then((success) => {
if (success) {
+ // User is automatically logged in, and redirected to the logged in view of BrowserCreateAccountForm
actions.getUser().then(() => {
if (isUpdatesChecked) actions.handleEmailPreferencesCheckboxChange('global', isUpdatesChecked);
});
@@ -170,7 +171,6 @@ class CreateAccountFormContainer extends Component {
toastMessage: t('hub_create_account_toast_success'),
toastClass: 'success'
});
- // Route to next screen
} else {
actions.setToast({
toastMessage: t('hub_create_account_toast_error'),
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step1_CreateAccountView/Step1_CreateAccountView.jsx b/app/ghostery-browser-hub/Views/OnboardingViews/Step1_CreateAccountView/Step1_CreateAccountView.jsx
index 4b284e200..0451de371 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step1_CreateAccountView/Step1_CreateAccountView.jsx
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step1_CreateAccountView/Step1_CreateAccountView.jsx
@@ -12,11 +12,13 @@
*/
import React, { Fragment, useRef, useState } from 'react';
+import { NavLink } from 'react-router-dom';
import PropTypes from 'prop-types';
import ClassNames from 'classnames';
import Step1_LogInForm from '../Step1_LogInForm';
import Step1_CreateAccountForm from '../Step1_CreateAccountForm';
import globals from '../../../../../src/classes/Globals';
+import { LOGIN, ONBOARDING } from '../../OnboardingView/OnboardingConstants';
const SIGN_IN = 'SIGN_IN';
const CREATE_ACCOUNT = 'CREATE_ACCOUNT';
@@ -61,22 +63,14 @@ const renderFAQListItem = (icon, label, description) => (
);
-const renderSkipLink = () => (
-
-
-
-
{t('ghostery_browser_hub_onboarding_skip')}
-
-
-);
-
/**
* A Functional React component for rendering the Browser Create Account View
* @return {JSX} JSX for rendering the Browser Create Account View of the Hub app
* @memberof GhosteryBrowserHubViews
*/
const Step1_CreateAccountView = (props) => {
- const { user } = props;
+ const { user, actions } = props;
+ const { setSetupStep } = actions;
const email = user && user.email;
const [expanded, setExpanded] = useState(false);
@@ -97,13 +91,25 @@ const Step1_CreateAccountView = (props) => {
setExpanded(!expanded);
};
+ const renderSkipLink = () => (
+
+
+
+ setSetupStep({ setup_step: LOGIN, origin: ONBOARDING })}>
+ {t('ghostery_browser_hub_onboarding_skip')}
+
+
+
+ );
+
return (user ? (
{t('ghostery_browser_hub_onboarding_you_are_signed_in_as')}
{email}
- {/* Link to next page */}
-
+ setSetupStep({ setup_step: LOGIN, origin: ONBOARDING })}>
+ {t('next')}
+
) : (
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step1_CreateAccountView/index.js b/app/ghostery-browser-hub/Views/OnboardingViews/Step1_CreateAccountView/index.js
index ebf16f74d..3015cae6f 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step1_CreateAccountView/index.js
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step1_CreateAccountView/index.js
@@ -14,5 +14,10 @@
import { withRouter } from 'react-router-dom';
import { buildReduxHOC } from '../../../../shared-hub/utils';
import Step1_CreateAccountView from './Step1_CreateAccountView';
+import { setSetupStep } from '../../../../shared-hub/actions/SetupLifecycleActions';
-export default withRouter(buildReduxHOC(['account'], null, Step1_CreateAccountView));
+const actionCreators = {
+ setSetupStep,
+};
+
+export default withRouter(buildReduxHOC(['account'], actionCreators, Step1_CreateAccountView));
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step1_LogInForm/index.js b/app/ghostery-browser-hub/Views/OnboardingViews/Step1_LogInForm/index.js
index 0cecb8185..21a7378e6 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step1_LogInForm/index.js
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step1_LogInForm/index.js
@@ -22,6 +22,7 @@ import {
} from '../../../../Account/AccountActions';
import { getTheme } from '../../../../panel/actions/PanelActions';
import setToast from '../../../../shared-hub/actions/ToastActions';
+import { setSetupStep } from '../../../../shared-hub/actions/SetupLifecycleActions';
const stateSlices = ['account'];
const actionCreators = {
@@ -30,7 +31,8 @@ const actionCreators = {
getUser,
getUserSettings,
getTheme,
- resetPassword
+ resetPassword,
+ setSetupStep,
};
export default buildReduxHOC(stateSlices, actionCreators, Step1_LogInFormContainer);
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step1_LoginView/LoginView.jsx b/app/ghostery-browser-hub/Views/OnboardingViews/Step1_LoginView/LoginView.jsx
deleted file mode 100644
index 29806db95..000000000
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step1_LoginView/LoginView.jsx
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * Ghostery Browser Hub Login View Component
- *
- * Ghostery Browser Extension
- * https://www.ghostery.com/
- *
- * Copyright 2020 Ghostery, Inc. All rights reserved.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0
- */
-
-import React from 'react';
-
-const LoginView = () => Step 1: Login View
;
-
-export default LoginView;
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step1_LoginView/index.js b/app/ghostery-browser-hub/Views/OnboardingViews/Step1_LoginView/index.js
deleted file mode 100644
index d059cb767..000000000
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step1_LoginView/index.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Point of entry index.js file for Ghostery Browser Hub Onboarding Login View
- *
- * Ghostery Browser Extension
- * https://www.ghostery.com/
- *
- * Copyright 2020 Ghostery, Inc. All rights reserved.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0
- */
-
-import LoginView from './LoginView';
-
-export default LoginView;
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step2_BlockSettingsView/BlockSettingsView.jsx b/app/ghostery-browser-hub/Views/OnboardingViews/Step2_BlockSettingsView/BlockSettingsView.jsx
index 13cc9fe6d..b281816db 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step2_BlockSettingsView/BlockSettingsView.jsx
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step2_BlockSettingsView/BlockSettingsView.jsx
@@ -16,6 +16,7 @@ import React, { Component } from 'react';
// import Tooltip from '../../../../panel/components/Tooltip';
import RadioButton from '../../../../shared-components/RadioButton/RadioButton';
import ToggleCheckbox from '../../../../shared-components/ToggleCheckbox/ToggleCheckbox';
+import { CHOOSE_DEFAULT_SEARCH, ONBOARDING } from '../../OnboardingView/OnboardingConstants';
/**
* @class Implement the Block Settings View for the Ghostery Browser Hub
@@ -65,9 +66,11 @@ class BlockSettingsView extends Component {
// Will only change user settings if all questions are answered
if (blockAds !== null && kindsOfTrackers !== null && antiTracking !== null && smartBrowsing !== null) {
+ const { actions } = this.props;
const {
- setAdBlock, setAntiTracking, setSmartBlocking, setBlockingPolicy
- } = this.props;
+ setAdBlock, setAntiTracking, setSmartBlocking, setBlockingPolicy, setSetupStep
+ } = actions;
+ const { history } = this.props;
setAdBlock(blockAds);
setAntiTracking(antiTracking);
@@ -88,6 +91,8 @@ class BlockSettingsView extends Component {
break;
}
setBlockingPolicy({ blockingPolicy });
+ setSetupStep({ setup_step: CHOOSE_DEFAULT_SEARCH, origin: ONBOARDING });
+ history.push('/onboarding/3');
} else {
const { setToast } = this.props;
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step2_BlockSettingsView/index.js b/app/ghostery-browser-hub/Views/OnboardingViews/Step2_BlockSettingsView/index.js
index 93e4cd51f..12c2c9950 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step2_BlockSettingsView/index.js
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step2_BlockSettingsView/index.js
@@ -16,6 +16,7 @@ import { buildReduxHOC } from '../../../../shared-hub/utils';
import { setAntiTracking, setAdBlock, setSmartBlocking } from '../../../../shared-hub/actions/AntiSuiteActions';
import setBlockingPolicy from '../../../../shared-hub/actions/BlockingPolicyActions';
import setToast from '../../../../shared-hub/actions/ToastActions';
+import { setSetupStep } from '../../../../shared-hub/actions/SetupLifecycleActions';
const actionCreators = {
setAntiTracking,
@@ -23,6 +24,7 @@ const actionCreators = {
setSmartBlocking,
setBlockingPolicy,
setToast,
+ setSetupStep,
};
export default buildReduxHOC(null, actionCreators, BlockSettingsView);
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step3_ChooseDefaultSearchView/ChooseDefaultSearchView.jsx b/app/ghostery-browser-hub/Views/OnboardingViews/Step3_ChooseDefaultSearchView/ChooseDefaultSearchView.jsx
index dd0f23058..5c8ad8e93 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step3_ChooseDefaultSearchView/ChooseDefaultSearchView.jsx
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step3_ChooseDefaultSearchView/ChooseDefaultSearchView.jsx
@@ -13,6 +13,7 @@
import React from 'react';
+// TODO: Add setSetupStep({ setup_step: CHOOSE_DEFAULT_SEARCH, origin: WELCOME }) to next button
const ChooseDefaultSearchView = () => Step 3: Choose Default Search View
;
export default ChooseDefaultSearchView;
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step4_ChoosePlanView/ChoosePlanView.jsx b/app/ghostery-browser-hub/Views/OnboardingViews/Step4_ChoosePlanView/ChoosePlanView.jsx
index 4ce39dc8a..93960f467 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step4_ChoosePlanView/ChoosePlanView.jsx
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step4_ChoosePlanView/ChoosePlanView.jsx
@@ -12,11 +12,13 @@
*/
import React, { Fragment } from 'react';
+import { NavLink } from 'react-router-dom';
import ClassNames from 'classnames';
import PropTypes from 'prop-types';
import RadioButton from '../../../../shared-components/RadioButton';
import globals from '../../../../../src/classes/Globals';
import { BASIC, PLUS, PREMIUM } from '../../../../hub/Views/UpgradePlanView/UpgradePlanViewConstants';
+import { CHOOSE_PLAN, ONBOARDING } from '../../OnboardingView/OnboardingConstants';
const plusCheckoutLink = `${globals.CHECKOUT_BASE_URL}/en/plus`;
const premiumCheckoutLink = `${globals.CHECKOUT_BASE_URL}/en/premium`;
@@ -72,64 +74,6 @@ const basicCard = (checked, handleClick) => {
);
};
-const plusCard = (checked, handleClick, showCTAButton = false) => {
- const cardClassNames = ClassNames('ChoosePlanView__card plus', {
- checked
- });
- return (
-
-
-
-
-
-
-
-
Ghostery Plus
-
-
- $4.99
- {t('per_month')}
-
-
-
{t('hub_upgrade_additional_protection')}
-
-
-
- {t('ghostery_browser_hub_onboarding_private_search')}
-
-
-
- {t('ghostery_browser_hub_onboarding_tracker_protection')}
-
-
-
- {t('ghostery_browser_hub_onboarding_speedy_page_loads')}
-
-
-
- {t('ghostery_browser_hub_onboarding_intelligence_technology')}
-
-
-
- {t('ghostery_browser_hub_onboarding_ad_free')}
-
-
-
- {t('ghostery_browser_hub_onboarding_supports_ghosterys_mission')}
-
-
-
-
- {showCTAButton && (
- // Route to next screen
-
- )}
-
- );
-};
-
const premiumCard = (checked, handleClick, showCTAButton = false) => {
const cardClassNames = ClassNames('ChoosePlanView__card premium', {
checked
@@ -274,8 +218,70 @@ class ChoosePlanView extends React.Component {
return t('ghostery_browser_hub_onboarding_choose_an_option');
};
+ plusCard = (checked, handleClick, showCTAButton = false) => {
+ const { actions } = this.props;
+ const { setSetupStep } = actions;
+ const cardClassNames = ClassNames('ChoosePlanView__card plus', {
+ checked
+ });
+ return (
+
+
+
+
+
+
+
+
Ghostery Plus
+
+
+ $4.99
+ {t('per_month')}
+
+
+
{t('hub_upgrade_additional_protection')}
+
+
+
+ {t('ghostery_browser_hub_onboarding_private_search')}
+
+
+
+ {t('ghostery_browser_hub_onboarding_tracker_protection')}
+
+
+
+ {t('ghostery_browser_hub_onboarding_speedy_page_loads')}
+
+
+
+ {t('ghostery_browser_hub_onboarding_intelligence_technology')}
+
+
+
+ {t('ghostery_browser_hub_onboarding_ad_free')}
+
+
+
+ {t('ghostery_browser_hub_onboarding_supports_ghosterys_mission')}
+
+
+
+
+ {showCTAButton && (
+ setSetupStep({ setup_step: CHOOSE_PLAN, origin: ONBOARDING })}>
+ {t('ghostery_browser_hub_onboarding_keep')}
+
+ )}
+
+ );
+ };
+
render() {
- const { user, didNotSelectGhosterySearch } = this.props;
+ const { user, didNotSelectGhosterySearch, actions } = this.props;
+ const { setSetupStep } = actions;
const { expanded, selectedPlan } = this.state;
const isBasic = !user;
@@ -309,7 +315,7 @@ class ChoosePlanView extends React.Component {
{(isPlus) ? (
- {plusCard(this.isPlusPlanChecked(), this.selectPlusPlan, isPlus)}
+ {this.plusCard(this.isPlusPlanChecked(), this.selectPlusPlan, isPlus)}
{t('ghostery_browser_hub_onboarding_or')}
@@ -323,7 +329,7 @@ class ChoosePlanView extends React.Component {
)}
{!isPremium && (
- {plusCard(this.isPlusPlanChecked(), this.selectPlusPlan)}
+ {this.plusCard(this.isPlusPlanChecked(), this.selectPlusPlan)}
)}
{premiumCard(this.isPremiumPlanChecked(), this.selectPremiumPlan)}
@@ -332,8 +338,9 @@ class ChoosePlanView extends React.Component {
{(isBasic && (
{(selectedPlan === BASIC) && (
- // Change to route to next page
-
+
setSetupStep({ setup_step: CHOOSE_PLAN, origin: ONBOARDING })}>
+ {t('next')}
+
)}
{selectedPlan === PLUS && (
{t('next')}
@@ -344,8 +351,9 @@ class ChoosePlanView extends React.Component {
))}
{isPremium && (
- // Change to route to next page
-
+
setSetupStep({ setup_step: CHOOSE_PLAN, origin: ONBOARDING })}>
+ {t('next')}
+
)}
)}
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step4_ChoosePlanView/index.jsx b/app/ghostery-browser-hub/Views/OnboardingViews/Step4_ChoosePlanView/index.jsx
index 402d19108..397a0ab66 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step4_ChoosePlanView/index.jsx
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step4_ChoosePlanView/index.jsx
@@ -12,7 +12,11 @@
*/
import { buildReduxHOC } from '../../../../shared-hub/utils';
-
import ChoosePlanView from './ChoosePlanView';
+import { setSetupStep } from '../../../../shared-hub/actions/SetupLifecycleActions';
+
+const actionCreators = {
+ setSetupStep,
+};
-export default buildReduxHOC(['account'], null, ChoosePlanView);
+export default buildReduxHOC(['account'], actionCreators, ChoosePlanView);
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step5_SuccessView/SuccessView.jsx b/app/ghostery-browser-hub/Views/OnboardingViews/Step5_SuccessView/SuccessView.jsx
index 815e60463..c1a87cc37 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step5_SuccessView/SuccessView.jsx
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step5_SuccessView/SuccessView.jsx
@@ -18,13 +18,17 @@ import React from 'react';
* @return {JSX} JSX for rendering the Browser Success View of the Hub app
* @memberof HubComponents
*/
-const SuccessView = () => (
-
-
{t('ghostery_browser_hub_onboarding_yay_youre_all_set')}
-
{`${t('ghostery_browser_hub_onboarding_start_browsing_the_web_with')} Ghostery`}
-

-
-
-);
+const SuccessView = (props) => {
+ const { actions } = props;
+ const { sendPing } = actions;
+ return (
+
+
{t('ghostery_browser_hub_onboarding_yay_youre_all_set')}
+
{`${t('ghostery_browser_hub_onboarding_start_browsing_the_web_with')} Ghostery`}
+

+
+
+ );
+};
export default SuccessView;
diff --git a/app/ghostery-browser-hub/Views/OnboardingViews/Step5_SuccessView/index.js b/app/ghostery-browser-hub/Views/OnboardingViews/Step5_SuccessView/index.js
index cdcea8832..9b5cf3814 100644
--- a/app/ghostery-browser-hub/Views/OnboardingViews/Step5_SuccessView/index.js
+++ b/app/ghostery-browser-hub/Views/OnboardingViews/Step5_SuccessView/index.js
@@ -12,5 +12,11 @@
*/
import SuccessView from './SuccessView';
+import { buildReduxHOC } from '../../../../shared-hub/utils';
+import sendPing from '../../../../shared-hub/actions/MetricsActions';
-export default SuccessView;
+const actionCreators = {
+ sendPing
+};
+
+export default buildReduxHOC(null, actionCreators, SuccessView);
diff --git a/app/shared-hub/utils/index.js b/app/shared-hub/utils/index.js
index 693a05465..55f478196 100644
--- a/app/shared-hub/utils/index.js
+++ b/app/shared-hub/utils/index.js
@@ -20,6 +20,7 @@ import {
bindActionCreators
} from 'redux';
import { connect } from 'react-redux';
+import { withRouter } from 'react-router-dom';
// Imports utilities from elsewhere in the codebase to reduce duplicate code
import { log } from '../../../src/utils/common';
@@ -106,7 +107,7 @@ function buildReduxHOC(stateKeys, actionCreators, baseComponent) {
actions: bindActionCreators(actionCreators, dispatch)
});
- return connect(mapStateToProps, mapDispatchToProps)(baseComponent);
+ return withRouter(connect(mapStateToProps, mapDispatchToProps)(baseComponent));
}
export {
diff --git a/src/background.js b/src/background.js
index 64c6fb206..89e7f08c4 100644
--- a/src/background.js
+++ b/src/background.js
@@ -557,6 +557,11 @@ function handleGhosteryHub(name, message, callback) {
} else {
({ setup_step } = setup_step);
}
+ const origin = message.origin || '';
+ if (origin === 'onboarding') {
+ conf.setup_step = message.setup_step;
+ metrics.ping('gb_onboarding');
+ }
callback({ setup_step });
break;
}
diff --git a/src/classes/Metrics.js b/src/classes/Metrics.js
index 0a4d7c16d..3f7280635 100644
--- a/src/classes/Metrics.js
+++ b/src/classes/Metrics.js
@@ -184,6 +184,12 @@ class Metrics {
this._sendReq(type, ['all']);
break;
+ // Ghostery Browser Hub - Ghostery 8.5.5+
+ case 'gb_onboarding':
+ case 'gb_onboarding_success':
+ this._sendReq(type, ['all']);
+ break;
+
// Uncaught Pings
default:
log(`metrics ping() error: ping name ${type} not found`);
@@ -285,7 +291,7 @@ class Metrics {
// Antitracking state
this._buildQueryPair('at', conf.enable_anti_tracking ? '1' : '0') +
// The deepest setup page reached by user during setup
- this._buildQueryPair('ss', (conf.metrics.install_complete_all || type === 'install_complete') ? conf.setup_step.toString() : '-1') +
+ this._buildQueryPair('ss', Metrics._getSetupStep(type).toString()) +
// The number of times the user has gone through setup
this._buildQueryPair('sl', conf.setup_number.toString()) +
// Type of blocking selected during setup
@@ -393,6 +399,22 @@ class Metrics {
return 'gbe';
}
+ /**
+ * Get the Setup step
+ *
+ * @private
+ *
+ * @return {number} The deepest setup page reached by user during setup
+ */
+ static _getSetupStep(type) {
+ console.log('conf.setup_step', conf.setup_step);
+ if (conf.metrics.install_complete_all
+ || type === 'install_complete'
+ || type === 'gb_onboarding'
+ || type === 'gb_onboarding_success') return conf.setup_step;
+ return -1;
+ }
+
/**
* Calculate days since the last daily active ping.
*