Bug 1968947 - Dismiss personalized card if Inferred personalization is disabled from the customize menu a=dmeehan
Original Revision: https://phabricator.services.mozilla.com/D253215 Differential Revision: https://phabricator.services.mozilla.com/D253249
This commit is contained in:
committed by
dmeehan@mozilla.com
parent
e9b6bb7ea0
commit
b6ec1ebbe2
@@ -33,6 +33,8 @@ const PREF_LEADERBOARD_ENABLED = "newtabAdSize.leaderboard";
|
|||||||
const PREF_LEADERBOARD_POSITION = "newtabAdSize.leaderboard.position";
|
const PREF_LEADERBOARD_POSITION = "newtabAdSize.leaderboard.position";
|
||||||
const PREF_BILLBOARD_POSITION = "newtabAdSize.billboard.position";
|
const PREF_BILLBOARD_POSITION = "newtabAdSize.billboard.position";
|
||||||
const PREF_REFINED_CARDS_ENABLED = "discoverystream.refinedCardsLayout.enabled";
|
const PREF_REFINED_CARDS_ENABLED = "discoverystream.refinedCardsLayout.enabled";
|
||||||
|
const PREF_INFERRED_PERSONALIZATION_USER =
|
||||||
|
"discoverystream.sections.personalization.inferred.user.enabled";
|
||||||
|
|
||||||
function getLayoutData(responsiveLayouts, index, refinedCardsLayout) {
|
function getLayoutData(responsiveLayouts, index, refinedCardsLayout) {
|
||||||
let layoutData = {
|
let layoutData = {
|
||||||
@@ -458,7 +460,10 @@ function CardSections({
|
|||||||
|
|
||||||
function displayP13nCard() {
|
function displayP13nCard() {
|
||||||
if (messageData && Object.keys(messageData).length >= 1) {
|
if (messageData && Object.keys(messageData).length >= 1) {
|
||||||
if (messageData?.content?.messageType === "PersonalizedCard") {
|
if (
|
||||||
|
messageData?.content?.messageType === "PersonalizedCard" &&
|
||||||
|
prefs[PREF_INFERRED_PERSONALIZATION_USER]
|
||||||
|
) {
|
||||||
const row = messageData.content.position;
|
const row = messageData.content.position;
|
||||||
sectionsToRender.splice(
|
sectionsToRender.splice(
|
||||||
row,
|
row,
|
||||||
|
|||||||
@@ -11270,6 +11270,7 @@ const CardSections_PREF_LEADERBOARD_ENABLED = "newtabAdSize.leaderboard";
|
|||||||
const CardSections_PREF_LEADERBOARD_POSITION = "newtabAdSize.leaderboard.position";
|
const CardSections_PREF_LEADERBOARD_POSITION = "newtabAdSize.leaderboard.position";
|
||||||
const CardSections_PREF_BILLBOARD_POSITION = "newtabAdSize.billboard.position";
|
const CardSections_PREF_BILLBOARD_POSITION = "newtabAdSize.billboard.position";
|
||||||
const PREF_REFINED_CARDS_ENABLED = "discoverystream.refinedCardsLayout.enabled";
|
const PREF_REFINED_CARDS_ENABLED = "discoverystream.refinedCardsLayout.enabled";
|
||||||
|
const PREF_INFERRED_PERSONALIZATION_USER = "discoverystream.sections.personalization.inferred.user.enabled";
|
||||||
function getLayoutData(responsiveLayouts, index, refinedCardsLayout) {
|
function getLayoutData(responsiveLayouts, index, refinedCardsLayout) {
|
||||||
let layoutData = {
|
let layoutData = {
|
||||||
classNames: [],
|
classNames: [],
|
||||||
@@ -11627,7 +11628,7 @@ function CardSections({
|
|||||||
}
|
}
|
||||||
function displayP13nCard() {
|
function displayP13nCard() {
|
||||||
if (messageData && Object.keys(messageData).length >= 1) {
|
if (messageData && Object.keys(messageData).length >= 1) {
|
||||||
if (messageData?.content?.messageType === "PersonalizedCard") {
|
if (messageData?.content?.messageType === "PersonalizedCard" && prefs[PREF_INFERRED_PERSONALIZATION_USER]) {
|
||||||
const row = messageData.content.position;
|
const row = messageData.content.position;
|
||||||
sectionsToRender.splice(row, 0, /*#__PURE__*/external_React_default().createElement(MessageWrapper, {
|
sectionsToRender.splice(row, 0, /*#__PURE__*/external_React_default().createElement(MessageWrapper, {
|
||||||
dispatch: dispatch,
|
dispatch: dispatch,
|
||||||
@@ -14300,7 +14301,7 @@ const Base_VISIBILITY_CHANGE_EVENT = "visibilitychange";
|
|||||||
const Base_PREF_THUMBS_UP_DOWN_ENABLED = "discoverystream.thumbsUpDown.enabled";
|
const Base_PREF_THUMBS_UP_DOWN_ENABLED = "discoverystream.thumbsUpDown.enabled";
|
||||||
const PREF_THUMBS_UP_DOWN_LAYOUT_ENABLED = "discoverystream.thumbsUpDown.searchTopsitesCompact";
|
const PREF_THUMBS_UP_DOWN_LAYOUT_ENABLED = "discoverystream.thumbsUpDown.searchTopsitesCompact";
|
||||||
const PREF_INFERRED_PERSONALIZATION_SYSTEM = "discoverystream.sections.personalization.inferred.enabled";
|
const PREF_INFERRED_PERSONALIZATION_SYSTEM = "discoverystream.sections.personalization.inferred.enabled";
|
||||||
const PREF_INFERRED_PERSONALIZATION_USER = "discoverystream.sections.personalization.inferred.user.enabled";
|
const Base_PREF_INFERRED_PERSONALIZATION_USER = "discoverystream.sections.personalization.inferred.user.enabled";
|
||||||
const PrefsButton = ({
|
const PrefsButton = ({
|
||||||
onClick,
|
onClick,
|
||||||
icon
|
icon
|
||||||
@@ -14814,7 +14815,7 @@ class BaseContent extends (external_React_default()).PureComponent {
|
|||||||
const enabledSections = {
|
const enabledSections = {
|
||||||
topSitesEnabled: prefs["feeds.topsites"],
|
topSitesEnabled: prefs["feeds.topsites"],
|
||||||
pocketEnabled: prefs["feeds.section.topstories"],
|
pocketEnabled: prefs["feeds.section.topstories"],
|
||||||
showInferredPersonalizationEnabled: prefs[PREF_INFERRED_PERSONALIZATION_USER],
|
showInferredPersonalizationEnabled: prefs[Base_PREF_INFERRED_PERSONALIZATION_USER],
|
||||||
showRecentSavesEnabled: prefs.showRecentSaves,
|
showRecentSavesEnabled: prefs.showRecentSaves,
|
||||||
topSitesRowsCount: prefs.topSitesRows,
|
topSitesRowsCount: prefs.topSitesRows,
|
||||||
weatherEnabled: prefs.showWeather
|
weatherEnabled: prefs.showWeather
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ module.exports = function (config) {
|
|||||||
statements: 84.43,
|
statements: 84.43,
|
||||||
lines: 83.9,
|
lines: 83.9,
|
||||||
functions: 79.31,
|
functions: 79.31,
|
||||||
branches: 53.62,
|
branches: 53.42,
|
||||||
},
|
},
|
||||||
"content-src/components/DiscoveryStreamComponents/SectionContextMenu/SectionContextMenu.jsx":
|
"content-src/components/DiscoveryStreamComponents/SectionContextMenu/SectionContextMenu.jsx":
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user