Commit graph

1182 commits

Author SHA1 Message Date
Adomas Venčkauskas
4e1754b960 Change integration test citation style to APA and some refactoring 2022-10-25 14:55:16 +03: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
Dan Stillman
f4dfea6849 Don't repeatedly upload relations
Fixes #2772
2022-08-22 01:12:31 -04:00
Dan Stillman
8379540719 Include proper test for b373291c02 for #2771 2022-08-19 02:47:24 -04:00
Dan Stillman
b373291c02 Fixed filed items with annotations appearing in Unfiled Items
Fixes #2771

Regression from 20c6fe67
2022-08-19 00:15:55 -04:00
Abe Jellinek
3391f3bc99
Empty Trash: Visually remove deleted items, refresh icon (#2606)
There were a few problems causing the incorrect behavior:
1. Rows were being removed only if they had no non-deleted children, which
   wasn't the right check. We want to remove all rows with no *deleted*
   children.
2. Children of the removed rows weren't being removed with them.
3. We weren't invalidating the tree (which _removeRows() doesn't do).

Also:

* Erase trashed annotation after getAnnotations() test

Because ItemTree#notify() doesn't yet correctly handle refresh events on
parent items that are themselves children (three-level nesting: item ->
attachment -> annotation), this test was causing a failure in
itemTreeTest.js.
2022-08-18 21:14:34 -04:00
Dan Stillman
f368a53311 Fix and disable item-tree test for emptying trash
20c6fe6737 caused this to start failing, but only because the test was
testing something too specific. The change in that commit caused more
rows to be left behind when emptying the trash (for reasons I should
probably look into), but the trash wasn't being emptied properly before,
which #2606 should fix. This test should be restored as part of that PR.
2022-08-17 01:53:21 -04:00
Dan Stillman
20c6fe6737 Match parent attachments for annotation tags
Expose annotation tags in tag selector and match parent attachments when
filtering/searching

This also fixes searching for annotation text or comments when using
Everything quick search.

This is temporary until we display annotations in the items list
directly.
2022-08-16 22:56:39 -04:00
Dan Stillman
85b0c9dbad Fix importing of standalone attachments without URLs
And allow `importSnapshotFromFile()` without `parentItemID` or
`libraryID`, which is more consistent with other attachment functions

Follow-up to 318e4852e9

https://forums.zotero.org/discussion/comment/414802/#Comment_414802
2022-08-14 05:06:27 -04:00
Dan Stillman
318e4852e9 Fix importing of standalone attachments
Maybe has been broken for years?

https://forums.zotero.org/discussion/99020/warning-data-loss-when-exporting-collections
2022-08-13 16:23:00 -04:00
Dan Stillman
3dc3359cff Don't relate book sections to each other when creating from book
Fixes #2757
2022-08-13 05:45:23 -04:00
Dan Stillman
b505c630d3 Fix copying of standalone attachments between libraries
Regression in f684984b07 (maybe a race condition)
2022-08-13 02:00:41 -04:00
Dan Stillman
9b7b4fe134 Improve test for event-title substitution
And add comments

