Commit graph

33 commits

Author SHA1 Message Date
Dan Stillman
d389a71280 Download remotely updated files in "as needed" file sync mode
Previously, files updated remotely wouldn't be downloaded in "as needed"
mode if a copy of the file already existed locally and could only be
re-downloaded by deleting the file via Show File.

This causes remotely modified files that exist locally to be downloaded
at sync time, even in "as needed" mode, by marking them as
"force_download". While this might not be ideal for people who use "as
needed" to limit data transfer, it's better for people who use it simply
to limit local storage, and ending up with an outdated file while
offline seems worse than a little bit of extra data transfer.

In the future, we'll likely also provide ways to explicitly download and
remove files, so keeping chosen files in sync makes sense.

Files modified remotely before this change (which were marked as
"to_download" instead of "force_download") won't be downloaded as sync
time in "as needed" mode, but they'll now be re-downloaded on open.

Fixes #1322
2020-03-09 01:19:52 -04:00
Dan Stillman
5c03813d81 Add Retracted Items virtual collection
Shown automatically when retracted items are detected
2019-06-10 02:38:42 -04:00
Philipp Zumstein
97e53c5230 Fix some typos found by codespell (#1570)
$ codespell --skip="./.git,./styles,./translators,./chrome/locale,./resource,./chrome/content/zotero/xpcom/xregexp,./chrome/content/zotero/xpcom/rdf,./chrome/content/zotero/xpcom/citeproc.js,./test/resource,./node_modules" -q 2 -i 3 -w
2019-01-20 20:39:27 -05:00
Dan Stillman
d5e7bae254 Fix broken test after ec76575645 2018-08-19 04:31:40 -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
f7e2cd6348 Isolate test from 531170353b 2017-10-01 22:43:18 -04:00
Dan Stillman
531170353b Fix bidirectional relations on Duplicate Item 2017-10-01 22:04:11 -04:00
Dan Stillman
13cd84e1be Fix attachment-download test 2017-08-16 01:42:21 +02:00
Dan Stillman
9202ab8b3c Download missing attachments as needed even in at-sync-time mode 2017-08-11 16:06:06 +02:00
Dan Stillman
5ff2a59f87 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.
2017-04-12 19:26:58 -04:00
Dan Stillman
4da0c4c1fc Remove unused laststoragesync response from test 2017-04-12 05:37:15 -04:00
Dan Stillman
a9a54ed21c Set API URL via pref for download-on-demand test 2016-12-21 08:23:31 -05:00
Dan Stillman
ce5328cbc4 Don't trigger translator loading in download-on-demand test
This was causing later tests to time out.
2016-11-20 02:46:04 -05:00
Dan Stillman
0016c5ecf8 Fix editing of saved search in a group 2016-10-20 22:55:42 -04:00
Dan Stillman
4dc6ef3045 Fix #1100, Deleting collection also deletes items 2016-09-27 02:10:14 -04:00
Dan Stillman
1adb8d74f0 Properly save search when using "New Saved Search…" menu option 2016-09-23 21:03:00 -04:00
Dan Stillman
2ebd7bd114 Update search test after c1f7a188e2
c1f7a188e2 changed createDataObject('search') to create 2 search conditions
instead of 1
2016-07-07 08:39:19 -04:00
Dan Stillman
893b9ae1fc Show "Duplicate Items" and "Unfiled Items" for all libraries by default
Previously they only showed for My Library by default, which I suspect
meant that most people didn't know you could get them for other
libraries...

This hides "Duplicate Items" and "Unfiled Items" from the context menu
when they're active, which may or may not be desirable (but we don't
show, say, "Trash" in the context menu).

