Commit Graph

103 Commits

Author SHA1 Message Date
Gabriel Horner
5399278bb6 fix: page-exists? not returning anything for db graphs
Caused some buggy page creation. While [?b :block/tags ?db-ident] for an
individual db-ident, it doesn't work when db-ident is a destructure :in
arg. For that case only integers worked
2024-12-17 22:04:29 +08:00
Gabriel Horner
f391f19e7b fix: logseq.class/Tag did not have a Tag leading to
buggy exceptions for :logseq.class/Tag anywhere :block/tags queries
:logseq.class/Tag is used e.g. validation, page existence and querying.
Perhaps before 89cdf5f9f6940dba48cacd82056ad62253ce46c7, this wasn't
possible because of the way the graph was initialized. Also removed
one parent assertion for previous fix since we didn't need both
assertions to prevent a regression
2024-12-17 22:04:29 +08:00
Gabriel Horner
5036b976ab fix: Tag and Property not storing their parents correctly
They weren't visible on their Root Page but bigger bug is that their
:logseq.property/parent wasn't storing or querying correctly.
Also changed their parent to Root as they aren't dependent on Page
and no need to make bootstrapping more complex
2024-12-17 22:04:29 +08:00
Tienson Qin
37747507d1 fix: lint 2024-12-17 22:04:28 +08:00
Tienson Qin
1979b70b32 fix: db tests 2024-12-17 22:04:28 +08:00
Tienson Qin
a97714e7fe fix: tests 2024-12-17 22:04:27 +08:00
Tienson Qin
c5fa699db0 Replace more :block/type 2024-12-17 22:04:27 +08:00
Gabriel Horner
bcdd162145 fix: queries with default values
and objects that are descendants of a tag with
a default-value property. Fixes
https://test.logseq.com/#/page/67551ea7-bd58-48bb-a0ea-8b976fa94423.
Also extended sqlite.build to allow closed value properties to
be configured with :build/properties
2024-12-09 12:11:06 -05:00
Tienson Qin
cc27407699 fix: store #tag as #[[uuid]] internally 2024-11-30 17:12:15 +08:00
Tienson Qin
faf7f48860 refactor: internal ref uses [[uuid]] instead of ~^[[uuid]] 2024-11-30 17:12:15 +08:00
Tienson Qin
471d413d80 Rename checkbox-default-value to scalar-default-value 2024-11-25 14:38:22 +08:00
Gabriel Horner
ce18010b2b refactor: Decouple simple queries in db graph
from original *property rules by giving simple queries
their own rules. This allows simple queries to grow in functionality
and complexity without affecting other features. Also fixed
private-property rule wasn't working because deps weren't configured
2024-11-21 17:56:58 -05:00
Tienson Qin
ab360c3d91 fix: db dep tests 2024-11-19 18:08:17 +08:00
Tienson Qin
d4a30cfbc1 Add more small rules 2024-11-19 18:08:17 +08:00
Tienson Qin
78c409b44c Add full-deps test 2024-11-19 18:08:17 +08:00
Gabriel Horner
cc126c009c refactor: Mv creation of initial views blocks for db graph
to initial transact!. Db graph should have everything it needs with
initial transact. With views page in new db graphs, test was able to
catch a bug, views page wasn't marked as a built-in? when it is
2024-11-14 11:44:37 -05:00
Gabriel Horner
230e74fcd6 fix: tests and doc strings 2024-11-07 21:34:37 -05:00
Gabriel Horner
3755175bcb fix(regression): property/has-property rules return
properties and not internal attributes like :block/title and
:block/created-at
2024-11-07 10:51:26 -05:00
Tienson Qin
e086c4d621 fix: tests 2024-11-04 19:51:23 +08:00
Tienson Qin
b1516bb219 fix: db dep tests 2024-10-31 22:39:09 +08:00
Tienson Qin
998fc66132 Merge branch 'feat/db' into refactor/assets 2024-10-08 11:54:31 +08:00
Gabriel Horner
939dd23f79 chore: use test helpers across db tests
instead of copied and pasted versions
2024-09-27 14:54:03 -04:00
Gabriel Horner
2b782c601b chore: add db tests and start a logseq.db testing ns
Add acceptance test for newer validations and some useful unit tests for
untested fns at different layers
2024-09-27 14:28:30 -04:00
Gabriel Horner
5167523521 fix: db tests and frontend+db lints 2024-09-24 13:10:32 -04:00
Gabriel Horner
b093d11666 fix: test without assertion 2024-09-16 08:43:49 -04:00
Tienson Qin
7b9acaa370 fix: lint 2024-09-15 12:36:30 +08:00
Tienson Qin
4a42168dc3 fix: tag inheritance only going one level deep
fixes https://github.com/logseq/db-test/issues/88
2024-09-15 12:29:23 +08:00
Tienson Qin
68ad7f4f19 refactor: use nanoid for user classes and properties
This commit doesn't affect old idents because RTC is not supported yet
and all new user idents will be `:user-or-whatever-namespace/nanoid`.
2024-09-12 22:57:21 +08:00
Gabriel Horner
12f5215d6c fix: db tests missing correct setup with new class 2024-09-06 18:51:19 -04:00
Tienson Qin
c7677c813e refactor: set parent for any page, not just tags (#11494)
* refactor: replace :class/parent with :logseq.property/parent

* replace :class/schema.properties with property.class/properties

* enhance: display schema properties directly in Tag properties

* tag properties style tweaks

* fix: properties view context

* fix: limit parent to be classes or pages depends on the current node

* enhance: display ancestors in Parent

* fix: ancestors

* enhance: display tag properties always for tags

* enhance: display tag block container instead of properties area

* enhance: show add property as popup instead of dialog

* fix: tag parent must be a tag

* enhance: display properties in the right sidebar

* fix: tags style

* fix: icon style

* fix: positioned icons

* fix: lint

* fix: tests

* fix: remove properties from rtc watched attrs

* fix: graph-parser tests

* enhance: style tweaks

* enhance: page/create parses tags from user-input title

* enhance(ux): [[ref]] followed by # (no whitespace) to add tags

* fix: tests

* fix: graph-parser lint and tests

* fix: allow tagged nodes to be parents

* enhance(ux): display tag property descriptions

Also, make it editable.
2024-09-03 07:32:38 +08:00
Gabriel Horner
eff0d5e7d4 refactor: db ident generation with tests
Add tests for recent db ident fixes. Add check that backup keyword is valid
edn. Also generate correct keyword for cases like logseq/db-test#4 as
catch should be relied only for unexpected cases
2024-08-19 15:17:20 -04:00
Tienson Qin
f46372b346 chore: keep using class instead of tag for internal usage 2024-08-06 07:15:41 +08:00
Tienson Qin
411b05e7ba Prefer to use ldb/{type}? check when possible 2024-08-05 17:51:24 +08:00
Tienson Qin
4083a2d0a0 enhance: prefer tag instead of class on UI
Some users are confused with Classes/Objects, so on UI it'll be
Tags/Nodes.
2024-08-05 15:06:54 +08:00
Tienson Qin
8bef1d7742 Merge branch 'refactor/boolean-not-ref-type' into refactor/single-block-type 2024-08-03 15:37:17 +08:00
Tienson Qin
4cb9cb63a6 Merge branch 'feat/db' into refactor/single-block-type 2024-08-03 15:34:40 +08:00
Tienson Qin
3a9fc0628e fix: db test 2024-08-02 23:22:32 +08:00
Tienson Qin
04e32b33d2 fix: more outdated :page type 2024-08-02 22:37:08 +08:00
Gabriel Horner
0769583183 fix: more missed renames of :page to :node type
from #11433
2024-08-02 10:34:35 -04:00
Tienson Qin
d26e620a82 refactor: update :block/type to cardinality one instead of many 2024-07-31 19:35:26 +08:00
Gabriel Horner
3767f1d3c7 chore: rename task class ident
Only class ident name that wasn't capitalized and didn't match its
title. Considered renaming :logseq.task but unsure if it even makes
sense for their names to match since they aren't sharing a common ns.
:logseq.task may be better off under :logseq.property.*
2024-07-30 17:09:27 -04:00
Tienson Qin
a44f6c27d5 Merge branch 'feat/db' into refactor/narrow-gap-between-page-and-block 2024-07-21 11:34:49 +08:00
Gabriel Horner
60cd9b00da fix: db import of namespaced page created invalid class
Encountered this with docs graph. Part of LOG-3176
2024-07-12 12:32:48 -04:00
Tienson Qin
d847023dc1 Refactor: rename :block/content to :block/title 2024-07-10 22:33:44 +08:00
Tienson Qin
a1f352773b refactor: rename :block/original-name to :block/title 2024-07-10 21:43:03 +08:00
Gabriel Horner
057d6b459f fix: :url property values with macros
Macros in :url are useful for having urls with a common hostname that
can be configured once. Without this fix, docs graph is invalid
2024-07-08 13:34:28 -04:00
Gabriel Horner
f7b753758c fix: tests with outdated :block/type assertions
also fix lint
2024-07-08 09:51:29 -04:00
Gabriel Horner
e24b386079 Bump nbb with latest datascript
Test fixes are reasonable as datascript catches more invalid uses of
query
2024-06-27 18:07:44 -04:00
Gabriel Horner
c772b0cdd1 fix: migrate built-in? property to use :checkbox
Can now delete temporary :boolean type
2024-06-25 15:02:25 -04:00
Gabriel Horner
16248f0bd2 fix: unable to build :default property for sqlite.build
Also add tests for different built-in cases and addressed
related TODO
2024-06-18 16:29:01 -04:00