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

Ghostery Dawn Intro Hub Miscellaneous Fixes #653

Merged
merged 21 commits into from Jan 7, 2021
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7210997
Fix the StepProgressBar width for each screen, step4 needs to be a li…
benstrumeyer Jan 5, 2021
69b62f6
Add back button to all pages
benstrumeyer Jan 5, 2021
fc6fbf2
Add margin top to Step Progress Bar
benstrumeyer Jan 5, 2021
9266a97
Add back button for success view
benstrumeyer Jan 5, 2021
065d70c
Refactor back button for all pages
benstrumeyer Jan 5, 2021
a20f0d2
Log the user out if they are returning to step 1
benstrumeyer Jan 5, 2021
010b3d9
Add logout behavior to navbar
benstrumeyer Jan 5, 2021
b7cdd1e
Add highestSetupStepReached() method to next buttons
benstrumeyer Jan 5, 2021
fd2fb31
Trying to add setup_step to SetupLifeCycleReducer
benstrumeyer Jan 5, 2021
271e0ed
Revert "Trying to add setup_step to SetupLifeCycleReducer"
benstrumeyer Jan 6, 2021
581e83f
Revert "Add highestSetupStepReached() method to next buttons"
benstrumeyer Jan 6, 2021
94d8d36
Prevent user from moving forwards in the StepProgress bar, only back
benstrumeyer Jan 6, 2021
c04012f
Add back console log
benstrumeyer Jan 6, 2021
e8ade34
Remove test class
benstrumeyer Jan 6, 2021
fd9fa6d
Merge branch 'ghostery-browser-intro-hub' into misc-fixes
benstrumeyer Jan 6, 2021
7d8c57a
Fix tooltips
benstrumeyer Jan 6, 2021
d946e2e
Get rid of margin-left on all screens. Fix success view strings. Cent…
benstrumeyer Jan 6, 2021
9c126d9
Fix back button on small screen sizes for SuccessView
benstrumeyer Jan 6, 2021
ecb8d98
Bold <StepProgressBar /> current step label
benstrumeyer Jan 6, 2021
17448c4
Fix ChoosePlanView price font sizes
benstrumeyer Jan 6, 2021
f34b748
Merge branch 'ghostery-browser-intro-hub' into misc-fixes
wlycdgr Jan 7, 2021
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Revert "Add highestSetupStepReached() method to next buttons"

This reverts commit b7cdd1e.
  • Loading branch information
