Commit Graph

415 Commits

Author SHA1 Message Date
Gabriel Horner
3c838bc243 fix: disallow changing property cardinality from :many to :one
for existing data as it leads to invalid data. Fixes LOG-3164
2024-06-24 14:10:23 -04:00
Gabriel Horner
0ea8a414f2 chore: move and rewrite outliner.property tests
Moved tests to be next to implementation. Rewrote some tests
so that they matched common usage of fns and rewrote some tests
so that each fn is tested independently
2024-06-23 23:47:08 -04:00
Tienson Qin
1c22c78c94 chore: remove buggy and rough template
Also, :object kinda works like template, and we also plan to
support templates on Classes.
2024-06-23 22:22:33 +08:00
Tienson Qin
eb245e5a76 fix: lint 2024-06-23 17:58:15 +08:00
Tienson Qin
caf1af1911 enhance: bring back inline tags support 2024-06-23 17:50:51 +08:00
Tienson Qin
797b13ac78 fix: lint and test 2024-06-21 18:09:20 +08:00
Tienson Qin
30230b38ca fix: test 2024-06-21 14:04:42 +08:00
Tienson Qin
b0c03b0003 fix: tests 2024-06-21 12:50:29 +08:00
Tienson Qin
0b38900d70 fix: blocks->vec-tree 2024-06-21 11:31:52 +08:00
Gabriel Horner
eae2156f6c chore: move and add create-property-text-block tests 2024-06-19 23:01:44 -04:00
Gabriel Horner
c23513eaa8 fix: non :default property reuses existing entities
Also add tests for this and a common set-block-property case
2024-06-19 22:17:03 -04:00
Tienson Qin
adae8ef5eb fix: get-block-and-children returns sorted blocks
Fix unit tests
2024-06-20 07:56:30 +08:00
Gabriel Horner
b35f30e203 fix: circular dependency between outliner and frontend
by moving batch-tx into outliner dep. Outliner dep is
now fully independent and we are able to write unit tests
for all outliner namespaces unlike before
2024-06-19 17:21:22 -04:00
Tienson Qin
71dc122a75 fix: copy block properties doesn't work
Fixes LOG-3160
2024-06-20 00:39:08 +08:00
Gabriel Horner
de730e236a fix: outliner lint 2024-06-18 11:03:55 -04:00
Gabriel Horner
ee77145caf fix: :checkbox property not working in simple queries and rules
Also fix booleans not rendering in query table
2024-06-18 10:38:09 -04:00
Tienson Qin
c3f30a9dc9 fix: lint 2024-06-18 21:37:12 +08:00
Tienson Qin
0bd6c05e69 refactor: add page outliner ops
The rule is to avoid calling worker modules from UI, all db
transactions should go through apply-outliner-ops.
2024-06-18 05:21:00 +08:00
charlie
5b0ed592f0 fix(ux): sometimes the block children can't be collapsed 2024-06-17 17:54:19 +08:00
Gabriel Horner
244a86557f chore: rename :property/value to :property.value/content
property-value is widely being used to refer to the entity or value
associated with a property entity. Naming the content of a
property-entity :property/value is confusing. property-value content is
a unique name and consistent with :block/content. Also rename related
fns which had similarly confusing names
2024-06-14 18:11:20 -04:00
Gabriel Horner
9a8c91c0cc chore: mv logseq.db.sqlite.db into sqlite.cli
for more explicit name and purpose. Also updated outdated db readme
and removed unused fns in logseq.db.sqlite.db
2024-06-14 16:53:19 -04:00
Gabriel Horner
8ba5c15f93 fix: remove cli namespace dependency from electron namespaces
Added a :discouraged-namespace linter check for future times.
Had to add clj-kondo configs for db and outliner since they
were incorrectly inheriting the frontend config, specifically
the :discouraged-namespace linter. Also removed a 'm/=>' in outliner dep
b/c it would've created a complex clj-kondo setup for malli that
would need to be updated for both top-level clj-kondo and deps/outliner
2024-06-14 15:50:05 -04:00
Gabriel Horner
95db811f55 fix: frontend tests shouldn't depend on sqlite3
frontend.test.helper was accidentally coupled to sqlite3 via
logseq.outliner.db-pipeline. Split out sqlite3 dependent fns to
logseq.outliner.cli so it's clear this shouldn't be coupled to frontend
2024-06-14 14:41:24 -04:00
Gabriel Horner
137f388edd enhance: property ref values can store their
original value optionally with :property/value.
Currently applies to :url and :number and not :default
as :default is meant to be a block and thus highly coupled
to :block/content. By introducing this, functionality that relies
on original property values automatically work e.g.
sorting by :number property for query results just works
2024-06-13 23:03:18 -04:00
Gabriel Horner
57241d0644 Revert "fix: :block/content should be string including :number properties"
This reverts commit 8a6b44bb31.
2024-06-13 21:25:21 -04:00
Tienson Qin
4d684a5ec9 fix: throw exception if calling db property fns for file graphs 2024-06-13 14:50:20 +08:00
Tienson Qin
0ce2ee42db Revert "refactor: use files instead of sqlite for electron db storage"
This reverts commit c2c5ab80aa.
2024-06-13 13:04:00 +08:00
Gabriel Horner
03f797fde3 fix: outliner lint and doc formatting 2024-06-12 15:24:04 -04:00
Gabriel Horner
1b51d28682 fix: outliner lint 2024-06-11 16:49:14 -04:00
Gabriel Horner
0e1ada2ef6 enhance: bb task for creating graphs from EDN file
Converted inferred graph to an EDN file now that this task exists. Also
merge last of tasks.create-graph to relevant ns so that external users
can also create such tasks
2024-06-11 10:09:37 -04:00
Tienson Qin
c2c5ab80aa refactor: use files instead of sqlite for electron db storage 2024-06-11 08:30:49 +08:00
Tienson Qin
0a77ba077f fix: reuse :block/order if exists when inserting blocks from remote 2024-06-09 11:02:26 +08:00
Tienson Qin
b2e113d8eb refactor: db based filters
Uses properties :logseq.property.linked-references/included-pages
and :logseq.property.linked-references/excluded-pages to store filters
instead of a map.

