mirror of
https://github.com/logseq/logseq.git
synced 2026-04-27 15:45:00 +00:00
Add initial tests on property handler
This commit is contained in:
@@ -11,10 +11,12 @@
|
||||
(defn lookup
|
||||
"Get the value of coll's (a map) `key`. For file and db graphs"
|
||||
[coll key]
|
||||
(let [repo (state/get-current-repo)]
|
||||
(if (and (config/db-based-graph? repo)
|
||||
(keyword? key))
|
||||
(when-let [property (db/entity repo [:block/name (gp-util/page-name-sanity-lc (name key))])]
|
||||
(let [repo (state/get-current-repo)
|
||||
property-name (if (keyword? key)
|
||||
(name key)
|
||||
key)]
|
||||
(if (config/db-based-graph? repo)
|
||||
(when-let [property (db/entity repo [:block/name (gp-util/page-name-sanity-lc property-name)])]
|
||||
(get coll (:block/uuid property)))
|
||||
(get coll key))))
|
||||
|
||||
@@ -47,4 +49,4 @@
|
||||
(get-property block :logseq.tldraw.page))
|
||||
|
||||
(defn shape-block? [block]
|
||||
(= :whiteboard-shape (get-property block :ls-type)))
|
||||
(= :whiteboard-shape (get-property block :ls-type)))
|
||||
|
||||
Reference in New Issue
Block a user