Commit graph

1339 commits

Author SHA1 Message Date
Tom Najdek
223f44fdfd Map annotation colors colors on import #2819 (#2822) 2022-09-12 19:58:21 -04:00
Dan Stillman
a63c634e3f 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-12 15:54:03 -04:00
Dan Stillman
e81b43be98 Add collectionID option to EditorInstance.createNoteFromAnnotations()
For adding a standalone note to the current collection
2022-09-12 15:54:03 -04:00
Dan Stillman
39e45221b1 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-12 15:54:03 -04:00
Dan Stillman
497d6376c8 Add Zotero.Item::topLevelItem and Zotero.Items.getTopLevel(items) 2022-09-12 15:54:03 -04:00
Martynas Bagdonas
f70ec29881 EditorInstance.createNoteFromAnnotations(): Handle multiple attachments 2022-09-12 15:54:03 -04:00
Abe Jellinek
5d6ad703c1 Preferences: Fix tests, improve clarity, and more
- Fix sync and advanced preferences tests; use a new waitForFirstPaneLoad()
  functions instead of the old paneload event listener
- Remove empty preferences_searchTest.js
- Rename some Zotero_Preferences members/functions for better clarity and
  public/private differentiation
- Reorder, also for clarity
- Fix tabIndex parameter causing an error if invalid
- Remove window.sizeToContent() call in Sync.displayFields()
    - So *that's* why the window resized every time the sync pane was loaded...
- Deprecate openURL() and simplify openInViewer()
2022-09-02 11:01:37 -04:00
Dan Stillman
00b24f85c9 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:46:58 +02:00
Abe Jellinek
63864f2f86
duplicateAndConvertSelectedItem: Don't copy abstracts (#2799) 2022-08-29 16:15:31 -04:00
Dan Stillman
170f1962ad Don't repeatedly upload relations
Fixes #2772
2022-08-22 01:15:21 -04:00
Dan Stillman
5103d904f3 Include proper test for b373291c02 for #2771 2022-08-19 12:05:30 -04:00
Dan Stillman
e9e1add9b8 Fixed filed items with annotations appearing in Unfiled Items
Fixes #2771

Regression from 20c6fe67
2022-08-19 12:05:30 -04:00
Abe Jellinek
22b00c33de 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-19 09:14:24 -04:00
Dan Stillman
d3d6a6be48 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 03:35:54 -04:00
Dan Stillman
c3ee588bfe 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-17 03:35:28 -04:00
Dan Stillman
6cd1a41a32 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-16 06:09:00 -04:00
Dan Stillman
676abca671 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:24:14 -04:00
Dan Stillman
d546caca4c Don't relate book sections to each other when creating from book
Fixes #2757
2022-08-13 05:46:04 -04:00
Dan Stillman
344a10421a Fix copying of standalone attachments between libraries
Regression in f684984b07 (maybe a race condition)
2022-08-13 02:04:07 -04:00
Dan Stillman
c90f8415b3 Improve test for event-title substitution
And add comments

Follow-up to 20d0f103f
2022-08-11 03:57:25 -04:00
Dan Stillman
ebacb83563 Reset Zotero.locale to 'en-US' after cite test 2022-08-11 03:57:20 -04:00
Dan Stillman
7eab91a160 Automatically substitute event-title for event in styles
Stopgap until styles are updated in citation-style-language/styles#6151
2022-08-11 03:57:15 -04:00
Abe Jellinek
df5bde79e5 Add test for 87455d 2022-08-11 03:57:09 -04:00
Abe Jellinek
1f9e518581 Duplicates Merge: Preserve embedded annotations (#2728) 2022-08-11 03:52:40 -04:00
Martynas Bagdonas
d595b3f195 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-08-11 03:50:06 -04:00
Dan Stillman
1e5fd2d551 Disable sort tests from 26a5e2900a for now
Until I can figure out the race-condition breakage they trigger later in
the file
2022-08-11 03:46:56 -04:00
Dan Stillman
612fec8961 Fix test failure after 26a5e2900a 2022-08-11 02:48:39 -04:00
Dan Stillman
d3942ad1f0 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-08-11 02:48:35 -04:00
Dan Stillman
d747da7c65 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-08-11 02:48:31 -04:00
Dan Stillman
3ab661b628 Fix sorting by Item Type and feed item itemID
Regression from a8ed30ce80
2022-08-11 02:48:16 -04:00
Dan Stillman
2c11aadc57 Add localized string for timestamp CSL locator
Not included in the CSL locales:

https://forums.zotero.org/discussion/comment/412060/#Comment_412060
2022-08-11 02:47:46 -04:00
Abe Jellinek
b18967fba4 recursiveCollections: Remove from all subcollections on delete (#2689) 2022-08-11 02:47:28 -04:00
Dan Stillman
387e4dd958 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-08-11 02:47:15 -04:00
Dan Stillman
fea99bf8f8 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-08-11 02:47:09 -04:00
Dan Stillman
92a1a43cbb 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-08-11 02:47:04 -04:00
Tom Najdek
141258d564 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-08-11 02:46:37 -04:00
Dan Stillman
5920c5d3e5 Update utilities submodule and date-parsing tests
Includes strToDate() fixes
2022-08-11 02:36:04 -04:00
Dan Stillman
3fb9e2162e Use String.fromCharCode() to load Chinese characters in strToDate() test
Follow-up to dc045250a6
2022-08-11 02:34:06 -04:00
Dan Stillman
56151a4198 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-08-11 02:33:58 -04:00
Dan Stillman
011b60af61 Fix Emoji detection
And move to Zotero.Utilities.Internal.isOnlyEmoji()

Fixes #2643
2022-08-11 02:33:41 -04:00
Abe Jellinek
3481def4f6 Fix sorting by attachment (#2586) 2022-08-11 02:33:03 -04:00
Dan Stillman
65318a442e Fix support tests after 28ed3e34b 2022-08-11 02:29:44 -04:00
Dan Stillman
cb2594f53f Feed import: Don't fail on OPML entry with no title or text
https://forums.zotero.org/discussion/96841/impossible-dimporter-ompl-rss
2022-08-11 02:28:03 -04:00
Abe Jellinek
8d75f37548
fx-compat: Add preferences with full-text/keyword search (#2659) 2022-08-10 18:26:23 -04:00
Adomas Venčkauskas
41907975b0 Adjust integration function comments and test dummy signature 2022-07-26 10:53:05 +03:00
Abe Jellinek
8face792c0
fx-compat: Fix search dialogs (#2631) 2022-07-04 01:48:52 -04:00
Dan Stillman
f827b9ef50 fx-compat: initKeyEvent()new KeyboardEvent()
Quick Format change is untested
2022-06-21 03:31:58 -04:00
Dan Stillman
587ae6ba7e fx-compat: Fix blurring of textarea fields in item box
And fix tests
2022-06-21 03:03:37 -04:00
Dan Stillman
563f91bf18 Rename zoteroIntlTest.js to intlTest.js 2022-06-21 01:39:31 -04:00
Dan Stillman
bbdcb92042 Add missing test data files 2022-06-21 01:39:07 -04:00