Fixes LOG-3074
2024-06-08 05:28:55 +08:00
Tienson Qin
9b1da32028 fix: simplify deleting refed blocks
The new implementation will replace refs of the current deleting block
with the nearby block (if exists).
2024-06-06 19:36:40 +08:00
Tienson Qin
8a6b44bb31 fix: :block/content should be string including :number properties 2024-06-06 14:53:26 +08:00
Gabriel Horner
916fef8336 enhance: generate any outline structure with :build/children
Already useful for testing and will be for more interesting generation
cases
2024-06-05 12:15:12 -04:00
Tienson Qin
592e2a9b26 fix: add tags when not exists 2024-06-05 22:39:55 +08:00
Tienson Qin
44366dced0 fix: removing a heading's hashtags doesn't delete
fixes LOG-3138
2024-06-05 20:01:46 +08:00
Tienson Qin
a314e3469a fix: page can alias itself and then fail to load
fixes LOG-3136
2024-06-05 17:18:32 +08:00
Tienson Qin
ed97102b38 fix: can't move block up with a :default property
fixes LOG-3140
2024-06-05 14:08:57 +08:00
Gabriel Horner
14222a546f enhance: make journals easier to generate with :build/journal
Use it in tests that more appropriately belong in db dep.
Also did minor cleanup around page prep for page-uuids
2024-06-04 12:02:25 -04:00
Gabriel Horner
13066001cd fix: storing and querying of :number property values 2024-06-03 17:41:32 -04:00
Gabriel Horner
df10beb325 enhance: add schema and validation to sqlite.build
Also renamed block-level keys that are specific to the ns to have
a :build namespace. A lot easier to read, maintain and extend later.
Also cleaned up page naming to consistently require :block/original-name
2024-06-03 12:46:53 -04:00
Gabriel Horner
2456deb097 enhance: create sqlite.build ns as a better
load-test-files helper for db graphs and deps.
Most of this ns is split off from create-graph.
Migrated pipeline-test to correct outliner dep and
moved previous pipeline-test to correct db dep
2024-06-03 12:46:53 -04:00
Tienson Qin
bce5a308bb perf: skip db storage when batch applying outliner ops 2024-06-03 14:53:06 +08:00
Gabriel Horner
1dd9823fdf fix: remove alias ref to avoid recursive display bug
A page with aliases resulted in linked references recursively showing the
current page
2024-05-29 13:25:32 -04:00
Gabriel Horner
a4d8e05e2f fix: esc saves a tag class with a :db/ident
Also refactor to update class tests to use correct helper
2024-05-29 11:09:09 -04:00
Gabriel Horner
cc92702a98 chore: remove unused fn when setting prop values 2024-05-29 11:09:09 -04:00
Tienson Qin
f4dd06f959 enhance: display tags the same way as other properties 2024-05-29 15:37:23 +08:00
Gabriel Horner
effde81161 enhance: all user classes have :db/ident
This is important as a user's ontology (properties + classes) is now describable
with unique identifiers. This will allow for easy sharing and
importing of ontologies between users.
Also <create-class! now exists to create classes consistently. Will
be helpful when we want to provide some validation for classes
2024-05-28 16:52:12 -04:00