Commit graph

11129 commits

Author SHA1 Message Date
Dan Stillman
a51d0068b1 Update cross-library item drag test after 2dd16b44d 2021-08-17 08:26:55 -04:00
Dan Stillman
dd6e7e916e Ignore items in target library trash for cross-library drags
Just don't consider items in the trash to be linked items in
item.getLinkedItem(). I'm not totally sure why we didn't do this many
years ago, since it's one of the biggest sources of confusion in Zotero.

This addresses #1648 and closes #1610, though not by undeleting and
overwriting the item in the trash. When deleting an item and then
re-dragging it from another library, I think most people would expect
the item in the trash to still exist (possibly with notes, etc.), rather
than having been automatically restored and overwritten with new data.
2021-08-17 08:26:55 -04:00
Dan Stillman
4617001d58 Remove accidental .only() in test from fdcd4e51c5 2021-08-17 08:26:55 -04:00
Dan Stillman
562c344b2e Handle additional cases of conflicting translators
And fix test failure from bde9a74f9d in CI, where the file list order is
different
2021-08-17 07:55:17 -04:00
Dan Stillman
69ebb59563 Fix regression in b8ad18e96d
We're relying on Bluebird's synchronous promise inspection for noWait
translate mode (as used in Quick Copy). We should decide if we want to
keep the Bluebird dependency or rewrite this to use native promises
(e.g., with a separate synchronous `_loadTranslator()` function for
noWait mode), but for now just restore the `Zotero.Promise.method()`.
2021-08-17 07:55:17 -04:00
Dan Stillman
3b64b55f31 Fix broken detection after error loading a translator's code
The bug fixed in bde9a74f9d was triggering an error getting code for a
deleted search translator, which due to this bug caused a double
complete() call that got detection all out of sync, which caused some
search translators to be skipped, which resulted in ISBN lookup
failures.
2021-08-17 07:55:17 -04:00
Dan Stillman
5ede06941f Clear caches properly when deleting duplicate translator
Among other things, if the name of a translator was changed, until
restart Zotero.Translators.getAllForType() would return the old cache
entry pointing to a file that no longer existed.
2021-08-17 07:55:17 -04:00
Adomas Venčkauskas
a6db2d0db1 Fix word plugin state display in the Pref dialog 2021-08-17 07:55:17 -04:00
Dan Stillman
3794b14dea Massively speed up tests
- Make a copy of the database after first initialization that can be
  swapped in when reinitializing in resetDB()
- Avoid unnecessary one-second delay on every reset

