Commit graph

1346 commits

Author SHA1 Message Date
Adomas Venčkauskas
31fc418a97 Add a test for feed update scroll issues. See b213b8f1 2023-04-17 12:29:41 +03:00
Dan Stillman
9a7486e53c Prevent setting search .name to empty value
Prevents bug in zotero-citation plugin (at least on macOS) from creating
a search that breaks syncing

We were already checking for a missing name in `saveTx()`, but the
plugin is saving the same search twice in rapid succession, the second
time without a name, and the second attempt clears the search object's
name value after the first save's `_initSave()` check and before its SQL
write. The second save fails, but the first save goes through without a
name, resulting in a sync error.

https://forums.zotero.org/discussion/104274/id-1702002152-cannot-sync
https://github.com/MuiseDestiny/zotero-citation/issues/31
2023-04-11 23:48:07 -04:00
Dan Stillman
1d6cae08d2 Add '#' to default annotation color
And add test
2023-04-09 17:03:50 -04:00
Dan Stillman
49b08df0dd Update test sample data for authority/legislativeBody base mapping 2023-04-03 00:43:55 -04:00
Dan Stillman
23ebf277fe Write out path when generating item type/field data for tests
It writes to the build folder, so it's easy to think it's not working.
2023-03-23 01:37:29 -04:00
Dan Stillman
42a4649420 Add Dataset and Standard item types
zotero/zotero-bits#22
zotero/zotero-bits#52
2023-03-23 01:37:29 -04:00
Dan Stillman
b298a48cda Better way of skipping migration of Place and Date from Extra
Or at least a way that we already have built-in and that only applies to
the call in `Zotero.Item::migrateExtraFields()`. This doesn't
distinguish between CSL fields (`publisher-place`, `event-place`,
`issued`) and actual Zotero field, and we really only need to skip
the former, but it's fine.

Follow-up to 8a1dd3637, related to #3030
2023-03-21 06:29:50 -04:00
Dan Stillman
8a1dd3637c Temporarily disable extracting Issued from Extra
Until we can parse ranges in the Date field. See #3030.

