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

Add setup_number to ChooseSearchView

  • Loading branch information
benstrumeyer committed Jan 27, 2021
commit 6c7ecff452e9deb58b5cdf66008ef8f2572f1daf
@@ -2436,7 +2436,7 @@
"ghostery_dawn_onboarding_select_option": {
"message": "Select option"
},
"ghostery_dawn_onboarding_you_have_selected_an_alternate_serach_engine": {
"ghostery_dawn_onboarding_you_have_selected_an_alternate_search_engine": {
"message": "You have selected an alternate search engine:"
},
"ghostery_dawn_onboarding_create_account_for_trial": {
@@ -75,7 +75,7 @@ class BlockSettingsView extends Component {
const partThree = (antiTracking) ? '1' : '2';
const partFour = (smartBrowsing) ? '1' : '2';

return partOne + partTwo + partThree + partFour;
return `${partOne}${partTwo}${partThree}${partFour}`;
}

handleSubmit = () => {
@@ -16,4 +16,14 @@ export const SEARCH_GHOSTERY = 'Ghostery';
export const SEARCH_BING = 'Bing';
export const SEARCH_YAHOO = 'Yahoo';
export const SEARCH_STARTPAGE = 'Startpage';
export const SEARCH_DUCKDUCK_GO = 'DuckDuck Go';
export const SEARCH_ECOSIA = 'Ecosia';
export const SEARCH_EKORU = 'Ekoru';
export const SEARCH_GIBIRU = 'Gibiru';
export const SEARCH_GOOGLE = 'Google';
export const SEARCH_ONESEARCH = 'OneSearch';
export const SEARCH_PRIVADO = 'Privado';
export const SEARCH_QWANT = 'Qwant';
export const SEARCH_ENCRYPT = 'Search Encrypt';
export const SEARCH_TAILCAT = 'Tailcat';
export const SEARCH_OTHER = t('ghostery_dawn_onboarding_other');
@@ -18,13 +18,39 @@ import RadioButton from '../../../../shared-components/RadioButton';
import { ONBOARDING, CHOOSE_PLAN } from '../../OnboardingView/OnboardingConstants';
import {
SEARCH_GHOSTERY,
SEARCH_BING,
SEARCH_YAHOO,
SEARCH_STARTPAGE,
SEARCH_BING,
SEARCH_DUCKDUCK_GO,
SEARCH_ECOSIA,
SEARCH_EKORU,
SEARCH_GIBIRU,
SEARCH_GOOGLE,
SEARCH_ONESEARCH,
SEARCH_PRIVADO,
SEARCH_QWANT,
SEARCH_ENCRYPT,
SEARCH_TAILCAT,
SEARCH_OTHER
} from './ChooseDefaultSearchConstants';
import { Modal } from '../../../../shared-components';

const mapSearchToSetupNumber = {
Ghostery: 1,
Bing: 2,
Yahoo: 3,
Startpage: 4,
'DuckDuck Go': 6,
Ecosia: 7,
Ekoru: 8,
Gibiru: 9,
Google: 10,
OneSearch: 11,
Privado: 12,
Qwant: 13,
'Search Encrypt': 14,
Tailcat: 15,
};
class ChooseDefaultSearchView extends Component {
constructor(props) {
super(props);
@@ -79,7 +105,21 @@ class ChooseDefaultSearchView extends Component {
const { actions, history } = this.props;
const { setSetupStep, setDefaultSearch } = actions;

if (chosenSearch === SEARCH_OTHER && otherSearchSelected) {
if (otherSearchSelected &&
(
SEARCH_DUCKDUCK_GO ||
SEARCH_ECOSIA ||
SEARCH_EKORU ||
SEARCH_ECOSIA ||
SEARCH_GIBIRU ||
SEARCH_GOOGLE ||
SEARCH_ONESEARCH ||
SEARCH_PRIVADO ||
SEARCH_QWANT ||
SEARCH_ENCRYPT ||
SEARCH_TAILCAT
)
) {
chosenSearch = otherSearchSelected;
}

@@ -105,7 +145,11 @@ class ChooseDefaultSearchView extends Component {
// });

setDefaultSearch(chosenSearch);
setSetupStep({ setup_step: CHOOSE_PLAN, origin: ONBOARDING });
setSetupStep({
setup_step: CHOOSE_PLAN,
setup_number: mapSearchToSetupNumber[chosenSearch],
origin: ONBOARDING
});
history.push(`/${ONBOARDING}/${CHOOSE_PLAN}`);
}

@@ -151,16 +195,15 @@ class ChooseDefaultSearchView extends Component {

renderOtherOptionsList = () => {
const otherSearchOptions = [
'DuckDuck Go',
'Ecosia',
'Ekoru',
'Gibiru',
'Google',
'OneSearch',
'Privado',
'Qwant',
'Search Encrypt',
'Tailcat',
SEARCH_DUCKDUCK_GO,
SEARCH_ECOSIA,
SEARCH_EKORU,
SEARCH_GOOGLE,
SEARCH_ONESEARCH,
SEARCH_PRIVADO,
SEARCH_QWANT,
SEARCH_ENCRYPT,
SEARCH_TAILCAT,
];

return (
@@ -241,7 +284,7 @@ class ChooseDefaultSearchView extends Component {
{(searchBeingConsidered === SEARCH_OTHER) && (
<Fragment>
{
`${t('ghostery_dawn_onboarding_you_have_selected_an_alternate_serach_engine')} \n
`${t('ghostery_dawn_onboarding_you_have_selected_an_alternate_search_engine')} \n
${otherSearchSelected}`
}
</Fragment>
ProTip! Use n and p to navigate between commits in a pull request.