trash functionality for collections and searches (#3307)

When a collection or a saved search is deleted, it appears in
trash among other trashed items. From there, it can be restored
or permanently deleted.

Items of trashed collections are not affected my the trashing/permanent
deletion of a collection and need to be deleted separately like before.

Subcollections of a trashed collection do not appear in the trash and
are restored or permanently deleted with the top-most trashed parent.
This commit is contained in:
Bogdan Abaev 2023-11-27 16:49:37 -05:00 committed by Dan Stillman
parent f4d428cb16
commit a532cfb475
15 changed files with 636 additions and 189 deletions

View file

@ -661,6 +661,13 @@ describe("Zotero.Search", function() {
await search.saveTx();
assert.isFalse(search.deleted);
});
it("should permanently delete", async function () {
var search = await createDataObject('search');
assert.isFalse(search.deleted);
await search.eraseTx();
search = await Zotero.Searches.getAsync(search.id);
assert.isFalse(search);
});
});
describe("#toJSON()", function () {