mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 19:06:21 +00:00
Fix page-properties bug and dsl-query bug
parser test caught page properties bug and dsl-query tests once written correctly exposed another bug. Also remove unit test as they are replaced by integration style tests in graph-parser-test
This commit is contained in:
@@ -234,12 +234,20 @@
|
||||
(= 4 (count e))
|
||||
(build-between-three-arg e)))
|
||||
|
||||
|
||||
(defn parse-property-value
|
||||
"Parses non-string property values or any page-ref like values"
|
||||
[v]
|
||||
(if-some [res (text/parse-non-string-property-value v)]
|
||||
res
|
||||
(text/split-page-refs-without-brackets v)))
|
||||
|
||||
(defn- build-property-two-arg
|
||||
[e]
|
||||
(let [k (string/replace (name (nth e 1)) "_" "-")
|
||||
v (nth e 2)
|
||||
v (if-not (nil? v)
|
||||
(text/parse-property-value (str v))
|
||||
(parse-property-value (str v))
|
||||
v)
|
||||
v (if (coll? v) (first v) v)]
|
||||
{:query (list 'property '?b (keyword k) v)
|
||||
@@ -284,7 +292,7 @@
|
||||
(let [[k v] (rest e)
|
||||
k (string/replace (name k) "_" "-")]
|
||||
(if (some? v)
|
||||
(let [v' (text/parse-property-value (str v))
|
||||
(let [v' (parse-property-value (str v))
|
||||
val (if (coll? v') (first v') v')]
|
||||
{:query (list 'page-property '?p (keyword k) val)
|
||||
:rules [:page-property]})
|
||||
|
||||
Reference in New Issue
Block a user