Move My Publications into My Library
Instead of My Publications being a separate library, have it be a special collection inside My Library. Top-level items can be dragged into it as before, and child items can be toggled off and on with a button in the item pane. Newly added child items won't be shown by default. For upgraders, items in the My Publications library will be moved into My Library, which might result in their being duplicated if the items weren't removed from My Library. The client will then upload those new items into My Library. The API endpoint will continue to show items in the separate My Publications library until My Publications items are added to My Library, so the profile page will continue to show them.
This commit is contained in:
parent
e311279947
commit
5ff2a59f87
28 changed files with 969 additions and 239 deletions
|
@ -230,6 +230,80 @@ describe("ZoteroPane", function() {
|
|||
})
|
||||
})
|
||||
|
||||
|
||||
describe("#deleteSelectedItems()", function () {
|
||||
it("should remove an item from My Publications", function* () {
|
||||
var item = createUnsavedDataObject('item');
|
||||
item.inPublications = true;
|
||||
yield item.saveTx();
|
||||
|
||||
yield zp.collectionsView.selectByID("P" + userLibraryID);
|
||||
yield waitForItemsLoad(win);
|
||||
var iv = zp.itemsView;
|
||||
|
||||
var selected = iv.selectItem(item.id);
|
||||
assert.ok(selected);
|
||||
|
||||
var tree = doc.getElementById('zotero-items-tree');
|
||||
tree.focus();
|
||||
|
||||
yield Zotero.Promise.delay(1);
|
||||
|
||||
var promise = waitForDialog();
|
||||
var modifyPromise = waitForItemEvent('modify');
|
||||
|
||||
var event = doc.createEvent("KeyboardEvent");
|
||||
event.initKeyEvent("keypress", true, true, window, false, false, false, false, 46, 0);
|
||||
tree.dispatchEvent(event);
|
||||
yield promise;
|
||||
yield modifyPromise;
|
||||
|
||||
assert.isFalse(item.inPublications);
|
||||
assert.isFalse(item.deleted);
|
||||
});
|
||||
|
||||
it("should move an item to trash from My Publications", function* () {
|
||||
var item = createUnsavedDataObject('item');
|
||||
item.inPublications = true;
|
||||
yield item.saveTx();
|
||||
|
||||
yield zp.collectionsView.selectByID("P" + userLibraryID);
|
||||
yield waitForItemsLoad(win);
|
||||
var iv = zp.itemsView;
|
||||
|
||||
var selected = iv.selectItem(item.id);
|
||||
assert.ok(selected);
|
||||
|
||||
var tree = doc.getElementById('zotero-items-tree');
|
||||
tree.focus();
|
||||
|
||||
yield Zotero.Promise.delay(1);
|
||||
|
||||
var promise = waitForDialog();
|
||||
var modifyPromise = waitForItemEvent('modify');
|
||||
|
||||
var event = doc.createEvent("KeyboardEvent");
|
||||
event.initKeyEvent(
|
||||
"keypress",
|
||||
true,
|
||||
true,
|
||||
window,
|
||||
false,
|
||||
false,
|
||||
!Zotero.isMac, // shift
|
||||
Zotero.isMac, // meta
|
||||
46,
|
||||
0
|
||||
);
|
||||
tree.dispatchEvent(event);
|
||||
yield promise;
|
||||
yield modifyPromise;
|
||||
|
||||
assert.isTrue(item.inPublications);
|
||||
assert.isTrue(item.deleted);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#deleteSelectedCollection()", function () {
|
||||
it("should delete collection but not descendant items by default", function* () {
|
||||
var collection = yield createDataObject('collection');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue