File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed
deps/outliner/src/logseq/outliner Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 327327 (:block/title m*)
328328 (not= (:block/title m*) (:block/title block-entity)))
329329 (outliner-validate/validate-block-title db (:block/title m*) block-entity))
330- _ (when (and db-based? (seq (:block/tags m*)))
331- ; ; Add built-in? b/c it's not available here
332- (doseq [tag (map #(assoc % :logseq.property/built-in?
333- (contains? sqlite-create-graph/built-in-pages-names (:block/title %))) (:block/tags m*))]
334- (outliner-validate/validate-built-in-pages tag {:message " Built-in page can't be a tag" })))
335330 m (cond-> m*
336331 db-based?
337332 (dissoc :block/format :block/pre-block? :block/priority :block/marker :block/properties-order ))]
Original file line number Diff line number Diff line change 218218 (let [result (db-model/get-all-readable-classes repo {:except-root-class? true })]
219219 (set-values! result)))
220220 [])
221- (let [items (->> values
222- (map :block/title )
223- sort)]
221+ (let [items (->> (sort-by :block/title values)
222+ (map (fn [block]
223+ {:label (:block/title block)
224+ :value (:block/uuid block)})))]
224225 (select items
225- (fn [{:keys [value]}]
226- (append-tree! *tree opts loc [(if db-based? :tags :page-tags ) value]))))))
226+ (fn [{:keys [value label]}]
227+ (append-tree! *tree opts loc [(if db-based? :tags :page-tags )
228+ (if db-based? (str value) label)]))
229+ {:extract-fn :label }))))
227230
228231(rum/defc page-search
229232 [on-chosen]
Original file line number Diff line number Diff line change 427427 (let [db (db-conn/get-db )]
428428 (->> tags
429429 (mapcat (fn [tag-name]
430- (when-let [tag-id (first (ldb/page-exists? db tag-name #{:logseq.class/Tag }))]
430+ (when-let [tag-id (if (common-util/uuid-string? tag-name)
431+ [:block/uuid (uuid tag-name)]
432+ (first (ldb/page-exists? db tag-name #{:logseq.class/Tag })))]
431433 (when-let [tag (db-utils/entity tag-id)]
432434 (->> (db-class/get-structured-children db (:db/id tag))
433435 (cons (:db/id tag)))))))
You can’t perform that action at this time.
0 commit comments