citeproc-js will still use it (which is the point).
2023-03-21 05:55:08 -04:00
Tom Najdek
c57c3c470e
Mendeley importer: Fix issue with empty tags (#3018)
Also adds a test for this particular case and for importing tags in
general.
2023-03-09 16:13:19 -05:00
Tom Najdek
a1d06066b2
Mendeley importer: Fix issue with empty creators (#3016)
It does not appear to be possible to create a creator with no values in
Mendeley, however we got reports of these causing the imports to fail.
This tweak makes the importer more resilient by discarding empty/invalid
creators.
2023-03-07 19:40:42 -05:00
Adomas Ven
0f9024dc98
Remove firefox-zotero IPC pipe and switching code (#2990) 2023-02-13 19:18:40 -05:00
Dan Stillman
bbf72bfbcf Fix some lint errors in Zotero.Retractions 2023-02-05 21:50:29 -05:00
Dan Stillman
b924720a2d Detect retractions for DOIs with capital letters
https://forums.zotero.org/discussion/102745/retraction-watch-not-working
2023-02-05 21:50:29 -05:00
Adomas Ven
0ffe3122c2
Refactor l10n code. Remove use of react-intl. (#2975)
Strings from .dtd files are now accessible from Zotero.getMessage
as the eventual move to Fluent would remove their distinction.
2023-01-17 15:59:19 -05:00
Dan Stillman
21777af980 Fix incorrect retries if multiple HTTP.request() calls get 500s
https://forums.zotero.org/discussion/comment/425814/#Comment_425814

The passed intervals array was modified, so after a request() got a 500,
subsequent calls would start with longer delays and eventually start
retrying immediately.
2023-01-11 02:32:39 -05:00
Dan Stillman
7e61be9799 Disable /connector/request tests from 86c56951df
Until we restore the new header handling
2022-12-25 04:01:35 -05:00
Dan Stillman
0862e1e1bc Revert "Zotero.HTTP.request(): Process headers case insensitively"
This reverts commit f6dd47dd1f.

I shouldn't have cherry-picked this from fx102.
2022-12-24 03:55:15 -05:00
Abe Jellinek
f6dd47dd1f Zotero.HTTP.request(): Process headers case insensitively
Using the Headers class from the Fetch API.

Before, the added test would fail: `_requestInternal()`, not finding a header
named `Content-Type` (case sensitive), would set it to
`application/x-www-form-urlencoded`. XMLHttpRequest, upon being given both
`content-type`: `application/json`) and `Content-Type`:
`application/x-www-form-urlencoded`, would helpfully merge the two, producing
`content-type`: `application/json, application/x-www-form-urlencoded`. That's
obviously not the correct behavior.
2022-12-23 21:42:36 -05:00
Abe Jellinek
86c56951df Add /connector/request endpoint 2022-12-23 21:42:36 -05:00
Tom Najdek
91c385a67a Add option to Mendeley importer to relink items
New option only appears if importer version is < 1 or not present.
It will:
    * Skip fetching collections and attachments
    * Skip any new items
    * Update relations on existing items
2022-12-17 04:31:55 -05:00
Adomas Venčkauskas
3d8bbb3e55 Link Mendeley citations in documents to imported items. Closes #2622 2022-11-29 16:27:36 +02:00
Dan Stillman
f33cf1cde3 Don't show items with annotated attachments after moving to trash
https://forums.zotero.org/discussion/100775/deleted-items-keep-reappearing-in-my-library

Regression from 20c6fe67
2022-11-28 04:30:50 -05:00
Adomas Venčkauskas
2db90511f9 Import URL from XPCOM code instead of relying on window for Proxy code
Also fix other failing proxy tests. Closes #2928
2022-11-21 11:51:18 +02:00
Adomas Venčkauskas
8135895313 Fix proxy test 2022-11-21 11:28:52 +02:00
Dan Stillman
89bc094690 Fix response content type in Find Available PDF test 2022-11-16 18:35:31 -05:00
Dan Stillman
1a1c08890f Use clearer name for Find Available PDF tests 2022-11-16 18:35:31 -05:00
Dan Stillman
a48e0f2437 Handle relative PDF links when using custom PDF resolver 2022-11-16 18:35:31 -05:00
Tom Najdek
d131fe3dc9
Mendeley Import: Auth using direct login
* Importer will now ask user for a login and password via form and will perform sign-in directly
  using credentials rather than oauth
* Signing in this way enables importer to obtain desktop document ID which is now stored for each
  item
* It's possible to switch back to the old method (ouath) by setting `import.mendeleyUseOAuth` pref
  to `true`.
* New option to only import new items. This options only appears if database contains previously
  imported items.
* Importer will now update mendeleyDB:documentUUID on existing items to match value used in Mendeley
  Desktop if available
* Importer will no longer create collections when no new items are imported
* Importer will only report number of new items imported on re-import
* Importer will now preserve dateAdded on re-import

Co-authored-by: Dan Stillman <dstillman@zotero.org>
2022-11-13 12:47:29 +01:00
Adomas Venčkauskas
378d8180e8 Adjust tests to not use the dotsToHyphens proxy option 2022-11-10 12:46:40 +02:00
Martynas Bagdonas
6bc1551f7f Increase wait time for pdf-reader iframe initialization in tests
This is necessary until a proper initialization promise is added to pdf-reader.
2022-10-31 18:03:42 +02:00
Dan Stillman
5cea183ae3 Avoid infinite/excessive loops in Find Available PDF
https://forums.zotero.org/discussion/100634/potential-infinite-loop-when-trying-to-find-available-pdf

Closes #2883
2022-10-30 04:53:09 -04:00
Dan Stillman
fe09afa0a6 Restore cell.csl for style tests
Removed in 4e1754b960
2022-10-26 05:14:47 -04:00
Dan Stillman
ab2bec936e Reset accidental change from 7fcc1d35 2022-10-26 04:38:19 -04:00
Adomas Venčkauskas
7db16843b3 Add an integration test for citation merging 2022-10-25 14:55:19 +03:00
Adomas Venčkauskas
a4eafd0307 Fix wrong given name disambiguation after editing author for citeproc-js
Closes #2870
2022-10-25 14:55:16 +03:00
Adomas Venčkauskas
4e1754b960 Change integration test citation style to APA and some refactoring 2022-10-25 14:55:16 +03:00
Dan Stillman
7fcc1d35a4 Reset note Quick Copy pref on upgrade if set to Markdown + Rich Text
The default JSON pref value used spaces, but changing the drop-down
resulted in a version without spaces, so simply changing the default to
include the new link options wouldn't change all existing installs and
the "Include App Links" checkbox wouldn't show as enabled for Markdown.
This adds a pref migration step to reset the pref to the new default if
it's set to Markdown + Rich Text, regardless of whitespace differences.
2022-10-22 16:41:48 -04:00
Dan Stillman
2b9e9c174f Don't match all attachments with annotations for "not" search conditions
Fixes #2867
2022-10-17 23:59:29 -04:00
Martynas Bagdonas
78eb857e73 Add annotation update test to pdf-reader tests 2022-10-11 18:07:03 +03:00
Martynas Bagdonas
7bada8ce0c Tweak pdf-reader annotation creation test 2022-10-10 17:09:30 +03:00
Martynas Bagdonas
af436d34a8 Add pdf-reader annotation creation test 2022-10-10 16:53:42 +03:00
Abe Jellinek
fb4f7b7932 Automatically relink attachments from LABD (#2374)
Fixes #2092
2022-10-08 02:29:31 -04:00
Tom Najdek
88217492f9
Map annotation colors colors on import #2819 (#2822) 2022-09-12 19:57:24 -04:00
Dan Stillman
66fccec6b4 Add "Create Note from Annotations" option to items list context menu
To allow creation of a standalone note with annotations from all the
selected top-level items and/or attachments. Annotations will be sorted
by the order of the items in the items list.

"Add Note from Annotations" remains when a single regular item or one or
more attachments under a single regular item are selected.
2022-09-05 10:37:07 -04:00
Dan Stillman
894309d061 Add collectionID option to EditorInstance.createNoteFromAnnotations()
For adding a standalone note to the current collection
2022-09-05 10:37:07 -04:00
Dan Stillman
b24c7577ec Rename Zotero.Items::keepParents() to keepTopLevel()
So that it works for more than two levels of items

Also fix a bug where the parent item could be returned more than once if
multiple child items were selected.
2022-09-05 10:37:07 -04:00
Dan Stillman
ca4ced1e9f Add Zotero.Item::topLevelItem and Zotero.Items.getTopLevel(items) 2022-09-05 10:37:07 -04:00
Martynas Bagdonas
6646be66d0 EditorInstance.createNoteFromAnnotations(): Handle multiple attachments 2022-09-05 10:37:07 -04:00
Dan Stillman
91ae576074 Fix HTTP.request() 5xx handling with errorDelayMax=0
This was causing delay-less infinite loops for OPTIONS requests to Box,
which are returning 502 errors.
2022-08-29 23:44:55 +02:00
Abe Jellinek
c255104ada duplicateAndConvertSelectedItem: Don't copy abstracts (#2799) 2022-08-29 16:27:26 -04:00