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

GH-2247: Add dropdown list of search options #667

Merged
merged 2 commits into from Jan 27, 2021
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Prev

Merge branch 'ghostery-browser-intro-hub' into GH-2247/search-options…

…-dropdown
  • Loading branch information
leuryr committed Jan 26, 2021
commit c23d67cf8486ade9920592bf667c5f6448bf8c5c
@@ -160,24 +160,9 @@ class BlockSettingsView extends Component {
</div>
</div>
</li>
<div className="BlockSettingsView_answerBlock">
<div className="BlockSettingsView__radioButtonContainer">
<RadioButton checked={kindsOfTrackers === 0} handleClick={() => this.handleAnswerChange('kindsOfTrackers', 0)} altDesign />
</div>
<div className="BlockSettingsView_answerText">{t('ghostery_dawn_onboarding_kinds_of_trackers_all')}</div>
</div>
<div className="BlockSettingsView_answerBlock">
<div className="BlockSettingsView__radioButtonContainer">
<RadioButton checked={kindsOfTrackers === 1} handleClick={() => this.handleAnswerChange('kindsOfTrackers', 1)} altDesign />
</div>
<div className="BlockSettingsView_answerText">{t('ghostery_dawn_onboarding_kinds_of_trackers_ad_and_analytics')}</div>
</div>
<div className="BlockSettingsView_answerBlock">
<div className="BlockSettingsView__radioButtonContainer">
<RadioButton checked={kindsOfTrackers === 2} handleClick={() => this.handleAnswerChange('kindsOfTrackers', 2)} altDesign />
</div>
<div className="BlockSettingsView_answerText">{t('ghostery_dawn_onboarding_kinds_of_trackers_none')}</div>
</div>
{this.renderAnswerBlock((kindsOfTrackers === 0), 'kindsOfTrackers', 0, t('ghostery_dawn_onboarding_kinds_of_trackers_all'))}
{this.renderAnswerBlock((kindsOfTrackers === 1), 'kindsOfTrackers', 1, t('ghostery_dawn_onboarding_kinds_of_trackers_ad_and_analytics'))}
{this.renderAnswerBlock((kindsOfTrackers === 2), 'kindsOfTrackers', 2, t('ghostery_dawn_onboarding_kinds_of_trackers_none'))}
<li className="BlockSettingsView_question">
<div className="BlockSettingsView_questionBlock">
{t('ghostery_dawn_onboarding_question_anti_tracking')}
@@ -186,18 +171,8 @@ class BlockSettingsView extends Component {
</div>
</div>
</li>
<div className="BlockSettingsView_answerBlock">
<div className="BlockSettingsView__radioButtonContainer">
<RadioButton checked={antiTracking === true} handleClick={() => this.handleAnswerChange('antiTracking', true)} altDesign />
</div>
<div className="BlockSettingsView_answerText">{t('hub_setup_modal_button_yes')}</div>
</div>
<div className="BlockSettingsView_answerBlock">
<div className="BlockSettingsView__radioButtonContainer">
<RadioButton checked={antiTracking === false} handleClick={() => this.handleAnswerChange('antiTracking', false)} altDesign />
</div>
<div className="BlockSettingsView_answerText">{t('hub_setup_modal_button_no')}</div>
</div>
{this.renderAnswerBlock((antiTracking === true), 'antiTracking', true, t('hub_setup_modal_button_yes'))}
{this.renderAnswerBlock((antiTracking === false), 'antiTracking', false, t('hub_setup_modal_button_no'))}
<li className="BlockSettingsView_question">
<div className="BlockSettingsView_questionBlock">
{t('ghostery_dawn_onboarding_question_smart_browsing')}
@@ -206,18 +181,8 @@ class BlockSettingsView extends Component {
</div>
</div>
</li>
<div className="BlockSettingsView_answerBlock">
<div className="BlockSettingsView__radioButtonContainer">
<RadioButton checked={smartBrowsing === true} handleClick={() => this.handleAnswerChange('smartBrowsing', true)} altDesign />
</div>
<div className="BlockSettingsView_answerText">{t('hub_setup_modal_button_yes')}</div>
</div>
<div className="BlockSettingsView_answerBlock">
<div className="BlockSettingsView__radioButtonContainer">
<RadioButton checked={smartBrowsing === false} handleClick={() => this.handleAnswerChange('smartBrowsing', false)} altDesign />
</div>
<div className="BlockSettingsView_answerText">{t('hub_setup_modal_button_no')}</div>
</div>
{this.renderAnswerBlock((smartBrowsing === true), 'smartBrowsing', true, t('hub_setup_modal_button_yes'))}
{this.renderAnswerBlock((smartBrowsing === false), 'smartBrowsing', false, t('hub_setup_modal_button_no'))}
</ol>
</div>
<button
@@ -83,14 +83,19 @@ class ChooseDefaultSearchView extends Component {
chosenSearch = otherSearchSelected;
}

// TODO comment this IN for builds for Dawn
// commented out for testing purposes, as trying to message search@ghostery.com
// outside of Dawn causes an error
// const payload = {
// type: 'setDefaultSearch',
// search: chosenSearch,
// };
// chrome.runtime.sendMessage('search@ghostery.com', payload, () => {});
const payload = {
type: 'setDefaultSearch',
search: chosenSearch,
};

// The try/catch wrapper facilitates testing in non-Dawn browsers which have no search@ghostery.com extension
try {
chrome.runtime.sendMessage('search@ghostery.com', payload, () => {
});
} catch (error) {
console.log('Ilya sez: If you are seeing the following error in Dawn, please report it as a bug. Outside of Dawn, it is expected.');
console.error(error);
}

// chrome.runtime.sendMessage('search@ghostery.com', payload, () => {
// // TODO handle errors if needed
You are viewing a condensed version of this merge commit. You can view the full changes here.
ProTip! Use n and p to navigate between commits in a pull request.