Follow-up to 20d0f103f
2022-08-10 01:34:57 -04:00
Dan Stillman
a9c3fc7790 Reset Zotero.locale to 'en-US' after cite test 2022-08-10 01:01:48 -04:00
Dan Stillman
20d0f103fd Automatically substitute event-title for event in styles
Stopgap until styles are updated in citation-style-language/styles#6151
2022-08-10 01:01:48 -04:00
Abe Jellinek
20eca3781d Add test for 87455d 2022-08-08 11:48:33 -04:00
Abe Jellinek
ad96323881
Duplicates Merge: Preserve embedded annotations (#2728) 2022-07-29 05:06:44 -04:00
Martynas Bagdonas
6733f2edca Freeze note schema version to 8
We can do it because it was only used to create a note from annotations.

No need to update schema version in Zotero client, unless using new
features when creating a note from annotations.
2022-07-25 18:04:00 +03:00
Dan Stillman
14a6ce000e Disable sort tests from 26a5e2900a for now
Until I can figure out the race-condition breakage they trigger later in
the file
2022-07-18 08:56:57 -04:00
Dan Stillman
acba90f272 Fix test failure after 26a5e2900a 2022-07-11 05:19:18 -04:00
Dan Stillman
26a5e2900a Better fix for errors from invalid sort fields
Just catch the error from `ItemTree::sort()` and clear the
secondary-sort and fallback-sort prefs so that sorting works on the next
attempt.

Replacement for a8ed30ce80

https://groups.google.com/g/zotero-dev/c/kc0-C6-SA74/m/bhHniGceAQAJ
2022-07-11 01:30:38 -04:00
Dan Stillman
34d66381d1 Revert "Validate fields in ItemTree::getSortFields()"
This reverts commit a8ed30ce80 and related
commits.

We'll address breakage from invalid sort fields another way, without
inconveniencing plugin authors.

https://groups.google.com/g/zotero-dev/c/kc0-C6-SA74/m/bhHniGceAQAJ
2022-07-11 00:43:15 -04:00
Dan Stillman
56e7f0a10f Fix sorting by Item Type and feed item itemID
Regression from a8ed30ce80
2022-07-10 17:31:01 -04:00
Dan Stillman
cf8819cc06 Add localized string for timestamp CSL locator
Not included in the CSL locales:

https://forums.zotero.org/discussion/comment/412060/#Comment_412060
2022-07-09 18:07:07 -04:00
Dan Stillman
c5dbf0169f
Merge pull request #2693 from tnajdek/mendeley-import-improve-feedback
Multiple improvements to Mendeley importer
2022-07-09 01:43:50 -04:00
Abe Jellinek
3f282fc25f
recursiveCollections: Remove from all subcollections on delete (#2689) 2022-07-09 01:37:14 -04:00
Dan Stillman
629892b0b8 Add CSL 1.0.2 locators and switch to CSL locales for localization
And move Page to middle of list, while still selecting by default

https://forums.zotero.org/discussion/comment/396602/#Comment_396602
2022-07-09 01:00:07 -04:00
Dan Stillman
2ff67c987e Fix test failure after a8ed30ce8
We added a `toggleSort()` call on the title, so then when called again
it reverses the direction. To avoid, sort by creator and then title in
the second test.
2022-07-08 06:44:10 -04:00
Dan Stillman
a8ed30ce80 Validate fields in ItemTree::getSortFields()
To avoid startup hang if a plugin does something bad:

https://forums.zotero.org/discussion/comment/411843/#Comment_411843

Fixes #2692
2022-07-08 06:01:23 -04:00
Tom Najdek
d418d79e70
Fix a bug in regex extracting fields to "extra"
Because regex is built using a template string, \s* is actually escaped
into s*, i.e. literal "s" appearing 0 or more times. In most cases this
would mean that output can have spacing slightly off. In extreme case,
when identifier starts with letter "s", this could this could lead to
identifier being stored incorrectly.

Also adjusted tests to be more strict and mock data to cover this case.
2022-07-07 13:40:40 +02:00
Dan Stillman
b215d93ac9 Update utilities submodule and date-parsing tests
Includes strToDate() fixes
2022-06-22 04:41:33 -04:00
Dan Stillman
7b20972c27 Use String.fromCharCode() to load Chinese characters in strToDate() test
Follow-up to dc045250a6
2022-06-09 00:03:34 -04:00
Dan Stillman
dc045250a6 Fix parsing of Chinese and other non-ASCII month names
https://forums.zotero.org/discussion/97683/bug-locale-issues-concerning-zotero-and-zotero-connector
2022-06-08 23:45:18 -04:00
Dan Stillman
2b45b7fea3 Fix Emoji detection
And move to Zotero.Utilities.Internal.isOnlyEmoji()

Fixes #2643
2022-06-07 20:12:29 -04:00
Abe Jellinek
d8069fac50
Fix sorting by attachment (#2586) 2022-06-07 01:32:27 -04:00
Dan Stillman
deabf3f042 Fix support tests after 28ed3e34b 2022-05-24 04:32:05 -04:00
Dan Stillman
419f74379b Feed import: Don't fail on OPML entry with no title or text
https://forums.zotero.org/discussion/96841/impossible-dimporter-ompl-rss
2022-05-20 00:33:25 -04:00
Abe Jellinek
9829ea7009
Update utilities, move tests, add to CI (#2584) 2022-04-30 04:55:11 -04:00