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

Prev

Add list of possible search engines, minus SEARCH_ENCRYPT and update …

…dawn_setup_numbers
  • Loading branch information
benstrumeyer committed Jan 29, 2021
commit 9ecaf06a7f845382b5a0765eddf5a9204808bf0a
@@ -15,15 +15,15 @@ export const SET_DEFAULT_SEARCH = 'SET_DEFAULT_SEARCH';
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_STARTPAGE = 'StartPage';
export const SEARCH_DUCKDUCK_GO = 'DuckDuckGo';
export const SEARCH_ECOSIA = 'Ecosia Search';
export const SEARCH_EKORU = 'ekoru';
export const SEARCH_GIBIRU = 'Gibiru.com';
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_ENCRYPT = 'TODO: Add Search Encrypt browser.search.get() string';
export const SEARCH_TAILCAT = 'Tailcat';
export const SEARCH_OTHER = t('ghostery_dawn_onboarding_other');
@@ -21,26 +21,36 @@ import {
SEARCH_BING,
SEARCH_YAHOO,
SEARCH_STARTPAGE,
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,
};
const searchSetupNumbers = [
{ name: SEARCH_GHOSTERY, dawn_setup_number: 1 },
{ name: SEARCH_BING, dawn_setup_number: 2 },
{ name: SEARCH_YAHOO, dawn_setup_number: 3 },
{ name: SEARCH_STARTPAGE, dawn_setup_number: 4 },
{ name: SEARCH_GOOGLE, dawn_setup_number: 5 },
{ name: SEARCH_DUCKDUCK_GO, dawn_setup_number: 6 },
{ name: SEARCH_ECOSIA, dawn_setup_number: 7 },
{ name: SEARCH_EKORU, dawn_setup_number: 8 },
{ name: SEARCH_GIBIRU, dawn_setup_number: 9 },
{ name: SEARCH_ONESEARCH, dawn_setup_number: 10 },
{ name: SEARCH_PRIVADO, dawn_setup_number: 11 },
{ name: SEARCH_QWANT, dawn_setup_number: 12 },
{ name: SEARCH_ENCRYPT, dawn_setup_number: 13 },
{ name: SEARCH_TAILCAT, dawn_setup_number: 14 },
];

class ChooseDefaultSearchView extends Component {
constructor(props) {
@@ -146,9 +156,10 @@ class ChooseDefaultSearchView extends Component {
}

setDefaultSearch(chosenSearchName);

setSetupStep({
setup_step: CHOOSE_PLAN,
dawn_setup_number: mapSearchToSetupNumber[chosenSearchName],
dawn_setup_number: searchSetupNumbers.find(elem => elem.name === chosenSearchName).dawn_setup_number,
origin: ONBOARDING
});
history.push(`/${ONBOARDING}/${CHOOSE_PLAN}`);
@@ -166,7 +166,8 @@ class ChoosePlanView extends React.Component {
};

setSetupStepAndMoveToSuccessView = (dawn_setup_number) => {
const { setSetupStep, history } = this.props;
const { actions, history } = this.props;
const { setSetupStep } = actions;
setSetupStep({ setup_step: CHOOSE_PLAN, dawn_setup_number, origin: ONBOARDING });
history.push('/onboarding/5');
}
ProTip! Use n and p to navigate between commits in a pull request.