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
Abe Jellinek
3bfc6740c4
Add tests for improved compareCallNumbers
( #2579 )
2022-04-28 04:43:30 -04:00
Abe Jellinek
89aaa10504
Sort LC call numbers better, sort integers as integers ( #2569 )
...
* Update utilities submodule after https://github.com/zotero/utilities/pull/8
* Extract and add tests
2022-04-26 04:11:29 -04:00
Martynas Bagdonas
b8d427790c
Fix error when using a note template and checking if array is not empty
2022-04-23 14:52:24 +07:00
Abe Jellinek
f91ca9c18a
Don't merge with a deleted master attachment
2022-04-20 11:04:24 -07:00
Abe Jellinek
e8ad2fab95
getSortTitle: Only strip initial punctuation clusters ( #2537 )
...
Specifically exclude @, #, and *
2022-04-15 02:08:14 -04:00
Dan Stillman
08d3880d88
Don't remove relations in annotation item JSON
...
This was causing UUIDs for annotations from Mendeley imports to be
removed after a sync, resulting in annotations being duplicated on a
reimport.
2022-04-14 06:37:30 -04:00
Abe Jellinek
892c1169c8
Attachment merge: Compare link mode type
...
Actually fixes #2527 .
2022-04-11 09:30:16 -07:00
Martynas Bagdonas
2af7275968
Fix template condition evaluating to true for empty string from function
...
Fixes #2529
2022-04-11 12:22:20 +07:00
Abe Jellinek
47a2f3cad9
Attachment merge: Compare linkModes, improve logging
...
Using keys instead of IDs should make logs more useful.
Fixes #2527 .
2022-04-09 20:39:37 -07:00
Abe Jellinek
745069c070
Don't strip punctuation before numbers
...
Fixes #2496
2022-03-30 11:58:55 -07:00
Tom Najdek
56321a7a6d
Fix regression: download() fails for non-http URLs ( #2497 )
...
This fixes compatiblity with some addons that use Zotero.File.download
to extract files from their XPI bundle.
2022-03-30 12:15:40 -04:00
Tom Najdek
776769f480
Citavi import: Tweak how page label is determined ( #2494 )
...
Instead of attempting to extract `PageRange` value we now let pdf worker
always determine page label.
Also improved citavi tests and fixtures.
2022-03-30 09:34:07 -04:00
Dan Stillman
1d1adbca70
Fix error merging items with missing attachment files
...
Fixes #2453
2022-03-24 06:39:47 -04:00
Dan Stillman
174f1aadde
Fix error adding group item before syncing in Zotero 6
...
Fixes #2440
2022-03-21 22:50:43 -04:00
Abe Jellinek
bca76319ce
getSortTitle: Strip less punctuation, trim ( #2442 )
...
Now it:
1. Strips punctuation at the beginning, no matter what it is.
2. Strips non-dash punctuation in other positions.
3. Trims the result.
This should better prevent numerical ranges from being joined into a
single number that ends up incorrectly being sorted to the very bottom.
2022-03-21 20:06:27 -04:00
Dan Stillman
3ec883a7f6
Get attachment text on-demand if not cached in Item::attachmentText
...
Follow-up to 58f515058
with a better approach: if no full-text cache
file, just get text directly without indexing. In the one existing use
of `attachmentText`, attachment merging, this is better anyway, because
we might be deleting the file, so there's no point wasting time
inserting words into the database.
2022-03-12 20:22:29 -05:00
Dan Stillman
46ff3cf4fb
Add pending test for merging items with unindexed attachments by content
...
Follow-up to 58f51505
2022-03-12 19:11:39 -05:00
Martynas Bagdonas
78e1e8593a
Fix note template condition evaluating to true on empty array
...
Fixes #2386
2022-03-11 17:04:47 +02:00
Abe Jellinek
ef82becf00
Merge attachments and update notes ( #2336 )
...
We follow a different merge procedure for each attachment type:
- For PDF attachments, compare by MD5. If no match, get the top 50 words
in the attachment's text and hash those, then check again for a match.
Update references to item keys in notes and annotations.
- For web (snapshot / link) attachments, compare by title and URL.
Prefer a title + URL match but accept a title-only match.
- For other attachment types, keep all attachments from all items being
merged.
Also:
- Move most merge tests from Duplicates to Items#merge(). It just doesn't
make sense to worry about the UI in these.
2022-03-09 17:26:26 -05:00
Tom Najdek
8e8b03e5ff
Fix Citavi import test ( #2394 )
2022-03-09 14:04:23 -05:00
Tom Najdek
1ad2056674
Add support for importing Citavi annotatons ( #2351 )
2022-03-09 04:06:44 -05:00
Dan Stillman
c7ece79f79
Fix missing creators not being removed in item.fromJSON()
...
Apparently there's been a bug for years where removing a creator
remotely hasn't caused it to be removed locally via sync...
https://forums.zotero.org/discussion/94910/desktop-app-not-correctly-syncing
2022-03-09 02:43:22 -05:00
Dan Stillman
8b7afcf24c
Fix utilities_item tests after adding Preprint in 053d6a011
...
Attachments and notes are now mapped to CSL `document` (though it
shouldn't be possible to export attachments or notes to CSL JSON anyway)
2022-03-05 07:41:42 -05:00
Dan Stillman
1ce47bc404
Add Preprint item type to additional sample data for tests
2022-03-05 07:23:50 -05:00
Dan Stillman
32fc1cad9c
Add Preprint item type to sample data for tests
2022-03-05 06:03:44 -05:00
Martynas Bagdonas
b7f26c47c1
Split annotation if position data exceeds the limit
2022-02-28 20:10:20 +02:00
Dan Stillman
90531ea2a4
Fix notifier test after 078e3bb079
2022-02-21 19:22:29 -05:00
Dan Stillman
9cdcb2fd7c
Fix DB timeout test after 078e3bb079
2022-02-21 16:58:57 -05:00
Adomas Venčkauskas
9ca617a6a9
Fix broken tests in 000599b
2022-02-21 14:06:20 +02:00
Abe Jellinek
48a3235a2e
Disable Delete/Restore menu items appropriately ( #2340 )
2022-02-20 11:45:53 -05:00
Dan Stillman
b54b7edf9b
Don't set author name of current user when copying annotation from group
...
Fixes #2358
2022-02-19 13:47:28 -05:00
Dan Stillman
72ac453a8c
Set createdByUserID
to current user for locally created group item
...
Addresses #2322
2022-02-19 13:47:28 -05:00
Dan Stillman
5eee488e20
Update utilities submodule
...
And add tests for `Utilities.Internal.noteToTitle()`
Follow-up to zotero/utilities@df2dda23b
2022-02-19 13:43:41 -05:00
Martynas Bagdonas
5405da99db
Add support for annotation templates ( #2359 )
2022-02-18 14:38:36 -05:00
Dan Stillman
b99aeae76e
Add DB test for combination of numbered and unnumbered query placeholders
2022-02-17 01:43:39 -05:00
Dan Stillman
cb2df23580
Add tests for directoryContains()
...
Follow-up to #2335
2022-02-10 03:18:06 -05:00
Dan Stillman
54eb13ce9e
Fix annotation-copying tests after bacc5b4428
2022-02-09 00:07:58 -05:00
Dan Stillman
bacc5b4428
Preserve explicit annotation author name when copying from group
2022-02-08 23:57:49 -05:00
Dan Stillman
f684984b07
Copy annotations across libraries
...
Based on option in prefs
When copying an annotation group the
2022-02-08 06:38:32 -05:00
Dan Stillman
67451dffd5
Add annotationAuthorName
property to annotation items
...
And pass both `authorName` and `lastCreatedByUser` to the PDF reader.
The former can either come from `createdByUser` or be set directly on
the item (for group annotations dragged to personal libraries).
2022-02-08 06:38:32 -05:00
Dan Stillman
60f9a0417f
Remove isAuthor
from JSON passed to PDF reader
2022-02-08 06:38:32 -05:00
Dan Stillman
cec1f18670
Fix nesting of resetUnsyncedLibraryFiles() test
2022-01-31 06:48:05 -05:00
Dan Stillman
df64a16b55
Disallow unowned group annotation edits, but allow deletions
...
Update `DataObject::isEditable()` to take an optional `op` argument to
test individual operations as opposed to general library editing.
Erasing objects now tests `erase`, and `Item::isEditable()` allows
`erase` for unowned group annotations while disallowing the default
`edit`.
It's still up to the reader to handle this appropriately in the UI and
not allow operations it shouldn't, but this enforces it in the data
layer.
2022-01-31 06:48:05 -05:00
Dan Stillman
5a0cd78f06
Enable PDF reader by default and enable for groups
...
"Zotero" is now the first and default option in the "Open PDFs using"
drop-down in the General pane of the preferences.
2022-01-31 06:48:05 -05:00
Dan Stillman
819dc7f6f4
Include "Zotero/[version]" in file sync requests
...
To avoid blocking by some institutional firewalls
https://forums.zotero.org/discussion/93510/general-sync-error
2021-12-27 15:54:12 -05:00
Dan Stillman
3dab64ddbb
Fix error deleting some orphaned or invalid WebDAV files
...
If a .prop file was passed to `_deleteStorageFiles()`, it would throw
`deletePropURI.QueryInterface is not a function`.
2021-12-27 14:53:28 -05:00
Dan Stillman
71248b591d
Better handling of export option for notes in items list context menu
...
- Show "Export Note…"/"Export Notes…" if only notes or attachments
selected
- Don't show export option if only attachments and no embedded notes
(was previously disabled, and still is if all notes or a mixture of
empty notes and attachments)
2021-12-26 23:50:15 -05:00
Dan Stillman
24104dc685
Fix error generating context menu for multiple standalone attachments
...
Regression from f161d167ae
2021-12-26 23:15:47 -05:00
Dan Stillman
1e1969a089
Fix getBestAttachmentState()
tests after b0ba7e464
2021-12-22 05:23:16 -05:00
Dan Stillman
04fa066a14
Delete items with unmodified delete key when not in collections
...
Closes #2209
2021-12-21 03:19:13 -05:00
Dan Stillman
abe8c39c5b
Ignore blank tags when saving from translator
...
Instead of throwing an error
2021-12-19 03:01:59 -05:00
Adomas Ven
44b6cd0525
citeproc-rs support ( #2220 )
...
Disabled under zotero.cite.useCiteprocRs by default
2021-12-15 17:28:41 -05:00
Martynas Bagdonas
19977598eb
Markdown note export ( #2214 )
2021-12-15 06:10:58 -05:00
Dan Stillman
644c4e5925
Add objects from failed download requests to sync queue
...
Previously only individual objects from successful requests that
couldn't be processed for some reason would be added to the queue.
`Sync.APIClient.downloadObjects()` now returns clearer and more
consistent results. It now returns an array of promises for objects with
a `keys` array of requested keys and either a `json` array of returned
API JSON objects or an `error` Error, depending on whether the request
succeeded or failed. This makes it easier to detect remotely missing
objects and request failures.
2021-12-10 05:56:46 -05:00
Adomas Ven
4405b59044
Add a function to download PDFs via a browser ( #2248 )
...
Fixes zotero/translators#2739
2021-12-02 04:27:33 -05:00
Dan Stillman
f772a0db7b
Fix item tree test on macOS
2021-11-25 03:54:26 -05:00
Dan Stillman
07df7d0dec
Fix standalone notes not being added to collections on RDF import
...
This includes the `Zotero.RDF.getResourceURI()` fix in
zotero/translate@85b39a5be .
This position change here for `this._handleRelated()` for attachments
isn't necessary, since the attachment is already saved and already has
an id, but it's done for consistency with the call for notes (where the
note previously didn't yet have an id).
2021-11-25 00:24:56 -05:00
Tom Najdek
092459dbfc
Mendeley Import: Tests for group annotations
...
Extended Mendeley Import test to include a scenario where other users
attached an annotation to an item in a group library that also exists
in user's library.
2021-11-15 11:39:57 +01:00
Tom Najdek
7664fedf70
Mendeley Import: Test skipping mismatched annotations
2021-11-15 11:37:34 +01:00
Tom Najdek
f10649483e
Mendeley Import: Add more tests for the importer
...
Also rephrased a comment in the importer code and renamed tests file
to mendeleyImportTest.js for consistency.
2021-11-15 11:19:19 +01:00
Dan Stillman
f5eb99ad4c
Upload settings in batches of 250
...
Closes #2000
2021-11-07 23:46:54 -05:00
Abe Jellinek
cd3304e16c
Don't reset isRead when feed item metadata changes ( #2215 )
...
This prevents metadata changes from clearing the isRead status of feed
items as long as GUIDs remain constant. Previously, feed items with
randomized properties (like URLs generated dynamically each time the
feed is served) would be incorrectly marked as unread on every update.
2021-11-05 23:16:12 -04:00
Abe Jellinek
2cf436c67d
Async web translation ( #2229 )
2021-11-05 23:12:37 -04:00
Tom Najdek
7940915bb0
Fix arXiv ID not imported. Fix #2236 . ( #2238 )
...
Mendeley online schema uses "arxiv", local DB uses "arxivId" hence it
was skipped. This commit adds mapping and a test.
2021-11-04 15:32:35 -04:00
Tom Najdek
882ecc205e
Mendeley import: Remove code to patch after earlier imports ( #2234 )
...
Fixes #2233 , Mendeley import: Invalid-field-for-type error
2021-11-03 23:32:36 -04:00
Tom Najdek
a08c3dee14
Add tests for Zotero.File.download #2216
...
This test covers couple of scenarios downloading a 16MB file from a
local http server (simple and concurrently) using Zotero.File.download.
When running current implementation, this seems to fail persistently.
In real-world usage, current implementation seems to work
intermittently, failing more often for larger files.
This intermittent behaviour is most likely cause of #2216 .
2021-10-02 00:39:09 +02:00
Dan Stillman
647afbb089
Update related box if related items are renamed or deleted
2021-09-14 01:50:58 -04:00
Dan Stillman
c5d89f6d07
Temporarily disable a tree test
...
Triggered by 4fa7070a31
, but I think it's just a problem with
`ensureRowsAreVisible()` in the HTML tree
2021-08-31 07:27:49 -04:00
Dan Stillman
952663de73
Fix failing repo notice tests
2021-08-29 04:41:52 -04:00