Probably more that can be done, but this should take minutes off the
test runs
2021-08-17 07:55:17 -04:00
Dan Stillman
fa59e2096f Changes to colored tag toggling via keyboard
- Update Date Modified when toggling tags via keyboard
  (https://forums.zotero.org/discussion/90371/bug-toggling-a-colored-tag-with-number-keys-doesnt-update-date-modified)
- If any selected items don't have the tag, add it to all items, instead
  of deciding based on the first item
  (https://forums.zotero.org/discussion/79900/minor-issue-related-to-colored-tags)
2021-08-17 07:55:17 -04:00
Abe Jellinek
9333d8cc2c Make resolveURL available to translators (#2101) 2021-08-17 07:55:17 -04:00
Tom Najdek
db428ad90f Blur active field in switchCreatorMode #2087 (#2088) 2021-08-17 07:55:17 -04:00
Abe Jellinek
d5175640a6 Correct creator fields in OpenURL (#2079)
There is no isInstitution field, so OpenURL search was producing invalid
data for items with institutional authors. Instead we use the name field
in API JSON and the isInstitution flag in internal JSON.
2021-08-17 07:55:17 -04:00
qqobb
381b2753ce Run JavaScript: Improve await regex (#2083)
Tests: https://regex101.com/r/eQYCIp/1
2021-08-17 07:55:17 -04:00
Dan Stillman
57596d72e7 Autocomplete improvements
- Limit field autocomplete to current library in item pane (previously
  only done for creator and access date)
- Improve positional parameter usage to avoid duplicate parameters
- Code cleanup
2021-08-17 07:55:17 -04:00
Dan Stillman
01a5e9b6ae Don't trigger 'redraw' event on attachment download 404
There's no need to refresh the attachments column of the item row if
nothing was downloaded.

Also remove some unnecessary logging
2021-08-17 07:55:17 -04:00
Martynas Bagdonas
8c5297f573 Provide filename for recognizer server 2021-08-17 07:55:17 -04:00
Dan Stillman
cfcdd8356d Don't cache SQL statements during initialization
From executeSQLFile()
2021-08-17 07:55:17 -04:00
Dan Stillman
6d511b75e5 Add attr()/text() to search translators 2021-08-17 07:55:17 -04:00
Dan Stillman
8360d7e7b6 Fix descendant collections not skipping delete log
If a collection was deleted with `skipDeleteLog: true`, descendant
collections still ended up in the delete log, which could cause
constant "Reset Group and Sync" prompts.

https://forums.zotero.org/discussion/89485/warning-when-syncing-group-library
2021-08-17 07:55:17 -04:00
Dan Stillman
619fb691fa Avoid memory leaks from caching unique DB statements
Many DB statements that were being cached included embedded ids or temp
table names, so they would permanently use memory and never get reused.
During large imports, this could result in hundreds of megabytes of
extra memory usage.

This commit marks many more statements as `noCache`, adds `noCache`
support for column and value queries, adds a log line at DB shutdown in
source builds with the number of cached statements, and adds
Zotero.DB.getCachedStatements() for auditing of cached statements.

Addresses #1531
2021-08-17 07:55:17 -04:00
Dylan
78f1a54dd1 Fix dark theme on Item Type 2021-08-17 07:55:17 -04:00
Dan Stillman
1e4dc7e855 Don't make 'engine' required in Sync.Storage.Request
Follow-up to dc12a2c95a
2021-08-17 07:55:11 -04:00
Dan Stillman
91cb3c8543 Return sooner in _checkForUpdatedFile() on SYNC_STATE_TO_UPLOAD
Before file.stat() instead of after, though it probably doesn't really
matter because the file is already open, which makes the stat call much
faster
2021-08-17 07:26:37 -04:00
Dan Stillman
3298a375d7 Stop file upload queue after low-quota errors
We weren't making actual upload requests after a quota error if the file
would exceed the quota, but we were still going through all attachments
to upload, which in some cases involves making stat() calls. We now just
stop the queue immediately after a quota error or when starting a new
background sync after a previous quota error.

Closes #1255
2021-08-17 07:26:03 -04:00
Dan Stillman
abbb9fa079 Update submodules 2021-04-15 06:29:18 -04:00
Adomas Venčkauskas
70dc203dbe Add an optional callback for Integration.initPipe(). Addresses #2031 2021-04-15 05:59:04 -04:00
Dan Stillman
1e0aa85f6f Fix disambiguation-related hang in citeproc-js
This reverts the fix for
https://github.com/Juris-M/citeproc-js/issues/171 to fix the hang in
https://github.com/Juris-M/citeproc-js/issues/179
2021-04-15 05:59:04 -04:00
Dan Stillman
b720874450 Fix Zotero.automatedTest in GitHub Actions
$TRAVIS → $CI

Some tests were being run that should be skipped
2021-04-15 05:59:04 -04:00
Dan Stillman
464597f18d Compress single-file HTML attachments and other text files
The test for ZIP uploads was having multiple files, but now snapshots
are all single files.
2021-04-15 05:42:42 -04:00
Dan Stillman
252cf9a347 Update version 2021-04-15 05:15:15 -04:00
Dan Stillman
d086a7f846 Update version 2021-03-02 07:04:56 -05:00
Dan Stillman
c9eb661f25 Update locales from Transifex 2021-02-25 18:54:07 -05:00
Dan Stillman
b2b909b42c Update submodules 2021-02-25 18:45:28 -05:00
Dan Stillman
33528d0f36 Fix "New Collection" button when My Publications is selected
Fixes #1955
2021-02-25 18:30:33 -05:00
Dan Stillman
ba7f7e3250
Merge pull request #1962 from fletcherhaz/context-menu
Add context menu for React textboxes to Create Parent Dialog
2021-02-25 17:57:09 -05:00
Dan Stillman
a97b7d4369 CI: Switch gem call from --no-ri/--no-doc to --no-document 2021-02-25 16:16:17 -05:00
Dan Stillman
3ff92e2795 Add "More Information" button to invalid-data sync error 2021-02-25 16:08:54 -05:00
Fletcher Hazlehurst
8c00510835 Remove XUL overlay, but keep functionality. 2021-02-24 16:11:19 -07:00
Fletcher Hazlehurst
60d8beece3 Add context menu for React textboxes to Create Parent Dialog 2021-02-22 20:14:07 -07:00
Dan Stillman
d9cf53725a Make Find PDF test timing a bit more forgiving 2021-02-09 17:12:25 -05:00
Dan Stillman
31478d1fba Use multi-line editor for all title fields (e.g., Case Name)
https://forums.zotero.org/discussion/87286/suggestion-multi-line-case-name-display-in-info-panel
2021-02-09 17:05:50 -05:00
Dan Stillman
843bcbb68a Show invalid-data warning in sync button tooltip for group libraries
Instead of showing warning button on toolbar

Otherwise if one person in a group upgrades to a beta with new fields,
everyone in the group will get a warning, even if they're already on the
latest release version. In a personal library, the user can upgrade to
the same version.
2021-02-09 16:36:06 -05:00
Dan Stillman
b919143630 Skip conflict resolution for remote objects that can't be saved
E.g., if a local item has been modified in a way that conflicts with a
remote item that also has a new, unknown field, don't show the CR
window -- just add the item to the sync queue and show the
some-data-could-not-be-downloaded error.
2021-02-07 16:49:01 -05:00
Dan Stillman
254695f4b3 Skip extra sync download after some conflicts
If an upload fails with a 412, and then we download, and then we go to
upload but there was nothing to upload (e.g., because the remote version
was chosen or there was an error saving it), there's no reason to do a
download again after that.
2021-02-07 16:38:14 -05:00
Dan Stillman
61e29aa8eb Don't set non-working 'tooltiptext' in React Button
Follow-up to ba9c7ae739
2021-02-06 23:51:28 -05:00
Dan Stillman
e9e434cd2e Fix tooltips for tags box icons
Addresses #1947

If we're going to need this regularly we should just create a React
Image element that does this automatically for 'title'.
2021-02-06 23:51:11 -05:00
Dan Stillman
01819d68d1 Show tag selector Actions menu on mousedown, not click 2021-02-06 23:37:56 -05:00
Dan Stillman
ba9c7ae739 Fix 'title' attribute on React Button component
E.g., Actions menu in tag selector

Neither 'title' (HTML) nor 'tooltiptext' (XUL) works on HTML elements in
XUL documents, so add a mechanism to fake tooltip behavior and use it in
our Button component. This can be triggered by other React components if
necessary.

This is (mostly) mirroring Firefox tooltip behavior, which is a bit less
sophisicated than macOS behavior. If we end up using this for
everything, we can improve the behavior (e.g., start the delay when
entering the element, not when the mouse stops).

Fixes #1947
2021-02-06 23:37:32 -05:00
Dan Stillman
cf132fdd29 Log POST request body for server requests 2021-02-05 17:51:59 -05:00