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

(8.5.4) GH-2166: Update name of Unknown category #613

Merged
merged 9 commits into from Oct 27, 2020
@@ -1507,7 +1507,7 @@
"message": "Choose which trackers to block"
},
"hub_setup_antisuite_description_antitracking": {
"message": "Anonymize unblocked and unknown trackers for greater browsing protection."
"message": "Anonymize unblocked and unidentified trackers for greater browsing protection."
},
"hub_setup_feature_already_active": {
"message": "This feature is already active in Cliqz by default. $LINK_LM_START$Learn More$LINK_LM_END$",
@@ -2324,11 +2324,11 @@
"OFFERS_ENDS": {
"message": ""
},
"unknown": {
"message": "Unknown"
"unidentified": {
"message": "Unidentified"
},
"unknown_description": {
"message": "Unknown trackers scrubbed by Anti-Tracking"
"unidentified_description": {
"message": "Unidentified trackers scrubbed by Anti-Tracking"
},
"ghostery_is_ready": {
"message": "Ghostery is Ready!"
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25"><g fill="none" transform="translate(1 1)"><circle cx="11.865" cy="11.865" r="11.865" fill="#8459A5" stroke="#86449B" stroke-width=".5"/><path fill="#86449B" d="M17.152 6.847a1.994 1.994 0 0 0-1.462-.607h-6.9c-.57 0-1.058.203-1.463.607A1.995 1.995 0 0 0 6.72 8.31v6.9c0 .57.203 1.058.607 1.463.405.404.893.607 1.463.607h6.9c.57 0 1.058-.203 1.462-.607.405-.405.608-.893.608-1.463v-6.9c0-.57-.203-1.058-.608-1.463zm-5.86 5.991a1.469 1.469 0 0 1-1.079.446 1.469 1.469 0 0 1-1.078-.446 1.469 1.469 0 0 1-.446-1.078c0-.422.15-.781.446-1.078a1.469 1.469 0 0 1 1.078-.446c.422 0 .78.149 1.078.446.291.282.453.672.446 1.078.007.406-.155.796-.446 1.078zm4.053 0a1.468 1.468 0 0 1-1.078.446 1.469 1.469 0 0 1-1.079-.446 1.469 1.469 0 0 1-.445-1.078c0-.422.149-.781.445-1.078a1.469 1.469 0 0 1 1.079-.446c.421 0 .781.149 1.078.446.29.282.452.672.446 1.078.006.406-.155.796-.446 1.078z"/><path fill="#F5A623" d="M16.672 6.367a1.994 1.994 0 0 0-1.462-.607h-6.9c-.57 0-1.058.203-1.463.607A1.995 1.995 0 0 0 6.24 7.83v6.9c0 .57.203 1.058.607 1.463.405.404.893.607 1.463.607h6.9c.57 0 1.058-.203 1.462-.607.405-.405.608-.893.608-1.463v-6.9c0-.57-.203-1.058-.608-1.463zm-5.86 5.991a1.469 1.469 0 0 1-1.079.446 1.469 1.469 0 0 1-1.078-.446 1.469 1.469 0 0 1-.446-1.078c0-.422.15-.781.446-1.078a1.469 1.469 0 0 1 1.078-.446c.422 0 .78.149 1.078.446.291.282.453.672.446 1.078.007.406-.155.796-.446 1.078zm4.053 0a1.468 1.468 0 0 1-1.078.446 1.469 1.469 0 0 1-1.079-.446 1.469 1.469 0 0 1-.445-1.078c0-.422.149-.781.445-1.078a1.469 1.469 0 0 1 1.079-.446c.421 0 .781.149 1.078.446.29.282.452.672.446 1.078.006.406-.155.796-.446 1.078z"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25"><g fill="none" transform="translate(1 1)"><circle cx="11.865" cy="11.865" r="11.865" fill="#8459A5" stroke="#86449B" stroke-width=".5"/><path fill="#86449B" d="M17.152 6.847a1.994 1.994 0 0 0-1.462-.607h-6.9c-.57 0-1.058.203-1.463.607A1.995 1.995 0 0 0 6.72 8.31v6.9c0 .57.203 1.058.607 1.463.405.404.893.607 1.463.607h6.9c.57 0 1.058-.203 1.462-.607.405-.405.608-.893.608-1.463v-6.9c0-.57-.203-1.058-.608-1.463zm-5.86 5.991a1.469 1.469 0 0 1-1.079.446 1.469 1.469 0 0 1-1.078-.446 1.469 1.469 0 0 1-.446-1.078c0-.422.15-.781.446-1.078a1.469 1.469 0 0 1 1.078-.446c.422 0 .78.149 1.078.446.291.282.453.672.446 1.078.007.406-.155.796-.446 1.078zm4.053 0a1.468 1.468 0 0 1-1.078.446 1.469 1.469 0 0 1-1.079-.446 1.469 1.469 0 0 1-.445-1.078c0-.422.149-.781.445-1.078a1.469 1.469 0 0 1 1.079-.446c.421 0 .781.149 1.078.446.29.282.452.672.446 1.078.006.406-.155.796-.446 1.078z"/><path fill="#F5A623" d="M16.672 6.367a1.994 1.994 0 0 0-1.462-.607h-6.9c-.57 0-1.058.203-1.463.607A1.995 1.995 0 0 0 6.24 7.83v6.9c0 .57.203 1.058.607 1.463.405.404.893.607 1.463.607h6.9c.57 0 1.058-.203 1.462-.607.405-.405.608-.893.608-1.463v-6.9c0-.57-.203-1.058-.608-1.463zm-5.86 5.991a1.469 1.469 0 0 1-1.079.446 1.469 1.469 0 0 1-1.078-.446 1.469 1.469 0 0 1-.446-1.078c0-.422.15-.781.446-1.078a1.469 1.469 0 0 1 1.078-.446c.422 0 .78.149 1.078.446.291.282.453.672.446 1.078.007.406-.155.796-.446 1.078zm4.053 0a1.468 1.468 0 0 1-1.078.446 1.469 1.469 0 0 1-1.079-.446 1.469 1.469 0 0 1-.445-1.078c0-.422.149-.781.445-1.078a1.469 1.469 0 0 1 1.079-.446c.421 0 .781.149 1.078.446.29.282.452.672.446 1.078.006.406-.155.796-.446 1.078z"/></g></svg>
@@ -73,17 +73,17 @@ export function anonymizeSiteTracker({ actionData, state }) {
const updatedcliqzModuleData = JSON.parse(JSON.stringify(state.cliqzModuleData));
const { antiTracking, adBlock } = state.cliqzModuleData;
const whitelistedUrls = { ...antiTracking.whitelistedUrls, ...adBlock.whitelistedUrls };
const { unknownTracker } = actionData;
const { unidentifiedTracker } = actionData;
const { pageHost } = state.summary;

const addToWhitelist = () => {
unknownTracker.sources.forEach((domain) => {
unidentifiedTracker.sources.forEach((domain) => {
if (whitelistedUrls.hasOwnProperty(domain)) {
whitelistedUrls[domain].name = unknownTracker.name;
whitelistedUrls[domain].name = unidentifiedTracker.name;
whitelistedUrls[domain].hosts.push(pageHost);
} else {
whitelistedUrls[domain] = {
name: unknownTracker.name,
name: unidentifiedTracker.name,
hosts: [pageHost],
};
}
@@ -102,11 +102,11 @@ export function anonymizeSiteTracker({ actionData, state }) {
}
};

if (unknownTracker.whitelisted) {
unknownTracker.sources.forEach(removeFromWhitelist);
if (unidentifiedTracker.whitelisted) {
unidentifiedTracker.sources.forEach(removeFromWhitelist);

Object.keys(whitelistedUrls).forEach((domain) => {
if (whitelistedUrls[domain].name === unknownTracker.name) {
if (whitelistedUrls[domain].name === unidentifiedTracker.name) {
removeFromWhitelist(domain);
}
});
@@ -115,14 +115,14 @@ export function anonymizeSiteTracker({ actionData, state }) {
}

// Update Ad Blocking trackers
updatedcliqzModuleData.adBlock.unknownTrackers.forEach((trackerEl) => {
if (trackerEl.name === unknownTracker.name) {
updatedcliqzModuleData.adBlock.unidentifiedTrackers.forEach((trackerEl) => {
if (trackerEl.name === unidentifiedTracker.name) {
trackerEl.whitelisted = !trackerEl.whitelisted;
}
});
// Update Anti-Tracking trackers
updatedcliqzModuleData.antiTracking.unknownTrackers.forEach((trackerEl) => {
if (trackerEl.name === unknownTracker.name) {
updatedcliqzModuleData.antiTracking.unidentifiedTrackers.forEach((trackerEl) => {
if (trackerEl.name === unidentifiedTracker.name) {
trackerEl.whitelisted = !trackerEl.whitelisted;
}
});
@@ -54,8 +54,8 @@ class PanelAndroid extends React.Component {
categories: [],
},
cliqzModuleData: {
adBlock: { trackerCount: 0, unknownTrackers: [] },
antiTracking: { trackerCount: 0, unknownTrackers: [] },
adBlock: { trackerCount: 0, unidentifiedTrackers: [] },
antiTracking: { trackerCount: 0, unidentifiedTrackers: [] },
},
};
}
@@ -207,9 +207,9 @@ class PanelAndroid extends React.Component {
const { categories, toggle_individual_trackers } = blocking;
const { adBlock, antiTracking } = cliqzModuleData;

const unknownTrackers = Array.from(new Set([
...antiTracking.unknownTrackers.map(this.massageCliqzTrackers),
...adBlock.unknownTrackers.map(this.massageCliqzTrackers),
const unidentifiedTrackers = Array.from(new Set([
...antiTracking.unidentifiedTrackers.map(this.massageCliqzTrackers),
...adBlock.unidentifiedTrackers.map(this.massageCliqzTrackers),
])).sort((a, b) => {
const nameA = a.name.toLowerCase();
const nameB = b.name.toLowerCase();
@@ -221,14 +221,14 @@ class PanelAndroid extends React.Component {
}
return 0;
});
const unknownCategory = {
id: 'unknown',
name: t('unknown'),
description: t('unknown_description'),
img_name: 'unknown',
num_total: unknownTrackers.length,
const unidentifiedCategory = {
id: 'unidentified',
name: t('unidentified'),
description: t('unidentified_description'),
img_name: 'unidentified',
num_total: unidentifiedTrackers.length,
num_blocked: 0, // We don't want to see the Trackers Blocked text
trackers: unknownTrackers,
trackers: unidentifiedTrackers,
};

return (
@@ -248,7 +248,7 @@ class PanelAndroid extends React.Component {
<Tab tabLabel={t('android_tab_site_blocking')} linkClassName="Tab__label">
<BlockingTab
type="site"
categories={unknownTrackers.length === 0 ? categories : [...categories, unknownCategory]}
categories={unidentifiedTrackers.length === 0 ? categories : [...categories, unidentifiedCategory]}
settings={{ toggle_individual_trackers }}
siteProps={this.siteProps}
callGlobalAction={this.callGlobalAction}
@@ -51,8 +51,8 @@ class BlockingCategory extends React.Component {
return 'restricted';
}

if (category.id === 'unknown') {
return 'unknown';
if (category.id === 'unidentified') {
return 'unidentified';
}

if (trackers.every(tracker => tracker.ss_allowed)) {
@@ -136,8 +136,8 @@ class BlockingCategory extends React.Component {

renderCategorySelect() {
const categorySelect = this.categorySelectStatus;
// Hide category blocking for Unknown trackers
if (categorySelect === 'unknown') {
// Hide category blocking for Unidentified trackers
if (categorySelect === 'unidentified') {
return false;
}
const categorySelectClassNames = ClassNames('BlockingSelectButton', {
@@ -212,7 +212,7 @@ class BlockingCategory extends React.Component {
const categoryImage = `/app/images/panel-android/categories/${img_name}.svg`;

const categoryClassNames = ClassNames('BlockingCategory', {
BlockingCategory__unknown: id === 'unknown',
BlockingCategory__unidentified: id === 'unidentified',
});

return (
@@ -238,7 +238,7 @@ class BlockingCategory extends React.Component {
<div>
<div className="BlockingCategory__listHeader flex-container align-bottom" style={{ height: this.heightListHeader }}>
<span className="BlockingCategory--uppercase flex-child-grow">{t('blocking_category_trackers')}</span>
<span>{category.id === 'unknown' ? t('android_anonymized') : t('blocking_category_blocked')}</span>
<span>{category.id === 'unidentified' ? t('android_anonymized') : t('blocking_category_blocked')}</span>
</div>
<List
height={this.getListHeight(num_total)}
@@ -177,7 +177,7 @@ class BlockingTracker extends React.Component {
callGlobalAction({
actionName: 'anonymizeSiteTracker',
actionData: {
unknownTracker: tracker,
unidentifiedTracker: tracker,
}
});
}
@@ -226,10 +226,10 @@ class BlockingTracker extends React.Component {
);
}

renderUnknownTrackerStatus() {
renderUnidentifiedTrackerStatus() {
const { siteProps, tracker } = this.props;
const trackerSelect = this.trackerSelectStatus;
const svgContainerClasses = ClassNames('UnknownSVGContainer', {
const svgContainerClasses = ClassNames('UnidentifiedSVGContainer', {
whitelisted: tracker.whitelisted && !siteProps.isRestricted,
siteRestricted: siteProps.isRestricted,
});
@@ -335,7 +335,7 @@ class BlockingTracker extends React.Component {
);
}

renderUnknownOverflow() {
renderUnidentifiedOverflow() {
const {
open,
tracker,
@@ -360,7 +360,7 @@ class BlockingTracker extends React.Component {
renderTrackerOverflow() {
const trackerSelect = this.trackerSelectStatus;
if (trackerSelect === 'antiTracking' || trackerSelect === 'adBlock') {
return this.renderUnknownOverflow();
return this.renderUnidentifiedOverflow();
}
if (trackerSelect === 'override-sb') {
return this.renderSmartBlockOverflow();
@@ -383,7 +383,7 @@ class BlockingTracker extends React.Component {
<div>{name}</div>
{this.renderTrackerModified()}
</div>
{(trackerSelect === 'antiTracking' || trackerSelect === 'adBlock') ? this.renderUnknownTrackerStatus() : this.renderTrackerStatus()}
{(trackerSelect === 'antiTracking' || trackerSelect === 'adBlock') ? this.renderUnidentifiedTrackerStatus() : this.renderTrackerStatus()}
{this.renderTrackerOverflow()}
</div>
);
@@ -15,7 +15,7 @@ import {
UPDATE_BLOCKING_DATA,
UPDATE_BLOCK_ALL_TRACKERS,
UPDATE_CATEGORIES,
UPDATE_UNKNOWN_CATEGORY_HIDE,
UPDATE_UNIDENTIFIED_CATEGORY_HIDE,
UPDATE_CATEGORY_BLOCKED,
UPDATE_TRACKER_BLOCKED,
UPDATE_TRACKER_TRUST_RESTRICT,
@@ -64,9 +64,9 @@ export function updateCategories(data) {
* @param {Object} data
* @return {Object}
*/
export function updateUnknownCategoryHide(data) {
export function updateUnidentifiedCategoryHide(data) {
return {
type: UPDATE_UNKNOWN_CATEGORY_HIDE,
type: UPDATE_UNIDENTIFIED_CATEGORY_HIDE,
data,
};
}
@@ -123,13 +123,13 @@ export function updateTrackerTrustRestrict(data) {
* @param {Object} data
* @return {Object} dispatch
*/
export function updateCliqzModuleWhitelist(unknownTracker) {
export function updateCliqzModuleWhitelist(unidentifiedTracker) {
return function(dispatch, getState) {
// use redux-thunk to get pageHost from summary
const { pageHost } = getState().summary;
dispatch({
type: UPDATE_CLIQZ_MODULE_WHITELIST,
data: { unknownTracker, pageHost },
data: { unidentifiedTracker, pageHost },
});
};
}
@@ -120,9 +120,9 @@ class Blocking extends React.Component {
* @param {string} filterName
*/
setShow(filterName) {
const { actions, categories, unknownCategory } = this.props;
const { actions, categories, unidentifiedCategory } = this.props;
const updated_categories = JSON.parse(JSON.stringify(categories)); // deep clone
const updatedUnknownCategory = JSON.parse(JSON.stringify(unknownCategory)); // deep clone
const updatedUnidentifiedCategory = JSON.parse(JSON.stringify(unidentifiedCategory)); // deep clone

updated_categories.forEach((categoryEl) => {
let count = 0;
@@ -141,9 +141,9 @@ class Blocking extends React.Component {
categoryEl.num_shown = (show) ? count : 0;
});

updatedUnknownCategory.hide = !(filterName === 'all' || filterName === 'unknown');
updatedUnidentifiedCategory.hide = !(filterName === 'all' || filterName === 'unidentified');
actions.updateCategories(updated_categories);
actions.updateUnknownCategoryHide(updatedUnknownCategory);
actions.updateUnidentifiedCategoryHide(updatedUnidentifiedCategory);
}

/**
@@ -316,7 +316,7 @@ class Blocking extends React.Component {
const {
actions,
categories,
unknownCategory,
unidentifiedCategory,
enable_anti_tracking,
expand_all_trackers,
is_expanded,
@@ -349,7 +349,7 @@ class Blocking extends React.Component {
<NotScanned />
) : (
<div className={`${blockingClasses} blocking-trackers show-warnings`}>
{(categories.length > 0 || unknownCategory.unknownTrackers.length > 0) && (
{(categories.length > 0 || unidentifiedCategory.unidentifiedTrackers.length > 0) && (
<Categories
expandAll={expand_all_trackers}
categories={categories}
@@ -360,7 +360,7 @@ class Blocking extends React.Component {
language={language}
smartBlockActive={smartBlockActive}
smartBlock={smartBlock}
unknownCategory={unknownCategory}
unidentifiedCategory={unidentifiedCategory}
enable_anti_tracking={enable_anti_tracking}
/>
)}
ProTip! Use n and p to navigate between commits in a pull request.