Commit Graph

387 Commits

Author SHA1 Message Date
Gabriel Horner
8e47c327bf Merge branch 'master' into ben/advanced-queries-relative-date-input 2023-01-20 15:58:40 -05:00
Ben Yorke
f1568dbe24 Pull out testing function for more test abstraction 2023-01-20 18:19:55 +01:00
Ben Yorke
6d1f26fa03 Abstract out helper fn for timestamp react-query-tests 2023-01-20 18:14:54 +01:00
Ben Yorke
a2efbdb333 Add error test conditions 2023-01-20 13:07:29 +01:00
Ben Yorke
ba68a368f4 Add HHMMSS and HHMMSSmmm 2023-01-20 12:53:24 +01:00
Ben Yorke
b6c00254e8 Add tests for time related queries 2023-01-20 12:29:22 +01:00
Gabriel Horner
c804e051cc Add validation for repo config.edn
- Add test, task and schema for repo config.edn
- Also removed no longer needed temp fix
2023-01-18 10:07:52 -05:00
Ben Yorke
417630590a Add explicit tests for :+X-ms and :-X-ms 2023-01-18 14:40:12 +01:00
Ben Yorke
07f58f33d6 Refactor resolve-input to use simple query relative date syntax 2023-01-18 14:08:54 +01:00
Ws
4c33ff05fc fix(zotero): Missing PDF caused by incomplete linked file path. (#7676)
Resolve #6771 #6503
Introduced by #5995

Co-authored-by: Junyi Du <junyidu.cn@gmail.com>
Co-authored-by: Andelf <andelf@gmail.com>
2023-01-17 11:23:19 +08:00
charlie
e70d76589b enhance(pdf): make the weblink pdf filename to be human-readable for the annotations page 2023-01-12 21:04:12 +08:00
Gabriel Horner
ba69f13d34 Allow :rules and built in rules usage
Fixes #8250 and fixes #7201
2023-01-11 11:59:18 -05:00
Gabriel Horner
17f51c7b77 Make resolve-input nbb compatible
- Brought back Xd-{before,after}-ms and tested it
- Move it to its own ns in graph-parser
- Updated nbb-logseq in deps/
- Made db-utils alias consistent
- Organized resolve-input
2023-01-07 02:49:07 -05:00
Gabriel Horner
506faa89c7 Add tests for :current-block and :parent-block
Remove before-ms and after-ms if we don't have a good use case for it
2023-01-07 02:49:07 -05:00
Gabriel Horner
b6abd05a97 Fix inconsistent page links for web/publishing
When coming from search, page links were capitalized but most everywhere else
page links were lower case. This fix consistently enforces lower case
2022-12-22 12:47:33 +08:00
rcmerci
31e6c2c2df fix lint 2022-12-20 17:22:52 -05:00
rcmerci
5287c24cf2 add testcase for get-block-children-ids-in-db 2022-12-20 17:22:52 -05:00
Guy Pursey
6618c1228d Fix: query table sorting (#7751)
* test: sorting for mixed type block properties

* test: edited integer sorting test

Wanted to ensure it included a case where the sorting would
behave different if the numbers were coerced to strings.

In that case, "77" would precede "8" whereas for integer sorting
we want "8" to precede "77".

Renamed `:rating` to `:integer` to reflect this new scenario.

* test: new decimal number test

* test: query table sort semver-style string block properties

* test: query table sort positive and negative integers

* fix: replace separate sort strategies with natural sorting strategy

* fix: comparing only numbers in query table sort

* test: consolidate query table sort integer tests

* format: removed line breaks and consolidated small comparison lines to pass large-vars lint

* Tweaks to PR

- use reader literal for js
- Bring back readability to test, each case should have whitespace
  between it. Split up deftest at a natural spot as deftest exceeds
  reasonable size of a large var

Co-authored-by: Junyi Du <junyidu.cn@gmail.com>
Co-authored-by: Gabriel Horner <97210743+logseq-cldwalker@users.noreply.github.com>
Co-authored-by: Gabriel Horner <gabriel@logseq.com>
2022-12-20 17:02:03 -05:00
Tienson Qin
3e71b1d6f3 fix: db/entity with interger id is not nil with non-exist block (#7723)
fix: returns nil for db/entity if the entity doesn't exist

Co-authored-by: Junyi Du <junyidu.cn@gmail.com>
2022-12-16 00:21:42 +08:00
Gabriel Horner
10d6bc28da Switch named block links to autolink to header blocks
Replaced block property approach as it doesn't provide as much
functionality initially
2022-12-15 11:14:56 -05:00
Gabriel Horner
6e0dea3f2c Add routing test and make ns name consistent 2022-12-15 11:14:56 -05:00
Junyi Du
5ee8707469 chore: merge function util/with-time and util/with-time-number 2022-12-15 20:37:17 +08:00
Junyi Du
199be34244 test: query performance: enlarge test timeout more 2022-12-15 20:37:17 +08:00
Junyi Du
f45317e569 chore: query performance: enlarge test timeout and add dev doc 2022-12-15 20:37:17 +08:00
Junyi Du
a1c60fa58c test: monitor query sort performance in unit test 2022-12-15 20:37:17 +08:00
Junyi Du
dbf13c87d9 fix: query performance degration caused by date normalization 2022-12-15 20:37:17 +08:00
Tienson Qin
73689cc9ef fix: lint warnings 2022-12-14 12:05:46 +08:00
Gabriel Horner
7a5310eb5d Update rewrite-edn and hickory deps
shadow workaround for hickory is no longer needed since hickory got node
support
2022-12-08 10:26:33 +08:00
Gabriel Horner
83d5e57e23 Add validation for global config
- Handles inside and outside logseq editing
- Removed temporary catch's that are no longer needed since invalid global
  config is not allowed
- Add validation for a couple more documented config options
2022-12-07 23:04:55 +08:00
Junyi Du
bd3479abda fix: cache key bindings 2022-12-06 21:00:47 +08:00
Tienson Qin
81f22da35d fix: paste nested blocks 2022-11-29 16:49:13 +08:00
Tienson Qin
f61f0deb78 Merge branch 'cnrpman-page-level-fts' 2022-11-28 10:45:54 +08:00
Gabriel Horner
043fa90dab Merge branch 'master' into mrtracy/ref_sync_fix 2022-11-26 01:10:01 -05:00
Gabriel Horner
e2fe300da7 Move delete-blocks-fn to graph-parser for reuse for nbb
Also:
- Move test to a more appropriate ns - model-test isn't for testing
  higher level parse file behavior
- Delete model fns that are no longer used
- Fix tests which had incorrect target-page-content and were no longer
  testing retractAttribute
- Add options to cli ns for related nbb reuse
- Light cleanup of block deletion
2022-11-26 01:01:36 -05:00
Junyi
b8bb5c9dc6 test: update cases for page content search 2022-11-25 21:26:07 +08:00
Junyi
95d79877c0 feat: highlight page content fts result 2022-11-25 21:26:07 +08:00
Junyi
48445c9149 fix: filename format revert manual title check 2022-11-24 15:57:27 +08:00
Tienson Qin
c44b20ad22 Merge branch 'master' into mrtracy/ref_sync_fix 2022-11-23 14:28:24 +08:00
Gabriel Horner
3440a3d433 Add back fix from #6147 along with its test cases
Also fix testing sexp and reset state
2022-11-23 12:21:36 +08:00
Andelf
674022d4fb test(editor): page-search-hashtag at handle-last-input 2022-11-23 12:21:36 +08:00
Andelf
e31cfb1c65 fix: lint 2022-11-23 12:21:36 +08:00
Andelf
40366f6dbf fix(test): use e2e to test hashtag 2022-11-23 12:21:36 +08:00
Zhizhen He
7fdb9aaffb fix: typo 2022-11-21 17:58:13 -05:00
Gabriel Horner
70a476dde3 Fix up model tests and remove unused rules 2022-11-21 14:02:58 +08:00
Matt Tracy
2848d101b0 Address Review Feedback
- Fixed new page name not being cleared
- Clarified some fn and parameter names
- Added test for reload page w/ title:: property change
2022-11-18 15:35:29 -08:00
Charlie
dd2ef163ba Enhance/PDF viewer (#7369)
* fix(pdf): WIP potential memory leaks
* enhance(pdf): sync page number in highlights metafile
* enhance(pdf): support preview highlight area image in a lightbox
* fix: clojurescript unit tests
* fix(pdf): page number overflow when more digits
2022-11-17 20:31:08 +08:00
Matt Tracy
be7e37e924 Retain block references on file reload
Commit fixes a bug where block references (i.e. `:block/refs`
association in the db) are lost when the page containing the referenced
block is re-loaded due to an update of its underlying file.

Description of Bug:

The bug occurs because when a file is re-loaded to the DB from disk, all existing blocks
belonging to the file are deleted via `retractEntity`, and then blocks
from the parsed file are added. If the file had only had small changes,
the new block set will be very similar to the previous one, although
with different db/ids.

However, while new blocks with "id:: " properties will assume the UUID value
of the previous version of the block, any references to that block via
UUID will *not* be restored in the DB; they are deleted with the
retractEntity command. This results in an inconsistent DB state, where references that should
exist do not.

Description of Fix:

The 'delete-blocks-fn' passed to the graph_parser has been modified as
such:

- It now accepts a list of block uuids to *retain*; graph parser will
  pass the blocks parsed from the new file content.
- For any blocks which match a UUID in the retain list, instead of
  deleting via retractEntity, the individual attributes are deleted via
  retractAttribute (the `retract-attributes` from schema.cljs is used
  for this purpose).
2022-11-16 14:05:19 -08:00
Junyi Du
160793e0d1 fix: some date related issues 2022-11-11 17:32:44 +08:00
Tienson Qin
7038261fad Merge branch 'master' into enhance/ios-folder-picker 2022-11-08 16:06:03 +08:00
Junyi Du
70b41ad7d1 feat: don't rename capitalization 2022-11-08 15:12:00 +08:00