mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix: adding uuids on imported classes causes multiple bugs
Caused invalid blocks as properties that were on the same block as new class had invalid uuids. Also caused content to have incorrect mangled uuids. Part of LOG-2985
This commit is contained in:
@@ -33,19 +33,17 @@
|
||||
"Converts a tag block with class or returns nil if this tag should be removed
|
||||
because it has been moved"
|
||||
[tag-block tag-classes]
|
||||
(if-let [new-tag (:block.temp/new-class tag-block)]
|
||||
(if-let [new-class (:block.temp/new-class tag-block)]
|
||||
(sqlite-util/build-new-class
|
||||
{:block/original-name new-tag
|
||||
:block/name (common-util/page-name-sanity-lc new-tag)
|
||||
:block/uuid (d/squuid)})
|
||||
{:block/original-name new-class
|
||||
:block/name (common-util/page-name-sanity-lc new-class)})
|
||||
(when (contains? tag-classes (:block/name tag-block))
|
||||
(-> tag-block
|
||||
add-missing-timestamps
|
||||
;; don't use build-new-class b/c of timestamps
|
||||
(merge {:block/journal? false
|
||||
:block/format :markdown
|
||||
:block/type "class"
|
||||
:block/uuid (d/squuid)})))))
|
||||
:block/type "class"})))))
|
||||
|
||||
(defn- update-page-tags
|
||||
[block tag-classes names-uuids page-tags-uuid]
|
||||
@@ -256,7 +254,11 @@
|
||||
options'))
|
||||
(seq classes-from-properties)
|
||||
;; Add a map of {:block.temp/new-class TAG} to be processed later
|
||||
(update :block/tags (fnil into []) (map #(hash-map :block.temp/new-class %) classes-from-properties))))
|
||||
(update :block/tags
|
||||
(fnil into [])
|
||||
(map #(hash-map :block.temp/new-class %
|
||||
:block/uuid (or (get-pid db %) (d/squuid)))
|
||||
classes-from-properties))))
|
||||
block)
|
||||
(dissoc :block/properties-text-values :block/properties-order :block/invalid-properties)))
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@
|
||||
[:div.sm:flex.sm:items-start
|
||||
[:div.mt-3.text-center.sm:mt-0.sm:text-left
|
||||
[:h3#modal-headline.leading-6.font-medium
|
||||
"(Optional) Properties to import as tag classes e.g. 'type':"]
|
||||
"(Optional) Properties whose values are imported as tag classes e.g. 'type':"]
|
||||
[:span.text-xs
|
||||
"Properties are case insensitive and separated by commas"]]]
|
||||
[:input.form-input.block.w-full.sm:text-sm.sm:leading-5.my-2.mb-4
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
[clojure.set :as set]
|
||||
[medley.core :as medley]
|
||||
[frontend.handler.route :as route-handler]
|
||||
[promesa.core :as p]
|
||||
[frontend.util :as util]))
|
||||
[promesa.core :as p]))
|
||||
|
||||
;;;; APIs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user