浏览代码

fix: remove last {{query reference seen in db graphs

Also fix return val of previous commit
Gabriel Horner 1 年之前
父节点
当前提交
d4b7720573

+ 1 - 1
deps/common/src/logseq/common/util.cljs

@@ -233,7 +233,7 @@
      (reader/read-string opts content)
      (reader/read-string opts content)
      (catch :default e
      (catch :default e
        (log/error :parse/read-string-failed e)
        (log/error :parse/read-string-failed e)
-       {}))))
+       nil))))
 
 
 (defn safe-read-map-string
 (defn safe-read-map-string
   "Reads an edn map string and returns {} if it fails to parse"
   "Reads an edn map string and returns {} if it fails to parse"

+ 2 - 3
src/main/frontend/components/query.cljs

@@ -168,9 +168,8 @@
               :result result
               :result result
               :group-by-page? (query-result/get-group-by-page q {:table? table?})}]
               :group-by-page? (query-result/get-group-by-page q {:table? table?})}]
     (if (:custom-query? config)
     (if (:custom-query? config)
-      [:code (if dsl-query?
-               (util/format "{{query %s}}" query)
-               "{{query hidden}}")]
+      ;; Don't display recursive results when query blocks are a query result
+      [:code (if dsl-query? (str "Results for " (pr-str query)) "Advanced query results")]
       (when-not (and built-in? (empty? result))
       (when-not (and built-in? (empty? result))
         [:div.custom-query (get config :attr {})
         [:div.custom-query (get config :attr {})
          (when (and (not db-based?) (not built-in?))
          (when (and (not db-based?) (not built-in?))

+ 1 - 3
src/main/frontend/db/query_dsl.cljs

@@ -646,7 +646,7 @@ Some bindings in this fn:
     {:block/_parent ...}])
     {:block/_parent ...}])
 
 
 (defn query
 (defn query
-  "Runs a dsl query with query as a string. Primary use is from '{{query }}'"
+  "Runs a dsl query with query as a string. Primary use is from '/query' or '{{query }}'"
   ([repo query-string]
   ([repo query-string]
    (query repo query-string {}))
    (query repo query-string {}))
   ([repo query-string query-opts]
   ([repo query-string query-opts]
@@ -705,8 +705,6 @@ Some bindings in this fn:
   (string/includes? query' (str "(" filter-name)))
   (string/includes? query' (str "(" filter-name)))
 
 
 (comment
 (comment
-  ;; {{query (and (page-property foo bar) [[hello]])}}
-
   (query "(and [[foo]] [[bar]])")
   (query "(and [[foo]] [[bar]])")
 
 
   (query "(or [[foo]] [[bar]])")
   (query "(or [[foo]] [[bar]])")