Commit d79aecaf authored by Sergey Galich's avatar Sergey Galich
Browse files

Bug 1829427 - Update Relay integration checkbox in Settings...

Bug 1829427 - Update Relay integration checkbox in Settings r=credential-management-reviewers,fluent-reviewers,settings-reviewers,flod,jneuberger,mconley

Differential Revision: https://phabricator.services.mozilla.com/D176192
parent 2c859966
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -487,8 +487,8 @@
    <hbox class="indent" id="relayIntegrationBox" flex="1" align="center">
      <checkbox id="relayIntegration"
                class="tail-with-learn-more"
                data-l10n-id="relay-integration"
                search-l10n-ids="relay-integration.label" />
                data-l10n-id="preferences-relay-integration-checkbox"
                search-l10n-ids="preferences-relay-integration-checkbox.label" />
      <html:a id="relayIntegrationLearnMoreLink" class="learnMore"
             data-l10n-id="relay-integration-learn-more-link"/>
    </hbox>
+2 −2
Original line number Diff line number Diff line
@@ -2882,7 +2882,7 @@ var gPrivacyPane = {
  toggleRelayIntegration() {
    const checkbox = document.getElementById("relayIntegration");
    if (checkbox.checked) {
      FirefoxRelay.markAsEnabled();
      FirefoxRelay.markAsAvailable();
      FirefoxRelayTelemetry.recordRelayPrefEvent("enabled");
    } else {
      FirefoxRelay.markAsDisabled();
@@ -2894,7 +2894,7 @@ var gPrivacyPane = {
    document.getElementById("relayIntegrationBox").hidden =
      !FirefoxRelay.isAvailable;
    document.getElementById("relayIntegration").checked =
      FirefoxRelay.isEnabled;
      FirefoxRelay.isAvailable && !FirefoxRelay.isDisabled;
  },

  _initRelayIntegrationUI() {
+11 −11
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ add_task(async function initialState() {
        ["signon.firefoxRelay.feature", "available"],
        ["signon.rememberSignons", true],
      ],
      expected: "unchecked",
      expected: "checked",
    },
    {
      initialPrefs: [
@@ -44,7 +44,7 @@ add_task(async function initialState() {
        ["signon.firefoxRelay.feature", "available"],
        ["signon.rememberSignons", false],
      ],
      expected: "unchecked",
      expected: "checked",
    },
    {
      initialPrefs: [
@@ -117,7 +117,7 @@ add_task(async function initialState() {
add_task(async function toggleRelayIntegration() {
  await SpecialPowers.pushPrefEnv({
    set: [
      ["signon.firefoxRelay.feature", "available"],
      ["signon.firefoxRelay.feature", "enabled"],
      ["signon.rememberSignons", true],
    ],
  });
@@ -138,7 +138,7 @@ add_task(async function toggleRelayIntegration() {
      Assert.equal(doc.activeElement, relayCheckbox, "checkbox is focused");
      Assert.equal(
        relayCheckbox.checked,
        false,
        true,
        "#relayIntegration checkbox is not checked"
      );

@@ -166,20 +166,20 @@ add_task(async function toggleRelayIntegration() {
        );
      }

      await clickOnFeatureCheckbox(
        "enabled",
        true,
        'Turn integration on from "available" feature state (first time)'
      );
      await clickOnFeatureCheckbox(
        "disabled",
        false,
        'Turn integration off from "enabled" feature state'
      );
      await clickOnFeatureCheckbox(
        "enabled",
        "available",
        true,
        'Turn integration on from "disabled" feature state'
        'Turn integration on from "enabled" feature state'
      );
      await clickOnFeatureCheckbox(
        "disabled",
        false,
        'Turn integration off from "enabled" feature state'
      );
    }
  );
+2 −2
Original line number Diff line number Diff line
@@ -1016,8 +1016,8 @@ forms-breach-alerts =
    .label = Show alerts about passwords for breached websites
    .accesskey = b
forms-breach-alerts-learn-more-link = Learn more
relay-integration =
    .label = Enable { -relay-brand-name } in your { -brand-short-name } password manager
preferences-relay-integration-checkbox =
    .label = Suggest { -relay-brand-name } email masks to protect your email address
relay-integration-learn-more-link = Learn more

# Checkbox which controls filling saved logins into fields automatically when they appear, in some cases without user interaction.
+8 −0
Original line number Diff line number Diff line
@@ -1849,6 +1849,14 @@ export class OptInFeature {
    return this.#currentPrefValue == OptInFeature.PREF_ENABLED_VALUE;
  }

  get isDisabled() {
    return this.#currentPrefValue == OptInFeature.PREF_DISABLED_VALUE;
  }

  markAsAvailable() {
    this.#markAs(OptInFeature.PREF_AVAILABLE_VALUE);
  }

  markAsOffered() {
    this.#markAs(OptInFeature.PREF_OFFERED_VALUE);
  }
Loading