diff --git a/.eslintrc-rollouts.js b/.eslintrc-rollouts.js index ebf10f3215c3..e949e9c558ca 100644 --- a/.eslintrc-rollouts.js +++ b/.eslintrc-rollouts.js @@ -58,7 +58,6 @@ const rollouts = [ "browser/components/enterprisepolicies/**", "browser/components/firefoxview/**", "browser/components/migration/**", - "browser/components/newtab/lib/ASRouterPreferences.sys.mjs", "browser/components/protocolhandler/WebProtocolHandlerRegistrar.sys.mjs", "browser/components/shell/ShellService.sys.mjs", "browser/components/syncedtabs/TabListComponent.sys.mjs", diff --git a/browser/components/asrouter/tests/NimbusRolloutMessageProvider.sys.mjs b/browser/components/asrouter/tests/NimbusRolloutMessageProvider.sys.mjs index f2c94f7de603..2588f1fcb075 100644 --- a/browser/components/asrouter/tests/NimbusRolloutMessageProvider.sys.mjs +++ b/browser/components/asrouter/tests/NimbusRolloutMessageProvider.sys.mjs @@ -11,6 +11,84 @@ export const NimbusRolloutMessageProvider = { getMessages() { return [ + { + // Nimbus slug: recommend-add-ons-staff-pick-relaunch-treatment-a-rollout:treatment-a + // Version range: 123+ + // Recipe: https://experimenter.services.mozilla.com/nimbus/recommend-add-ons-staff-pick-relaunch-treatment-a-rollout/summary#treatment-a + id: "ADDONS_STAFF_PICK", + groups: ["cfr"], + content: { + id: "ADDONS_STAFF_PICK", + screens: [ + { + id: "ADDONS_STAFF_PICK_A", + anchors: [ + { + selector: "#unified-extensions-button", + arrow_width: "26.9", + panel_position: { + anchor_attachment: "bottomcenter", + callout_attachment: "topright", + }, + }, + ], + content: { + title: { + raw: "Give your browsing a boost", + marginInline: "0 48px", + }, + width: "310px", + padding: 16, + position: "callout", + subtitle: { + raw: "Make browsing faster, safer, or just plain fun with Firefox add-ons. See what our staff recommends!", + paddingInline: "34px 0", + }, + title_logo: { + width: "24px", + height: "24px", + imageURL: + "https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/173414e1-81f7-4612-b868-e78df0557011.svg", + marginInline: "4px 14px", + }, + dismiss_button: { + size: "small", + action: { + dismiss: true, + }, + marginBlock: "14px 0", + marginInline: "0 14px", + }, + primary_button: { + label: { + raw: "Explore add-ons", + }, + action: { + data: { + args: "https://addons.mozilla.org/en-US/firefox/collections/4757633/25c2b44583534b3fa8fea977c419cd/?page=1&collection_sort=-added", + where: "tabshifted", + }, + type: "OPEN_URL", + dismiss: true, + }, + }, + }, + }, + ], + backdrop: "transparent", + template: "multistage", + transitions: false, + }, + trigger: { + id: "defaultBrowserCheck", + }, + template: "feature_callout", + frequency: { + lifetime: 1, + }, + targeting: + "!screenImpressions.AW_AMO_INTRODUCE && !willShowDefaultPrompt && !activeNotifications && source == 'newtab' && !isFirstStartup", + }, { // Nimbus slug: device-migration-q4-spotlights-remaining-population-esr:treatment (message 1 of 3) // Recipe: https://experimenter.services.mozilla.com/nimbus/device-migration-q4-spotlights-remaining-population-esr/summary#treatment @@ -432,189 +510,6 @@ export const NimbusRolloutMessageProvider = { targeting: "source == 'startup' && !willShowDefaultPrompt && 'browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features'|preferenceValue && !usesFirefoxSync && !hasActiveEnterprisePolicies && userMonthlyActivity[userMonthlyActivity|length - 2][1]|date >= currentDate|date - (28 * 24 * 60 * 60 * 1000) && !(((currentDate|date - profileAgeCreated|date) / 86400000 >= 168) || totalBookmarksCount >= 35) && !(os.isWindows && os.windowsVersion >= 6.1 && os.windowsBuildNumber < 22000)", }, - { - // Nimbus slug: fox-doodle-set-to-default-early-day-user-de-fr-it-treatment-a-rollout:treatment-a - // Version range: 116+ - // Recipe: https://experimenter.services.mozilla.com/nimbus/fox-doodle-set-to-default-early-day-user-de-fr-it-treatment-a-rollout/summary#treatment-a - id: "fox-doodle-set-to-default-early-day-user-de-fr-it:A", - groups: ["eco"], - content: { - id: "fox-doodle-set-to-default-early-day-user-de-fr-it:A", - screens: [ - { - id: "SET_DEFAULT", - content: { - logo: { - height: "140px", - imageURL: - "https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/05f5265b-d1e4-4fe1-9a46-0ea36f8afced.png", - reducedMotionImageURL: - "https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/05f5265b-d1e4-4fe1-9a46-0ea36f8afced.png", - }, - title: { - raw: { - $l10n: { - id: "fox-doodle-trackers-title", - text: "Keep pesky trackers off your tail", - comment: - "This title is displayed together with the picture of a running fox with a long tail. In English, this is a figure of speech meaning 'stop something from following you'. If the localization of this message is challenging, consider using a simplified alternative as a reference for translation: 'Keep unwanted trackers away'.", - }, - }, - fontSize: "22px", - fontWeight: 590, - paddingBlock: "4px 0", - letterSpacing: 0, - paddingInline: "24px", - }, - subtitle: { - raw: { - $l10n: { - id: "fox-doodle-trackers-subtitle", - text: "Say goodbye to annoying ad trackers and settle into a safer, speedy internet experience.", - comment: "", - }, - }, - fontSize: "15px", - lineHeight: "1.4", - marginBlock: "8px 16px", - letterSpacing: 0, - paddingInline: "24px", - }, - dismiss_button: { - action: { - navigate: true, - }, - }, - primary_button: { - label: { - raw: { - $l10n: { - id: "fox-doodle-set-default-driving-primary-button-label", - text: "Open my links with Firefox", - comment: "", - }, - }, - marginBlock: "4px 0", - paddingBlock: "0", - paddingInline: "16px", - }, - action: { - type: "SET_DEFAULT_BROWSER", - navigate: true, - }, - }, - secondary_button: { - label: { - raw: { - $l10n: { - id: "fox-doodle-driving-secondary-button-label", - text: "Not now", - comment: "", - }, - }, - marginBlock: "0 -20px", - }, - action: { - navigate: true, - }, - }, - }, - }, - ], - backdrop: "transparent", - template: "multistage", - transitions: true, - }, - trigger: { - id: "defaultBrowserCheck", - }, - priority: 1, - template: "spotlight", - frequency: { - lifetime: 1, - }, - targeting: - "source == 'startup' && !willShowDefaultPrompt && !isMajorUpgrade && !activeNotifications && (((currentDate|date) - (profileAgeCreated|date)) / 3600000 >= 6) && !isDefaultBrowser", - }, - { - // Nimbus slug: fox-doodle-set-to-default-early-day-user-en-treatment-a-rollout:treatment-a - // Version range: 116+ - // Recipe: https://experimenter.services.mozilla.com/nimbus/fox-doodle-set-to-default-early-day-user-en-treatment-a-rollout/summary#treatment-a - id: "fox-doodle-set-to-default-early-day-user:A", - groups: ["eco"], - content: { - id: "fox-doodle-set-to-default-early-day-user:A", - screens: [ - { - id: "SET_DEFAULT", - content: { - logo: { - height: "140px", - imageURL: - "https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/05f5265b-d1e4-4fe1-9a46-0ea36f8afced.png", - reducedMotionImageURL: - "https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/05f5265b-d1e4-4fe1-9a46-0ea36f8afced.png", - }, - title: { - raw: "Keep pesky trackers off your tail", - fontSize: "22px", - fontWeight: 590, - paddingBlock: "4px 0", - letterSpacing: 0, - paddingInline: "24px", - }, - subtitle: { - raw: "Say goodbye to annoying ad trackers and settle into a safer, speedy internet experience.", - fontSize: "15px", - lineHeight: "1.4", - marginBlock: "8px 16px", - letterSpacing: 0, - paddingInline: "24px", - }, - dismiss_button: { - action: { - navigate: true, - }, - }, - primary_button: { - label: { - raw: "Open my links with Firefox", - marginBlock: "4px 0", - paddingBlock: "0", - paddingInline: "16px", - }, - action: { - type: "SET_DEFAULT_BROWSER", - navigate: true, - }, - }, - secondary_button: { - label: { - raw: "Not now", - marginBlock: "0 -20px", - }, - action: { - navigate: true, - }, - }, - }, - }, - ], - backdrop: "transparent", - template: "multistage", - transitions: true, - }, - trigger: { - id: "defaultBrowserCheck", - }, - priority: 1, - template: "spotlight", - frequency: { - lifetime: 1, - }, - targeting: - "source == 'startup' && !willShowDefaultPrompt && !isMajorUpgrade && !activeNotifications && (((currentDate|date) - (profileAgeCreated|date)) / 3600000 >= 6) && !isDefaultBrowser", - }, ]; }, }; diff --git a/browser/components/newtab/.eslintrc.js b/browser/components/newtab/.eslintrc.js index 29114a055a29..e47a33d66cc2 100644 --- a/browser/components/newtab/.eslintrc.js +++ b/browser/components/newtab/.eslintrc.js @@ -23,8 +23,6 @@ module.exports = { { // These files use fluent-dom to insert content files: [ - "content-src/asrouter/templates/OnboardingMessage/**", - "content-src/asrouter/templates/FirstRun/**", "content-src/components/TopSites/**", "content-src/components/MoreRecommendations/MoreRecommendations.jsx", "content-src/components/CollapsibleSection/CollapsibleSection.jsx", diff --git a/browser/components/newtab/karma.mc.config.js b/browser/components/newtab/karma.mc.config.js index a67dfcda11a7..cd5085a20247 100644 --- a/browser/components/newtab/karma.mc.config.js +++ b/browser/components/newtab/karma.mc.config.js @@ -186,12 +186,6 @@ module.exports = function (config) { functions: 85.71, branches: 68.75, }, - "content-src/asrouter/**/*.jsx": { - statements: 57, - lines: 58, - functions: 60, - branches: 50, - }, /** * WallpaperSection.jsx is tested via an xpcshell test */ @@ -253,9 +247,6 @@ module.exports = function (config) { resolve: { extensions: [".js", ".jsx", ".mjs"], modules: [PATHS.moduleResolveDirectory, "node_modules"], - alias: { - asrouter: path.join(__dirname, "../asrouter"), - }, }, plugins: [ // The ResourceUriPlugin handles translating resource URIs in import diff --git a/browser/components/newtab/test/unit/unit-entry.js b/browser/components/newtab/test/unit/unit-entry.js index 73b4b8fcb5f7..0e63c92b54de 100644 --- a/browser/components/newtab/test/unit/unit-entry.js +++ b/browser/components/newtab/test/unit/unit-entry.js @@ -119,23 +119,6 @@ const TEST_GLOBAL = { }, platform: "win", }, - ASRouterPreferences: { - console: new FakeConsoleAPI({ - maxLogLevel: "off", // set this to "debug" or "all" to get more ASRouter logging in tests - prefix: "ASRouter", - }), - }, - AWScreenUtils: { - evaluateTargetingAndRemoveScreens() { - return true; - }, - async removeScreens() { - return true; - }, - evaluateScreenTargeting() { - return true; - }, - }, BrowserUtils: { sendToDeviceEmailsSupported() { return true;