fix: tags in page graph

also add fixmes
pull/10438/head
Gabriel Horner 2023-09-26 18:41:06 -04:00
parent 45055de24c
commit 96f1e2ab28
3 changed files with 9 additions and 2 deletions

View File

@ -1948,6 +1948,7 @@
(merge (apply dissoc block (conj (when-not keep-uuid? [:block/_refs]) :block/pre-block? :block/meta))
{:block/page {:db/id (:db/id page)}
:block/format format
;; FIXME: Handle db graphs
:block/properties (apply dissoc (:block/properties block)
(concat
(when-not keep-uuid? [:id])
@ -3777,6 +3778,7 @@
(first (:block/_parent (db/entity (:db/id block)))))
(util/collapsed? block)))
;; file graph only
(defn- set-heading-aux!
[repo block-id heading]
(let [block (db/pull [:block/uuid block-id])

View File

@ -270,6 +270,7 @@
(log/error :export-file-failed error))))
;; FIXME: All uses of :block/properties in this ns
(defn- dissoc-properties [m ks]
(if (:block/properties m)
(update m :block/properties

View File

@ -6,7 +6,8 @@
[logseq.db.default :as default-db]
[frontend.state :as state]
[frontend.util :as util]
[frontend.handler.property.util :as pu]))
[frontend.handler.property.util :as pu]
[frontend.config :as config]))
(defn- build-links
[links]
@ -127,7 +128,10 @@
(when-let [repo (state/get-current-repo)]
(let [page (util/page-name-sanity-lc page)
page-entity (db/entity [:block/name page])
tags (:tags (:block/properties page-entity))
tags (if (config/db-based-graph? repo)
(set (map #(:block/name (db/entity repo (:db/id %)))
(:block/tags page-entity)))
(:tags (:block/properties page-entity)))
tags (remove #(= page %) tags)
ref-pages (db/get-page-referenced-pages repo page)
mentioned-pages (db/get-pages-that-mentioned-page repo page show-journal)