File tree Expand file tree Collapse file tree 4 files changed +14
-4
lines changed
resources/exporter-test-graph/pages Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 85
85
(swap! all-idents assoc (keyword class-name) (:db/ident m))
86
86
(with-meta m {:new-class? true })))))
87
87
88
- (defn- find-or-gen-class-uuid [page-names-to-uuids page-name db-ident]
89
- (or (get @page-names-to-uuids page-name)
88
+ (defn- find-or-gen-class-uuid [page-names-to-uuids page-name db-ident & {:keys [temp-new-class?]}]
89
+ (or (if temp-new-class?
90
+ ; ; First lookup by possible parent b/c page-names-to-uuids erroneously has the child name
91
+ ; ; and full name. To not guess at the parent name we would need to save all properties-from-classes
92
+ (or (some #(when (string/ends-with? (key %) (str ns-util/parent-char page-name))
93
+ (val %))
94
+ @page-names-to-uuids)
95
+ (get @page-names-to-uuids page-name))
96
+ (get @page-names-to-uuids page-name))
90
97
(let [new-uuid (common-uuid/gen-uuid :db-ident-block-uuid db-ident)]
91
98
(swap! page-names-to-uuids assoc page-name new-uuid)
92
99
new-uuid)))
128
135
(let [class-m (find-or-create-class db new-class all-idents)
129
136
class-m' (merge class-m
130
137
{:block/uuid
131
- (find-or-gen-class-uuid page-names-to-uuids (common-util/page-name-sanity-lc new-class) (:db/ident class-m))})]
138
+ (find-or-gen-class-uuid page-names-to-uuids (common-util/page-name-sanity-lc new-class) (:db/ident class-m) { :temp-new-class? true } )})]
132
139
(when (:new-class? (meta class-m)) (swap! classes-tx conj class-m'))
133
140
(assert (:block/uuid class-m') " Class must have a :block/uuid" )
134
141
[:block/uuid (:block/uuid class-m')])
Original file line number Diff line number Diff line change 194
194
(is (= 3 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Query ]] @conn))))
195
195
196
196
; ; Don't count pages like url.md that have properties but no content
197
- (is (= 9
197
+ (is (= 10
198
198
(count (->> (d/q '[:find [(pull ?b [:block/title :block/type ]) ...]
199
199
:where [?b :block/title ] [_ :block/page ?b] (not [?b :logseq.property/built-in? ])] @conn)
200
200
(filter ldb/internal-page?))))
Original file line number Diff line number Diff line change
1
+ parent:: [[ HumanConcept]]
2
+ - this page triggers bug with a class created via : parent that is then used by : type
Original file line number Diff line number Diff line change
1
+ type:: [[ Priority]]
You can’t perform that action at this time.
0 commit comments