зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1597706 - Remove the What's new toolbar badge message r=k88hudson
Differential Revision: https://phabricator.services.mozilla.com/D53838 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
ecff1d58fe
Коммит
34a0324a3b
|
@ -14,8 +14,6 @@ ChromeUtils.defineModuleGetter(
|
|||
"resource://gre/modules/addons/AddonRepository.jsm"
|
||||
);
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const FIREFOX_VERSION = parseInt(Services.appinfo.version.match(/\d+/), 10);
|
||||
const ONE_MINUTE = 60 * 1000;
|
||||
const FX_MONITOR_CLIENT_ID = "802d56ef2a9af9fa";
|
||||
|
||||
const L10N = new Localization([
|
||||
|
@ -504,28 +502,6 @@ const ONBOARDING_MESSAGES = () => [
|
|||
},
|
||||
trigger: { id: "protectionsPanelOpen" },
|
||||
},
|
||||
{
|
||||
id: `WHATS_NEW_BADGE_${FIREFOX_VERSION}`,
|
||||
template: "toolbar_badge",
|
||||
content: {
|
||||
delay: 5 * ONE_MINUTE,
|
||||
target: "whats-new-menu-button",
|
||||
action: { id: "show-whatsnew-button" },
|
||||
badgeDescription: { string_id: "cfr-badge-reader-label-newfeature" },
|
||||
},
|
||||
priority: 1,
|
||||
trigger: { id: "toolbarBadgeUpdate" },
|
||||
frequency: {
|
||||
// Makes it so that we track impressions for this message while at the
|
||||
// same time it can have unlimited impressions
|
||||
lifetime: Infinity,
|
||||
},
|
||||
// Never saw this message or saw it in the past 4 days or more recent
|
||||
targeting: `isWhatsNewPanelEnabled &&
|
||||
(!messageImpressions['WHATS_NEW_BADGE_${FIREFOX_VERSION}'] ||
|
||||
(messageImpressions['WHATS_NEW_BADGE_${FIREFOX_VERSION}']|length >= 1 &&
|
||||
currentDate|date - messageImpressions['WHATS_NEW_BADGE_${FIREFOX_VERSION}'][0] <= 4 * 24 * 3600 * 1000))`,
|
||||
},
|
||||
];
|
||||
|
||||
const OnboardingMessageProvider = {
|
||||
|
|
|
@ -33,9 +33,28 @@ describe("ToolbarBadgeHub", () => {
|
|||
isBrowserPrivateStub = sandbox.stub();
|
||||
const onboardingMsgs = await OnboardingMessageProvider.getUntranslatedMessages();
|
||||
fxaMessage = onboardingMsgs.find(({ id }) => id === "FXA_ACCOUNTS_BADGE");
|
||||
whatsnewMessage = onboardingMsgs.find(({ id }) =>
|
||||
id.includes("WHATS_NEW_BADGE_")
|
||||
);
|
||||
whatsnewMessage = {
|
||||
id: `WHATS_NEW_BADGE_71`,
|
||||
template: "toolbar_badge",
|
||||
content: {
|
||||
delay: 1000,
|
||||
target: "whats-new-menu-button",
|
||||
action: { id: "show-whatsnew-button" },
|
||||
badgeDescription: { string_id: "cfr-badge-reader-label-newfeature" },
|
||||
},
|
||||
priority: 1,
|
||||
trigger: { id: "toolbarBadgeUpdate" },
|
||||
frequency: {
|
||||
// Makes it so that we track impressions for this message while at the
|
||||
// same time it can have unlimited impressions
|
||||
lifetime: Infinity,
|
||||
},
|
||||
// Never saw this message or saw it in the past 4 days or more recent
|
||||
targeting: `isWhatsNewPanelEnabled &&
|
||||
(!messageImpressions['WHATS_NEW_BADGE_71'] ||
|
||||
(messageImpressions['WHATS_NEW_BADGE_71']|length >= 1 &&
|
||||
currentDate|date - messageImpressions['WHATS_NEW_BADGE_71'][0] <= 4 * 24 * 3600 * 1000))`,
|
||||
};
|
||||
fakeElement = {
|
||||
classList: {
|
||||
add: sandbox.stub(),
|
||||
|
|
Загрузка…
Ссылка в новой задаче