Commit graph

780 commits

Author SHA1 Message Date
Dan Stillman
3f6ef7fb01 Allow "now" in Accessed field to use current time
Closes #1340
2018-01-05 03:41:08 -05:00
Dan Stillman
fdb9e20076 Clear parentKey change marker after save
Fixes #1325, Field editor closes during auto-sync of newly created
parent item
2018-01-04 19:10:41 -05:00
Dan Stillman
a1c96f1db1 Fix deletion of tags across libraries
https://forums.zotero.org/discussion/comment/296384/#Comment_296384
2017-12-20 21:48:36 -05:00
Dan Stillman
df38f4ded7 Avoid upload retry loops
- Don't try uploading an object more than 5 times
- Don't retry a child item if the parent item failed too
2017-12-10 03:45:08 -05:00
Dan Stillman
f353b7ca61 API-based "Restore to Online Library"
Restores the "Restore to Zotero Server" functionality, now using the
API:

1. Get all remote keys and send `DELETE` for any that don't exist
   locally.
2. Upload all local objects in full (non-patch) mode using only library
   version so that the remotes are overwritten.
3. Reset file sync history, causing all files to be uploaded (or, more
   likely, reassociated with existing remote files).

Since these are treated as regular updates on the server, they'll sync
down to other clients normally. Unsynced changes by other clients might
still trigger conflicts.

This and Reset File Sync History can also now be run on group libraries,
with a library selector in the Reset pane (which I forgot to do with
React).

The full sync option is now removed from the Reset pane, since there
wasn't ever really a reason to run it manually.

We should be able to reimplement Restore from Online Library (#1386)
using the inverse of this approach.

Closes #914
2017-12-08 00:42:03 -05:00
Dan Stillman
da1dd75265 Don't compress uploaded data in tests
It would be better to handle this automatically in Sinon, but as it is
uploads are compressed if they're bigger than an arbitrary limit, which
can break tests unexpectedly if they check req.requestBody.
2017-12-08 00:42:03 -05:00
Dan Stillman
045f1fbb7e Add utility functions for building drop-down library lists
A XUL one for the current use in Advanced Search and an HTML one for
future uses. Sets the value to libraryID and adds data attributes for
editable/filesEditable on the HTML one.
2017-12-08 00:42:03 -05:00
Dan Stillman
cdaf73b3d0 Fix sync error after resetting read-only group
If an item needed to be erased, it would fail with "Cannot edit item in
read-only library", because the deletion didn't skip the edit check.
2017-12-02 01:35:23 -05:00
Adomas Venčkauskas
6970556dbd Clone feed items if translation returns no items. Closes #1377 2017-11-30 11:39:34 +02:00
Dan Stillman
88a6e4f79f Don't send inPublications=false in 'full' mode for group items 2017-11-20 16:27:45 -05:00
Dan Stillman
10a5d8d02e Check for Firefox profile access at startup and show warning
f40b7ae6ac didn't help with people who've already upgraded, so check at
startup and show a warning if the profile is inaccessible until 1) the
profile has been accessed once or 2) the user checks "Don't show again"
in the warning dialog.

Also fix Zotero.Profile.getDefaultInProfilesDir() to properly throw an
error if it can't access the default directory.
2017-11-17 22:49:57 -05:00
Dan Stillman
c7fd46e6b4 Don't ignore whitespace when sorting
Intl.Collator's ignorePunctuation ignores whitespace too, so stop using
it, since it produces much weirder results than sorting on punctuation does.
2017-11-16 01:17:24 -05:00
Dan Stillman
bbb6434524 Add test for short DOI parsing
Follow-up to #1356
2017-11-07 16:53:31 -05:00
Dan Stillman
01c71fd970 Add cleanDOI() tests
In advance of #1356

We're not properly handling DOIs in parentheses or brackets (which would
require non-regex logic), so those tests are skipped for now.
2017-11-07 15:29:32 -05:00
Dan Stillman
0bf546a0aa Fix test after a3e711b7b5 2017-11-03 04:47:04 -04:00
Dan Stillman
0f743e55c7 Fix "Rename File from Parent Metadata" if target filename exists
Add a unique numeric suffix to the filename, before any extension
2017-11-01 01:06:20 -04:00
Dan Stillman
676ab7852b Fix date parsing from Atom feeds
Use Atom namespace when getting fields, and use `<updated>` date before
`<published>`. (The dates are also available on the nsIFeedContainer
(`feedEntry`), but we're getting them directly from the fields for some
reason.)
2017-10-31 02:21:21 -04:00
Dan Stillman
2184952551 Fix -s and -e arguments for test runner 2017-10-27 04:03:11 -04:00
Dan Stillman
e22d7a8459 Fix some property access issues
- Return `undefined` instead of throwing an error trying to access
  `libraryTypeID` on a Zotero.Feed -- this fixes a test failure with
  the latest Chai, which annoyingly runs inspect() on an object passed
  to .include() regardless of whether the test succeeds
- Make some deprecated properties non-enumerable to avoid unnecessary
  logging when the object is dumped
2017-10-27 03:25:08 -04:00
Dan Stillman
34028d354e Don't try to delete Quick Start Guide items in test
We don't create these items anymore.
2017-10-27 01:09:34 -04:00
Dan Stillman
15942b97ae Bail on auto-build failure when running tests 2017-10-27 01:08:48 -04:00
Dan Stillman
f0770fa84d Fix various conflict resolution bugs
Among other things, when choosing the local side for a conflict, the
remote version could still end up being saved.
2017-10-27 01:08:38 -04:00
Dan Stillman
5901a3c7af Fix possible skipped group download when another group is archived 2017-10-26 19:05:46 -04:00
Dan Stillman
73d88421bb Fix items list problems when adding item with a search entered
When an item is created, an active quick search is cleared, but that's
now an async operation. We weren't waiting for that, which meant that
new items weren't selected and depending on a race condition could even
show the welcome pane despite there being items in the library.
2017-10-25 23:51:13 -04:00
Dan Stillman
e35b035224 Separate identifer parsing from Add Item by Identifier and search translation
- Move identifier detection to `Zotero.Utilities.Internal.extractIdentifiers()`
  so that it can be used for things other than Add Item by Identifier
  (e.g., translation-server)
- Add a `Zotero.Translate.Search::setIdentifier()` function that takes an
  identifier object produced by `extractIdentifiers()` (`{ DOI: "10/..." }`),
  converts that to the search format expected by translators, and calls setSearch()
2017-10-21 03:32:28 -04:00
Dan Stillman
39a2445d74 Update full-text sync tests after 2ecfff6681 2017-10-20 05:23:13 -04:00
Dan Stillman
773a93f55d Fix item selection that requires switching to library root
Broken in c7639f328f
2017-10-07 05:05:34 -04:00
Dan Stillman
819be60796 Switch to XMLHttpRequest for processDocuments()
processDocuments() now uses an XHR 'document' request, wrapped to
provide a 'location' property, and uses promises for a simpler call
signature (though the old one will continue to work, for existing
translators). 'done' and 'exception' can now be handled via promises,
and in the translator sandbox an optional noCompleteOnError argument
instructs it not to automatically cancel the translation process with an
error (e.g., for supplementary materials).

Since we do need a hidden browser in some situations (e.g., for saving
snapshots), the old hidden-browser-based processDocuments() is still
available as Zotero.HTTP.loadDocuments().

This hopefully also fixes various problems with document property access
in translation-server.
2017-10-05 17:18:42 -04:00
Dan Stillman
6e1e2dcf76 Disable e10s for tests 2017-10-04 21:35:22 -04:00
Dan Stillman
f7e2cd6348 Isolate test from 531170353b 2017-10-01 22:43:18 -04:00
Dan Stillman
959772dc00 Disable app update during test runs 2017-10-01 22:06:35 -04:00
Dan Stillman
531170353b Fix bidirectional relations on Duplicate Item 2017-10-01 22:04:11 -04:00
Dan Stillman
48d4d2d5a5 Standardize connector server behavior for saves to read-only libraries
Return a 500 for read-only libraries for all save modes. Read-only views
within editable libraries will save to the library root.

Addresses #185, RIS/BibTeX interception to read-only view behaves
differently from save button
2017-09-27 17:39:18 -04:00
Dan Stillman
0d3d4323b5 Fix relations import via translators
Fixes #1282
2017-09-22 01:02:50 -04:00
Dan Stillman
10cae22c55 Restrict relation predicates to letters and colons for now 2017-09-22 01:01:52 -04:00
Dan Stillman
d80aa97ebd Restore related-items tests for Zotero.Translate.ItemGetter 2017-09-22 00:59:33 -04:00
Dan Stillman
d81e2a5cf0 Fix sync errors from remote item referencing deleted local collection 2017-09-20 05:33:44 -04:00
Dan Stillman
459e26490a Better isolate collectionTreeView test 2017-09-18 17:46:03 -04:00
Dan Stillman
afc7afeb9c Fix error deleting collection after emptying trash
Follow-up to c442daedce
Fixes #1317
2017-09-18 17:03:12 -04:00
Dan Stillman
c442daedce Update collection cache after "Delete collection and items…"
Fixes #1314
2017-09-13 01:01:36 -04:00
Dan Stillman
2901174ba3 Fix intermittent item selection failure 2017-09-10 03:18:59 -04:00
Dan Stillman
91ef561474 Fix test failure after 94c4445475
If the styled textbox (i.e., TinyMCE) isn't initialized, .value now
returns null instead of throwing.
2017-08-30 18:26:01 -04:00
Dan Stillman
05d74c4cac Don't load note/attachments counts as primary data
Zotero.Item::numNotes()/numAttachments() now require 'childItems' to
have been loaded.

Fixes #1301, Slow startup with many items in trash
2017-08-30 18:08:25 -04:00
Dan Stillman
687f86af71 Allow parentID in importFileAttachment() test support function
The Zotero.Attachments functions only take parentItemID, but
createDataObject() takes parentID.
2017-08-30 18:08:25 -04:00
Dan Stillman
f4b73d22b8 Fix error relocating to filename with different Unicode normalization 2017-08-23 11:02:05 +02:00
Dan Stillman
6673c64ac6 Fix accessDate when translators set CURRENT_TIMESTAMP
(But it also seems like we always do that automatically for web
translators, so I'm not sure why so many translators set that.)
2017-08-19 15:21:57 +02:00
Dan Stillman
7386b376f3 Fix linked attachment base directory handling at drive root
The first letter of the relative path was being removed on save if the
base directory was set to the drive root (e.g. D:\ instead of D:\foo).
2017-08-18 16:06:56 +02:00
Dan Stillman
1efe54e896 Fix #1286, Show proper error messages for OS.File errors 2017-08-17 15:43:54 +02:00
Dan Stillman
13cd84e1be Fix attachment-download test 2017-08-16 01:42:21 +02:00
Adomas Venčkauskas
a5a7df328a Changes imports from connector to save to selected collection
Closes #1289
2017-08-15 11:35:53 +03:00