Also tweaks selection behavior after hide to select next appropriate row
instead of the parent library.
2016-07-02 03:15:37 -04:00
Adomas Ven
2cce099928 Add custom view groups for different library types (#1042)
I originally attempted this with zotero-persist and column attributes,
but there is no good way to make it succinct paramswise and the code was
painful to look at too. Thus different group settings are stored in
preferences.

Currently there are two view groups: "feed" and "default". Items view
columns have two new attributes:
`default-in` - a space separated list of views in which a column is
visible by default
`disabled-in` - a space separated list of views in which a column is
disabled by default (invisible + not possible to enable)

Fields not parsed for feeds are now disabled.
2016-06-28 20:12:54 -04:00
Dan Stillman
b7b246e741 Saved search fixes
- Fix saved search editing
- Refresh items list on search change
- Generate correct conditions array for search JSON
2016-03-26 04:14:56 -04:00
Dan Stillman
fc6c113f25 Show intro text for My Publications in middle pane when no items
ZoteroPane.setItemsPaneMessage() and setItemPaneMessage() can now
optionally take a DOM node instead of a string.

Closes #705
2016-03-24 09:03:59 -04:00
Dan Stillman
6b509820b3 Fixes #918, Enabling "Show Unfiled Items" or "Show Duplicates" breaks UI 2016-03-13 20:31:15 -04:00
Dan Stillman
0fc91a4ef2 Tests for showing/hiding virtual folders 2016-03-12 05:03:47 -05:00
Dan Stillman
daf4a8fe4d Deasyncification 🔙 😢
While trying to get translation and citing working with asynchronously
generated data, we realized that drag-and-drop support was going to
be...problematic. Firefox only supports synchronous methods for
providing drag data (unlike, it seems, the DataTransferItem interface
supported by Chrome), which means that we'd need to preload all relevant
data on item selection (bounded by export.quickCopy.dragLimit) and keep
the translate/cite methods synchronous (or maintain two separate
versions).

What we're trying instead is doing what I said in #518 we weren't going
to do: loading most object data on startup and leaving many more
functions synchronous. Essentially, this takes the various load*()
methods described in #518, moves them to startup, and makes them operate
on entire libraries rather than individual objects.

The obvious downside here (other than undoing much of the work of the
last many months) is that it increases startup time, potentially quite a
lot for larger libraries. On my laptop, with a 3,000-item library, this
adds about 3 seconds to startup time. I haven't yet tested with larger
libraries. But I'm hoping that we can optimize this further to reduce
that delay. Among other things, this is loading data for all libraries,
when it should be able to load data only for the library being viewed.
But this is also fundamentally just doing some SELECT queries and
storing the results, so it really shouldn't need to be that slow (though
performance may be bounded a bit here by XPCOM overhead).

If we can make this fast enough, it means that third-party plugins
should be able to remain much closer to their current designs. (Some
things, including saving, will still need to be made asynchronous.)
2016-03-07 17:03:58 -05:00
Dan Stillman
9fb85a263a Fix LIKE errors in Fx44
In Fx44, SQL queries must use '?' with LIKE and cannot concatenate a
placeholder string (e.g., 'foo%'). This is for Sqlite.jsm only, so it
doesn't affect 4.0.
2016-02-03 01:13:30 -05:00
Dan Stillman
c5a9987f37 WebDAV file sync overhaul for 5.0
Also:

- Remove last-sync-time mechanism for both WebDAV and ZFS, since it can
  be determined by storage properties (mtime/md5) in data sync
- Add option to include synced storage properties in item toJSON()
  instead of local file properties
- Set "Fake-Server-Match" header in setHTTPResponse() test support
  function, which can be used for request count assertions -- see
  resetRequestCount() and assertRequestCount() in webdavTest.js
- Allow string (e.g., 'to_download') instead of constant in
  Zotero.Sync.Data.Local.setSyncState()
- Misc storage tweaks
2015-12-30 05:14:50 -05:00
Dan Stillman
08cb63f66d Fix various cases of saving items to selected collection
This changes Zotero.Translate.Base.translate() to take an options object (in
order to take a 'collections' parameter, which is passed to the
Zotero.Translate.ItemSaver constructor). The old parameters are still supported
with a deprecation warning, and there may be other places that still need to be
updated.
2015-11-15 17:49:31 -05:00
Dan Stillman
73f4d28ab2 ZFS file sync overhaul for API syncing
This mostly gets ZFS file syncing and file conflict resolution working
with the API sync process. WebDAV will need to be updated separately.

Known issues:

- File sync progress is temporarily gone
- File uploads can result in an unnecessary 412 loop on the next data
  sync
- This causes Firefox to crash on one of my computers during tests,
  which would be easier to debug if it produced a crash log.

Also:

- Adds httpd.js for use in tests when FakeXMLHttpRequest can't be used
  (e.g., saveURI()).
- Adds some additional test data files for attachment tests
2015-10-29 04:38:27 -04:00
Dan Stillman
31af26af08 Fix selection of new items 2015-05-25 21:48:47 -04:00
Dan Stillman
0e33d1ef46 Disable spuriously failing test
waitForItemsLoad() isn't waiting for the item pane message to be updated, so
this test fails.
2015-05-19 04:00:06 -04:00
Dan Stillman
14d435b8d8 Closes #711, Remove support for nested transactions 2015-05-10 18:32:10 -04:00
Dan Stillman
a64282118b Fix items-count updating in right-hand pane
And some other tweaks to ZoteroPane.itemSelected()
2015-05-10 18:30:05 -04:00
Dan Stillman
8fec5ace3a Fix post-save textbox focusing bugs in right-hand pane
Fix a couple cases of lost text field focus after an edit, including
focusing of the Title field after using New Item when a field is already
being edited and has a changed value.

Also, in tests, select My Library and wait for items to load when using
the loadZoteroPane() support function. We could add a parameter to skip
that or move it to a separate function, but the code to detect it is a
bit convoluted and it's a prerequisite for many tests, so it's handy to
have a function for it.
2015-05-04 02:45:55 -04:00