Bug 1774081 - Show Edit list in the address book context menus for lists. r=darktrojan

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alessandro Castellani 2022-09-14 22:24:41 +00:00
Родитель edd9afc089
Коммит 1b42be34d6
4 изменённых файлов: 22 добавлений и 8 удалений

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

@ -958,12 +958,10 @@ class AbTreeListbox extends customElements.get("tree-listbox") {
}
_showContextMenu(event) {
let row;
if (event.target == this) {
row = this.rows[this.selectedIndex];
} else {
row = event.target.closest("li");
}
let row =
event.target == this
? this.rows[this.selectedIndex]
: event.target.closest("li");
if (!row) {
return;
}
@ -997,6 +995,13 @@ class AbTreeListbox extends customElements.get("tree-listbox") {
item.hidden = false;
}
document.l10n.setAttributes(
document.getElementById("bookContextProperties"),
row.classList.contains("listRow")
? "about-addressbook-books-context-edit-list"
: "about-addressbook-books-context-properties"
);
synchronizeItem.hidden = !row.classList.contains("carddav");
exportItem.hidden = row.classList.contains("remote");

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

@ -335,8 +335,7 @@
</xul:vbox>
</body>
<xul:menupopup id="bookContext">
<xul:menuitem id="bookContextProperties"
data-l10n-id="about-addressbook-books-context-properties"/>
<xul:menuitem id="bookContextProperties"/>
<xul:menuitem id="bookContextSynchronize"
data-l10n-id="about-addressbook-books-context-synchronize"/>
<xul:menuitem id="bookContextPrint"

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

@ -351,6 +351,10 @@ add_task(async function test_rename_and_delete() {
Assert.ok(BrowserTestUtils.is_visible(propertiesMenuItem));
Assert.ok(!propertiesMenuItem.disabled);
Assert.deepEqual(document.l10n.getAttributes(propertiesMenuItem), {
id: "about-addressbook-books-context-properties",
args: null,
});
let dialogPromise = promiseLoadSubDialog(
"chrome://messenger/content/addressbook/abAddressBookNameDialog.xhtml"
@ -409,6 +413,10 @@ add_task(async function test_rename_and_delete() {
await rightClickOnIndex(3);
Assert.ok(BrowserTestUtils.is_visible(propertiesMenuItem));
Assert.deepEqual(document.l10n.getAttributes(propertiesMenuItem), {
id: "about-addressbook-books-context-edit-list",
args: null,
});
dialogPromise = promiseLoadSubDialog(
"chrome://messenger/content/addressbook/abEditListDialog.xhtml"

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

@ -25,6 +25,8 @@ all-address-books = All Address Books
about-addressbook-books-context-properties =
.label = Properties
about-addressbook-books-context-edit-list =
.label = Edit list
about-addressbook-books-context-synchronize =
.label = Synchronize
about-addressbook-books-context-edit =