Bug 1592467 - Remove dismiss button on breach alerts. r=sfoster,fluent-reviewers,flod

Differential Revision: https://phabricator.services.mozilla.com/D68107

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jared Wein 2020-03-28 02:12:55 +00:00
Родитель a324185ec2
Коммит a09cf77815
9 изменённых файлов: 0 добавлений и 151 удалений

Просмотреть файл

@ -111,12 +111,6 @@ class AboutLoginsChild extends JSWindowActorChild {
}); });
break; break;
} }
case "AboutLoginsDismissBreachAlert": {
this.sendAsyncMessage("AboutLogins:DismissBreachAlert", {
login: event.detail,
});
break;
}
case "AboutLoginsGetHelp": { case "AboutLoginsGetHelp": {
this.sendAsyncMessage("AboutLogins:GetHelp"); this.sendAsyncMessage("AboutLogins:GetHelp");
break; break;

Просмотреть файл

@ -245,17 +245,6 @@ class AboutLoginsParent extends JSWindowActorParent {
Services.logins.removeLogin(login); Services.logins.removeLogin(login);
break; break;
} }
case "AboutLogins:DismissBreachAlert": {
const login = message.data.login;
await LoginBreaches.recordDismissal(login.guid);
const logins = await AboutLogins.getAllLogins();
const breachesByLoginGUID = await LoginBreaches.getPotentialBreachesByLoginGUID(
logins
);
this.sendAsyncMessage("AboutLogins:SetBreaches", breachesByLoginGUID);
break;
}
case "AboutLogins:HideFooter": { case "AboutLogins:HideFooter": {
Services.prefs.setBoolPref(HIDE_MOBILE_FOOTER_PREF, true); Services.prefs.setBoolPref(HIDE_MOBILE_FOOTER_PREF, true);
break; break;

Просмотреть файл

@ -25,14 +25,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
this.LoginBreaches = { this.LoginBreaches = {
REMOTE_SETTINGS_COLLECTION: "fxmonitor-breaches", REMOTE_SETTINGS_COLLECTION: "fxmonitor-breaches",
async recordDismissal(loginGuid) {
await Services.logins.initializationPromise;
const storageJSON =
Services.logins.wrappedJSObject._storage.wrappedJSObject;
return storageJSON.recordBreachAlertDismissal(loginGuid);
},
async update(breaches = null) { async update(breaches = null) {
const logins = await LoginHelper.getAllUserFacingLogins(); const logins = await LoginHelper.getAllUserFacingLogins();
await this.getPotentialBreachesByLoginGUID(logins, breaches); await this.getPotentialBreachesByLoginGUID(logins, breaches);

Просмотреть файл

@ -165,9 +165,6 @@
<span class="alert-date" data-l10n-id="about-logins-breach-alert-date" data-l10n-args='{"date": 0}'></span> <span class="alert-date" data-l10n-id="about-logins-breach-alert-date" data-l10n-args='{"date": 0}'></span>
<span class="alert-text" data-l10n-id="breach-alert-text"></span> <span class="alert-text" data-l10n-id="breach-alert-text"></span>
<a class="alert-link" data-l10n-id="breach-alert-link" href="#" rel="noreferrer" target="_blank"></a> <a class="alert-link" data-l10n-id="breach-alert-link" href="#" rel="noreferrer" target="_blank"></a>
<button class="dismiss-alert" data-l10n-id="breach-alert-dismiss">
<img class="dismiss-alert-icon" src="chrome://global/skin/icons/close.svg"/>
</button>
</div> </div>
<div class="vulnerable-alert"> <div class="vulnerable-alert">
<h3 class="alert-title" data-l10n-id="about-logins-vulnerable-alert-title"></h3> <h3 class="alert-title" data-l10n-id="about-logins-vulnerable-alert-title"></h3>

Просмотреть файл

@ -353,35 +353,6 @@ input[name="password"] {
width: 24px; width: 24px;
} }
.dismiss-alert {
border: none;
padding: 0;
margin: 0;
position: absolute;
inset-inline-end: 12px;
inset-block-start: 12px;
min-width: auto;
min-height: auto;
line-height: 0;
background-color: transparent;
}
.dismiss-alert:enabled:hover {
background-color: var(--grey-90-a20);
}
.dismiss-alert:enabled:hover:active {
background-color: var(--grey-90-a30);
}
.dismiss-alert-icon {
-moz-context-properties: fill, fill-opacity;
fill-opacity: 0;
fill: currentColor;
width: 16px;
height: 16px;
}
.error-message { .error-message {
color: #fff; color: #fff;
background-color: var(--red-60); background-color: var(--red-60);

Просмотреть файл

@ -83,16 +83,10 @@ export default class LoginItem extends HTMLElement {
this._breachAlert = this.shadowRoot.querySelector(".breach-alert"); this._breachAlert = this.shadowRoot.querySelector(".breach-alert");
this._breachAlertLink = this._breachAlert.querySelector(".alert-link"); this._breachAlertLink = this._breachAlert.querySelector(".alert-link");
this._breachAlertDate = this._breachAlert.querySelector(".alert-date"); this._breachAlertDate = this._breachAlert.querySelector(".alert-date");
this._dismissBreachAlert = this._breachAlert.querySelector(
".dismiss-alert"
);
this._vulnerableAlert = this.shadowRoot.querySelector(".vulnerable-alert"); this._vulnerableAlert = this.shadowRoot.querySelector(".vulnerable-alert");
this._vulnerableAlertLink = this._vulnerableAlert.querySelector( this._vulnerableAlertLink = this._vulnerableAlert.querySelector(
".alert-link" ".alert-link"
); );
this._dismissVulnerableAlert = this._vulnerableAlert.querySelector(
".dismiss-alert"
);
this.render(); this.render();
@ -101,7 +95,6 @@ export default class LoginItem extends HTMLElement {
this._copyPasswordButton.addEventListener("click", this); this._copyPasswordButton.addEventListener("click", this);
this._copyUsernameButton.addEventListener("click", this); this._copyUsernameButton.addEventListener("click", this);
this._deleteButton.addEventListener("click", this); this._deleteButton.addEventListener("click", this);
this._dismissBreachAlert.addEventListener("click", this);
this._editButton.addEventListener("click", this); this._editButton.addEventListener("click", this);
this._errorMessageLink.addEventListener("click", this); this._errorMessageLink.addEventListener("click", this);
this._form.addEventListener("submit", this); this._form.addEventListener("submit", this);
@ -289,23 +282,6 @@ export default class LoginItem extends HTMLElement {
this._internalSetMonitorData(internalMemberName, this[internalMemberName]); this._internalSetMonitorData(internalMemberName, this[internalMemberName]);
} }
dismissBreachAlert() {
document.dispatchEvent(
new CustomEvent("AboutLoginsDismissBreachAlert", {
bubbles: true,
detail: this._login,
})
);
this._recordTelemetryEvent({
object: "existing_login",
method: "dismiss_breach_alert",
});
}
dismissVulnerableAlert() {
// TODO: Implement this
}
showLoginItemError(error) { showLoginItemError(error) {
this._error = error; this._error = error;
this.render(); this.render();
@ -457,14 +433,6 @@ export default class LoginItem extends HTMLElement {
}); });
return; return;
} }
if (classList.contains("dismiss-alert")) {
if (event.currentTarget.closest(".breach-alert")) {
this.dismissBreachAlert();
} else if (event.currentTarget.closest(".vulnerable-alert")) {
this.dismissVulnerableAlert();
}
return;
}
if (classList.contains("edit-button")) { if (classList.contains("edit-button")) {
let masterPasswordAuth = await new Promise(resolve => { let masterPasswordAuth = await new Promise(resolve => {
window.AboutLoginsUtils.promptForMasterPassword( window.AboutLoginsUtils.promptForMasterPassword(

Просмотреть файл

@ -8,8 +8,6 @@ prefs =
# Skip ASAN and debug since waiting for content events is already slow. # Skip ASAN and debug since waiting for content events is already slow.
[browser_aaa_eventTelemetry_run_first.js] [browser_aaa_eventTelemetry_run_first.js]
skip-if = asan || ccov || debug # bug 1605494 is more prevalent on linux skip-if = asan || ccov || debug # bug 1605494 is more prevalent on linux
[browser_breachAlertDismissals.js]
skip-if = asan || debug || verify # bug 1574023
[browser_breachAlertShowingForAddedLogin.js] [browser_breachAlertShowingForAddedLogin.js]
[browser_confirmDeleteDialog.js] [browser_confirmDeleteDialog.js]
[browser_contextmenuFillLogins.js] [browser_contextmenuFillLogins.js]

Просмотреть файл

@ -1,58 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
EXPECTED_BREACH = {
AddedDate: "2018-12-20T23:56:26Z",
BreachDate: "2018-12-16",
Domain: "breached.example.com",
Name: "Breached",
PwnCount: 1643100,
DataClasses: ["Email addresses", "Usernames", "Passwords", "IP addresses"],
_status: "synced",
id: "047940fe-d2fd-4314-b636-b4a952ee0043",
last_modified: "1541615610052",
schema: "1541615609018",
};
add_task(async function setup() {
Services.prefs.setCharPref("signon.management.page.sort", "last-changed");
TEST_LOGIN3 = await addLogin(TEST_LOGIN3);
TEST_LOGIN1 = await addLogin(TEST_LOGIN1);
await BrowserTestUtils.openNewForegroundTab({
gBrowser,
url: "about:logins",
});
registerCleanupFunction(() => {
Services.prefs.clearUserPref("signon.management.page.sort");
BrowserTestUtils.removeTab(gBrowser.selectedTab);
Services.logins.removeAllLogins();
});
});
add_task(async function test_show_login() {
let browser = gBrowser.selectedBrowser;
await SpecialPowers.spawn(browser, [], async () => {
let loginItem = Cu.waiveXrays(content.document.querySelector("login-item"));
let breachAlert = loginItem.shadowRoot.querySelector(".breach-alert");
let breachAlertVisible = await ContentTaskUtils.waitForCondition(() => {
return !breachAlert.hidden;
}, "Waiting for breach alert to be visible");
ok(
breachAlertVisible,
"Breach alert should be visible for a breached login."
);
let breachAlertDismissalButton = breachAlert.querySelector(
".dismiss-breach-alert"
);
breachAlertDismissalButton.click();
let breachAlertDismissed = await ContentTaskUtils.waitForCondition(() => {
return breachAlert.hidden;
}, "Waiting for breach alert to be dismissed");
ok(
breachAlertDismissed,
"Breach alert should not be visible after alert dismissal."
);
});
});

Просмотреть файл

@ -170,8 +170,6 @@ confirm-discard-changes-dialog-confirm-button = Discard
about-logins-breach-alert-title = Website Breach about-logins-breach-alert-title = Website Breach
breach-alert-text = Passwords were leaked or stolen from this website since you last updated your login details. Change your password to protect your account. breach-alert-text = Passwords were leaked or stolen from this website since you last updated your login details. Change your password to protect your account.
breach-alert-link = Learn more about this breach. breach-alert-link = Learn more about this breach.
breach-alert-dismiss =
.title = Close this alert
about-logins-breach-alert-date = This breach occurred on { DATETIME($date, day: "numeric", month: "long", year: "numeric") } about-logins-breach-alert-date = This breach occurred on { DATETIME($date, day: "numeric", month: "long", year: "numeric") }
## Vulnerable Password notification ## Vulnerable Password notification