benstrumeyer committed Jan 6, 2021
commit 581e83f5685a2a1455482e48f79e579eae71ea1b
@@ -44,7 +44,6 @@ class OnboardingViewContainer extends Component {
this.state = {
sendMountActions: false,
};
console.log('props container: ', props);

const { history } = this.props;
history.push(`/${ONBOARDING}/${WELCOME}`);
@@ -57,8 +56,6 @@ class OnboardingViewContainer extends Component {
const { actions, setup } = this.props;
actions.setSetupStep({ setup_step: 7, origin: ONBOARDING });
actions.initSetupProps(setup);
actions.setHighestSetupStepReached({ setup_step: SUCCESS });
console.log('props after setup: ', props);

// TODO modify this as needed
const { origin, pathname, hash } = window.location;
@@ -19,8 +19,7 @@ import OnboardingViewContainer from './OnboardingViewContainer';
import {
initSetupProps,
setSetupStep,
setSetupComplete,
setHighestSetupStepReached
setSetupComplete
} from '../../../shared-hub/actions/SetupLifecycleActions';
import {
setAdBlock,
@@ -35,7 +34,6 @@ export default withRouter(buildReduxHOC(
initSetupProps,
setSetupStep,
setSetupComplete,
setHighestSetupStepReached,

setBlockingPolicy,

@@ -13,7 +13,7 @@

import React from 'react';
import { NavLink } from 'react-router-dom';
import { LOGIN, WELCOME, BLOCK_SETTINGS } from '../../OnboardingView/OnboardingConstants';
import { LOGIN, WELCOME } from '../../OnboardingView/OnboardingConstants';

/**
* A Functional React component for rendering the Browser Welcome View
@@ -22,19 +22,13 @@ import { LOGIN, WELCOME, BLOCK_SETTINGS } from '../../OnboardingView/OnboardingC
*/
const WelcomeView = (props) => {
const { actions } = props;
const { setSetupStep, setHighestSetupStepReached } = actions;

const handleSetupStep = () => {
setSetupStep({ setup_step: LOGIN, origin: WELCOME });
setHighestSetupStepReached({ setup_step: BLOCK_SETTINGS });
};

const { setSetupStep } = actions;
return (
<div className="WelcomeView__container">
<div className="WelcomeView__title">{t('ghostery_browser_hub_onboarding_welcome')}</div>
<div className="WelcomeView__subtitle">{t('ghostery_browser_hub_onboarding_lets_begin')}</div>
<img className="WelcomeView__rocketShip" src="/app/images/hub/welcome/rocketShip.png" />
<NavLink className="WelcomeView__ctaButton" to="/onboarding/1" onClick={() => handleSetupStep()}>
<NavLink className="WelcomeView__ctaButton" to="/onboarding/1" onClick={() => setSetupStep({ setup_step: LOGIN, origin: WELCOME })}>
<span>{t('ghostery_browser_hub_onboarding_lets_do_this')}</span>
</NavLink>
</div>
@@ -13,11 +13,10 @@

import { buildReduxHOC } from '../../../../shared-hub/utils';
import WelcomeView from './WelcomeView';
import { setSetupStep, setHighestSetupStepReached } from '../../../../shared-hub/actions/SetupLifecycleActions';
import { setSetupStep } from '../../../../shared-hub/actions/SetupLifecycleActions';

const actionCreators = {
setSetupStep,
setHighestSetupStepReached
};

export default buildReduxHOC([], actionCreators, WelcomeView);
@@ -18,7 +18,7 @@ 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, BLOCK_SETTINGS } from '../../OnboardingView/OnboardingConstants';
import { LOGIN, ONBOARDING } from '../../OnboardingView/OnboardingConstants';

const SIGN_IN = 'SIGN_IN';
const CREATE_ACCOUNT = 'CREATE_ACCOUNT';
@@ -70,7 +70,7 @@ const renderFAQListItem = (icon, label, description) => (
*/
const Step1_CreateAccountView = (props) => {
const { user, actions } = props;
const { setSetupStep, setHighestSetupStepReached } = actions;
const { setSetupStep } = actions;
const email = user && user.email;

const [expanded, setExpanded] = useState(false);
@@ -91,16 +91,11 @@ const Step1_CreateAccountView = (props) => {
setExpanded(!expanded);
};

const handleSetupStep = () => {
setSetupStep({ setup_step: LOGIN, origin: ONBOARDING });
setHighestSetupStepReached({ setup_step: BLOCK_SETTINGS });
};

const renderSkipLink = () => (
<div className="row align-center-middle">
<div className="columns small-10 medium-6" />
<div className="columns small-10 medium-6">
<NavLink className="Step1_CreateAccountView__skip" to="/onboarding/2" onClick={() => handleSetupStep()}>
<NavLink className="Step1_CreateAccountView__skip" to="/onboarding/2" onClick={() => setSetupStep({ setup_step: LOGIN, origin: ONBOARDING })}>
<span>{t('ghostery_browser_hub_onboarding_skip')}</span>
</NavLink>
</div>
@@ -112,7 +107,7 @@ const Step1_CreateAccountView = (props) => {
<div className="Step1_CreateAccountView__title">{t('ghostery_browser_hub_onboarding_you_are_signed_in_as')}</div>
<div className="Step1_CreateAccountView__email">{email}</div>
<div className="Step1_CreateAccountView__ctaButtonContainer">
<NavLink className="Step1_CreateAccountView__ctaButton" to="/onboarding/2" onClick={() => handleSetupStep()}>
<NavLink className="Step1_CreateAccountView__ctaButton" to="/onboarding/2" onClick={() => setSetupStep({ setup_step: LOGIN, origin: ONBOARDING })}>
<span>{t('next')}</span>
</NavLink>
</div>
@@ -14,11 +14,10 @@
import { withRouter } from 'react-router-dom';
import { buildReduxHOC } from '../../../../shared-hub/utils';
import Step1_CreateAccountView from './Step1_CreateAccountView';
import { setSetupStep, setHighestSetupStepReached } from '../../../../shared-hub/actions/SetupLifecycleActions';
import { setSetupStep } from '../../../../shared-hub/actions/SetupLifecycleActions';

const actionCreators = {
setSetupStep,
setHighestSetupStepReached
};

export default withRouter(buildReduxHOC(['account'], actionCreators, Step1_CreateAccountView));
@@ -69,7 +69,7 @@ class BlockSettingsView extends Component {
if (blockAds !== null && kindsOfTrackers !== null && antiTracking !== null && smartBrowsing !== null) {
const { actions } = this.props;
const {
setAdBlock, setAntiTracking, setSmartBlocking, setBlockingPolicy, setSetupStep, setHighestSetupStepReached
setAdBlock, setAntiTracking, setSmartBlocking, setBlockingPolicy, setSetupStep
} = actions;
const { history } = this.props;

@@ -93,7 +93,6 @@ class BlockSettingsView extends Component {
}
setBlockingPolicy({ blockingPolicy });
setSetupStep({ setup_step: CHOOSE_DEFAULT_SEARCH, origin: ONBOARDING });
setHighestSetupStepReached({ setup_step: CHOOSE_DEFAULT_SEARCH });
history.push('/onboarding/3');
} else {
const { setToast } = this.props;
@@ -17,7 +17,7 @@ import { logout } from '../../../../Account/AccountActions';
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, setHighestSetupStepReached } from '../../../../shared-hub/actions/SetupLifecycleActions';
import { setSetupStep } from '../../../../shared-hub/actions/SetupLifecycleActions';

const actionCreators = {
logout,
@@ -27,7 +27,6 @@ const actionCreators = {
setBlockingPolicy,
setToast,
setSetupStep,
setHighestSetupStepReached,
};

export default buildReduxHOC(null, actionCreators, BlockSettingsView);
@@ -35,10 +35,9 @@ class ChooseDefaultSearchView extends Component {

handleSubmit = () => {
const { actions, history } = this.props;
const { setSetupStep, setHighestSetupStepReached } = actions;
const { setSetupStep } = actions;

setSetupStep({ setup_step: CHOOSE_PLAN, origin: ONBOARDING });
setHighestSetupStepReached({ setup_step: CHOOSE_PLAN });

history.push(`/${ONBOARDING}/${CHOOSE_PLAN}`);
}
@@ -13,11 +13,10 @@

import ChooseDefaultSearchView from './ChooseDefaultSearchView';
import { buildReduxHOC } from '../../../../shared-hub/utils';
import { setSetupStep, setHighestSetupStepReached } from '../../../../shared-hub/actions/SetupLifecycleActions';
import { setSetupStep } from '../../../../shared-hub/actions/SetupLifecycleActions';

const actionCreators = {
setSetupStep,
setHighestSetupStepReached
};

export default buildReduxHOC(null, actionCreators, ChooseDefaultSearchView);
@@ -18,7 +18,7 @@ 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, SUCCESS } from '../../OnboardingView/OnboardingConstants';
import { CHOOSE_PLAN, ONBOARDING } from '../../OnboardingView/OnboardingConstants';

const plusCheckoutLink = `${globals.CHECKOUT_BASE_URL}/en/plus`;
const premiumCheckoutLink = `${globals.CHECKOUT_BASE_URL}/en/premium`;
@@ -218,13 +218,6 @@ class ChoosePlanView extends React.Component {
return t('ghostery_browser_hub_onboarding_choose_an_option');
};

handleSetupStep = () => {
const { actions } = this.props;
const { setSetupStep, setHighestSetupStepReached } = actions;
setSetupStep({ setup_step: CHOOSE_PLAN, origin: ONBOARDING });
setHighestSetupStepReached({ setup_step: SUCCESS });
}

plusCard = (checked, handleClick, showCTAButton = false) => {
const { actions } = this.props;
const { setSetupStep } = actions;
@@ -13,11 +13,10 @@

import { buildReduxHOC } from '../../../../shared-hub/utils';
import ChoosePlanView from './ChoosePlanView';
import { setSetupStep, setHighestSetupStepReached } from '../../../../shared-hub/actions/SetupLifecycleActions';
import { setSetupStep } from '../../../../shared-hub/actions/SetupLifecycleActions';

const actionCreators = {
setSetupStep,
setHighestSetupStepReached
};

export default buildReduxHOC(['account'], actionCreators, ChoosePlanView);
@@ -53,8 +53,7 @@ const steps = [
* @memberof HubComponents
*/
const StepProgressBar = (props) => {
const { currentStep, setup } = props;
console.log('setup: ', props);
const { currentStep } = props;
const totalSteps = steps.length;

const logoutIfStepOne = (stepId) => {
@@ -15,9 +15,8 @@ import StepProgressBar from './StepProgressBar';
import { buildReduxHOC } from '../../../../shared-hub/utils';
import { logout } from '../../../../Account/AccountActions';

const stateSlices = ['setup'];
const actionCreators = {
logout
};

export default buildReduxHOC(stateSlices, actionCreators, StepProgressBar);
export default buildReduxHOC(null, actionCreators, StepProgressBar);
@@ -15,8 +15,7 @@ import { makeDeferredDispatcher } from '../utils';
import {
INIT_SETUP_PROPS,
SET_SETUP_STEP,
SET_SETUP_COMPLETE,
SET_HIGHEST_SETUP_STEP_REACHED
SET_SETUP_COMPLETE
} from '../constants/SetupLifecycleConstants';

export function initSetupProps(data) {
@@ -31,10 +30,3 @@ export const setSetupStep =

export const setSetupComplete =
actionData => makeDeferredDispatcher(SET_SETUP_COMPLETE, actionData);

export function setHighestSetupStepReached(data) {
return {
type: SET_HIGHEST_SETUP_STEP_REACHED,
data,
};
}
@@ -14,4 +14,3 @@
export const INIT_SETUP_PROPS = 'INIT_SETUP_PROPS';
export const SET_SETUP_STEP = 'SET_SETUP_STEP';
export const SET_SETUP_COMPLETE = 'SET_SETUP_COMPLETE';
export const SET_HIGHEST_SETUP_STEP_REACHED = 'SET_HIGHEST_SETUP_STEP_REACHED';
@@ -12,15 +12,10 @@
*/

import {
INIT_SETUP_PROPS,
SET_HIGHEST_SETUP_STEP_REACHED
INIT_SETUP_PROPS
} from '../constants/SetupLifecycleConstants';

const initialState = {
setup_step: 0 // To be used in <StepProgressBar /> only. Prevents the user from navigating to a page they have not yet completed the previous steps for
};

// const initialState = {};
const initialState = {};

function SetupLifecycleReducer(state = initialState, action) {
switch (action.type) {
@@ -39,15 +34,6 @@ function SetupLifecycleReducer(state = initialState, action) {
enable_anti_tracking,
enable_ad_block,
enable_smart_block,
setup_step: 0
}
};
}
case SET_HIGHEST_SETUP_STEP_REACHED: {
return {
...state,
setup: {
...{ setup_step: action.data }
}
};
}
@@ -407,6 +407,7 @@ class Metrics {
* @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'
ProTip! Use n and p to navigate between commits in a pull request.