mirror of https://github.com/logseq/logseq
fix: db graphs not adding :block/content for whiteboard shape
Caused by hopefully one of the last incorrect lookups of :block/propertiespull/10838/head
parent
ce37f4777e
commit
6ad5fb2dd4
|
@ -227,7 +227,8 @@
|
|||
(vec
|
||||
(concat
|
||||
[:map]
|
||||
[[:block/parent :int]
|
||||
[[:block/content :string]
|
||||
[:block/parent :int]
|
||||
;; These blocks only associate with pages of type "whiteboard"
|
||||
[:block/page :int]]
|
||||
page-or-block-attrs)))
|
||||
|
|
|
@ -25,8 +25,6 @@ logseq.graph-parser.util/unquote-string
|
|||
;; API
|
||||
logseq.graph-parser.util.page-ref/page-ref-re
|
||||
;; API
|
||||
logseq.graph-parser.whiteboard/page-block->tldr-page
|
||||
;; API
|
||||
logseq.graph-parser/get-blocks-to-delete
|
||||
;; API
|
||||
logseq.graph-parser.util.db/resolve-input
|
||||
|
|
|
@ -7,9 +7,6 @@
|
|||
(defn block->shape [block]
|
||||
(get-in block [:block/properties :logseq.tldraw.shape]))
|
||||
|
||||
(defn page-block->tldr-page [block]
|
||||
(get-in block [:block/properties :logseq.tldraw.page]))
|
||||
|
||||
(defn shape-block? [block]
|
||||
(= :whiteboard-shape (get-in block [:block/properties :ls-type])))
|
||||
|
||||
|
@ -74,6 +71,8 @@
|
|||
(str "whiteboard " (:type shape)))})
|
||||
|
||||
(defn with-whiteboard-block-props
|
||||
"Builds additional block attributes for a whiteboard block. Expects :block/properties
|
||||
to be in file graph format"
|
||||
[block page-name]
|
||||
(let [shape? (shape-block? block)
|
||||
shape (block->shape block)
|
||||
|
|
|
@ -144,6 +144,7 @@
|
|||
page-block (db/entity [:block/name page-name])]
|
||||
;; Missing support for per block format (or deprecated?)
|
||||
(try (if whiteboard?
|
||||
;; only works for file graph :block/properties
|
||||
(let [blocks (->> children
|
||||
(map (partial medley/map-keys (fn [k] (keyword "block" k))))
|
||||
(map gp-whiteboard/migrate-shape-block)
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
:block/page {:block/name (util/page-name-sanity-lc page-name)}
|
||||
:block/parent {:block/name page-name}
|
||||
:block/properties properties}
|
||||
additional-props (gp-whiteboard/with-whiteboard-block-props block page-name)]
|
||||
additional-props (gp-whiteboard/with-whiteboard-block-props
|
||||
(assoc block :block/properties {:ls-type :whiteboard-shape :logseq.tldraw.shape shape})
|
||||
page-name)]
|
||||
(merge block additional-props)))
|
||||
|
||||
(defn- build-shapes
|
||||
|
|
Loading…
Reference in New Issue