From b9c626a5203af267ed6cdc6d8c296df599f94723 Mon Sep 17 00:00:00 2001 From: Vijay Budhram Date: Wed, 6 Nov 2019 16:51:03 +0000 Subject: [PATCH] Bug 1590231 - Update sync preferences panel to match decouple designs r=fluent-reviewers,markh Differential Revision: https://phabricator.services.mozilla.com/D50931 --HG-- extra : moz-landing-system : lando --- browser/base/content/browser-sync.js | 2 +- browser/components/newtab/lib/ASRouter.jsm | 4 +++- browser/components/newtab/lib/BookmarkPanelHub.jsm | 4 +++- .../newtab/test/unit/asrouter/ASRouter.test.js | 4 +++- .../asrouter/templates/OnboardingMessage.test.jsx | 2 +- .../newtab/test/unit/lib/BookmarkPanelHub.test.js | 2 +- browser/components/newtab/test/unit/unit-entry.js | 2 +- browser/components/preferences/in-content/main.js | 4 +++- .../components/preferences/in-content/sync.inc.xul | 13 +------------ browser/components/preferences/in-content/sync.js | 12 ++++-------- .../tests/browser_search_within_preferences_2.js | 8 -------- browser/components/uitour/UITour.jsm | 2 +- .../components/uitour/test/browser_UITour_sync.js | 6 +++--- .../en-US/browser/preferences/preferences.ftl | 10 +++------- services/fxaccounts/FxAccountsConfig.jsm | 14 +------------- .../tests/xpcshell/test_accounts_config.js | 6 +++--- .../remotepagemanager/RemotePageManagerParent.jsm | 2 +- 17 files changed, 33 insertions(+), 64 deletions(-) diff --git a/browser/base/content/browser-sync.js b/browser/base/content/browser-sync.js index ff21de07126b..dd109a2a66e0 100644 --- a/browser/base/content/browser-sync.js +++ b/browser/base/content/browser-sync.js @@ -707,7 +707,7 @@ var gSync = { }, async openFxAEmailFirstPage(entryPoint) { - const url = await FxAccounts.config.promiseEmailFirstURI(entryPoint); + const url = await FxAccounts.config.promiseConnectAccountURI(entryPoint); switchToTabHavingURI(url, true, { replaceQueryString: true }); }, diff --git a/browser/components/newtab/lib/ASRouter.jsm b/browser/components/newtab/lib/ASRouter.jsm index b8788df6d1d3..932b1486e203 100644 --- a/browser/components/newtab/lib/ASRouter.jsm +++ b/browser/components/newtab/lib/ASRouter.jsm @@ -1926,7 +1926,9 @@ class _ASRouter { }); break; case ra.SHOW_FIREFOX_ACCOUNTS: - const url = await FxAccounts.config.promiseSignUpURI("snippets"); + const url = await FxAccounts.config.promiseConnectAccountURI( + "snippets" + ); // We want to replace the current tab. target.browser.ownerGlobal.openLinkIn(url, "current", { private: false, diff --git a/browser/components/newtab/lib/BookmarkPanelHub.jsm b/browser/components/newtab/lib/BookmarkPanelHub.jsm index b6b21a048482..ca4a167c343f 100644 --- a/browser/components/newtab/lib/BookmarkPanelHub.jsm +++ b/browser/components/newtab/lib/BookmarkPanelHub.jsm @@ -137,7 +137,9 @@ class _BookmarkPanelHub { recommendation.setAttribute("id", "cfrMessageContainer"); recommendation.addEventListener("click", async e => { target.hidePopup(); - const url = await FxAccounts.config.promiseEmailFirstURI("bookmark"); + const url = await FxAccounts.config.promiseConnectAccountURI( + "bookmark" + ); win.ownerGlobal.openLinkIn(url, "tabshifted", { private: false, triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal( diff --git a/browser/components/newtab/test/unit/asrouter/ASRouter.test.js b/browser/components/newtab/test/unit/asrouter/ASRouter.test.js index f81b283f1545..e42c06129b18 100644 --- a/browser/components/newtab/test/unit/asrouter/ASRouter.test.js +++ b/browser/components/newtab/test/unit/asrouter/ASRouter.test.js @@ -2026,7 +2026,9 @@ describe("ASRouter", () => { describe("#onMessage: SHOW_FIREFOX_ACCOUNTS", () => { beforeEach(() => { globals.set("FxAccounts", { - config: { promiseSignUpURI: sandbox.stub().resolves("some/url") }, + config: { + promiseConnectAccountURI: sandbox.stub().resolves("some/url"), + }, }); }); it("should call openLinkIn with the correct params on OPEN_URL", async () => { diff --git a/browser/components/newtab/test/unit/asrouter/templates/OnboardingMessage.test.jsx b/browser/components/newtab/test/unit/asrouter/templates/OnboardingMessage.test.jsx index 928b6b981b7c..43d3eb9f0077 100644 --- a/browser/components/newtab/test/unit/asrouter/templates/OnboardingMessage.test.jsx +++ b/browser/components/newtab/test/unit/asrouter/templates/OnboardingMessage.test.jsx @@ -34,7 +34,7 @@ describe("OnboardingMessage", () => { globals = new GlobalOverrider(); sandbox = sinon.createSandbox(); globals.set("FxAccountsConfig", { - promiseEmailFirstURI: sandbox.stub().resolves("some/url"), + promiseConnectAccountURI: sandbox.stub().resolves("some/url"), }); globals.set("AddonRepository", { getAddonsByIDs: ([content]) => [ diff --git a/browser/components/newtab/test/unit/lib/BookmarkPanelHub.test.js b/browser/components/newtab/test/unit/lib/BookmarkPanelHub.test.js index b5707c8632b0..e95d764bf483 100644 --- a/browser/components/newtab/test/unit/lib/BookmarkPanelHub.test.js +++ b/browser/components/newtab/test/unit/lib/BookmarkPanelHub.test.js @@ -28,7 +28,7 @@ describe("BookmarkPanelHub", () => { return fakeL10n; }); // eslint-disable-line prefer-arrow-callback globals.set("FxAccounts", { - config: { promiseEmailFirstURI: sandbox.stub() }, + config: { promiseConnectAccountURI: sandbox.stub() }, }); isBrowserPrivateStub = sandbox.stub().returns(false); globals.set("PrivateBrowsingUtils", { diff --git a/browser/components/newtab/test/unit/unit-entry.js b/browser/components/newtab/test/unit/unit-entry.js index 5aa9e2432443..36a5b6f8c1a4 100644 --- a/browser/components/newtab/test/unit/unit-entry.js +++ b/browser/components/newtab/test/unit/unit-entry.js @@ -353,7 +353,7 @@ const TEST_GLOBAL = { } }, FxAccountsConfig: { - promiseEmailFirstURI(id) { + promiseConnectAccountURI(id) { return Promise.resolve(id); }, }, diff --git a/browser/components/preferences/in-content/main.js b/browser/components/preferences/in-content/main.js index 18a5f6f9df50..49d155c7eba7 100644 --- a/browser/components/preferences/in-content/main.js +++ b/browser/components/preferences/in-content/main.js @@ -857,7 +857,9 @@ var gMainPane = { win.openTrustedLinkIn("about:preferences#sync", "current"); return; } - let url = await FxAccounts.config.promiseSignInURI("dev-edition-setup"); + let url = await FxAccounts.config.promiseConnectAccountURI( + "dev-edition-setup" + ); let accountsTab = win.gBrowser.addWebTab(url); win.gBrowser.selectedTab = accountsTab; }, diff --git a/browser/components/preferences/in-content/sync.inc.xul b/browser/components/preferences/in-content/sync.inc.xul index e444bf38b042..7d37d26fe3a9 100644 --- a/browser/components/preferences/in-content/sync.inc.xul +++ b/browser/components/preferences/in-content/sync.inc.xul @@ -26,23 +26,12 @@ - - - - - -