fix: new class should always set :block/type to "class"

New change with :block/type "page" was causing :tag-classes option to
fail. Part of LOG-3176
feat/asset-sync
Gabriel Horner 2024-07-08 11:46:27 -04:00
parent 95ebc1e805
commit 3d732cb018
2 changed files with 6 additions and 7 deletions

View File

@ -110,12 +110,11 @@
[block]
{:pre [(qualified-keyword? (:db/ident block))]}
(block-with-timestamps
(merge (cond->
(cond-> (merge block
{:block/type (set (concat (:block/type block) ["class" "page"]))
:block/format :markdown}
:block/format :markdown})
(not= (:db/ident block) :logseq.class/Root)
(assoc :class/parent :logseq.class/Root))
block)))
(assoc :class/parent :logseq.class/Root))))
(defn build-new-page
"Builds a basic page to be transacted. A minimal version of gp-block/page-name->map"

View File

@ -262,7 +262,7 @@
(is (= (:block/content block) "Inception")
"tagged block with configured tag strips tag from content")
(is (= ["class"] (:block/type tag-page))
(is (= ["class" "page"] (:block/type tag-page))
"configured tag page in :tag-classes is a class")
(is (and another-tag-page (not (contains? (set (:block/type another-tag-page)) "class")))
"unconfigured tag page is not a class")