mirror of
https://github.com/logseq/logseq.git
synced 2026-05-28 14:39:48 +00:00
fix: select
This commit is contained in:
@@ -214,7 +214,10 @@
|
||||
[block property]
|
||||
(let [repo (state/get-current-repo)
|
||||
items (->> (model/get-block-property-values (:block/uuid property))
|
||||
(map (fn [[_id value]] {:value value}))
|
||||
(mapcat (fn [[_id value]]
|
||||
(if (coll? value)
|
||||
(map (fn [v] {:value v}) value)
|
||||
[{:value value}])))
|
||||
(distinct))
|
||||
add-property-f #(add-property! block (:block/original-name property) % true)]
|
||||
(select/select {:items items
|
||||
@@ -257,7 +260,7 @@
|
||||
(add-property!)))}))
|
||||
;; :others
|
||||
(if editing?
|
||||
[:div.flex.flex-1 {:class "property-value-content"}
|
||||
[:div.flex.flex-1
|
||||
(case type
|
||||
(list :number :url)
|
||||
(select block property)
|
||||
|
||||
@@ -1230,16 +1230,15 @@ independent of format as format specific heading characters are stripped"
|
||||
(defn get-block-property-values
|
||||
"Get blocks which have this property."
|
||||
[property-uuid]
|
||||
(->>
|
||||
(d/q
|
||||
'[:find ?b ?v
|
||||
:in $ ?property-uuid
|
||||
:where
|
||||
[?b :block/properties ?p]
|
||||
[(get ?p ?property-uuid) ?v]
|
||||
[(some? ?v)]]
|
||||
(conn/get-db)
|
||||
property-uuid)))
|
||||
(d/q
|
||||
'[:find ?b ?v
|
||||
:in $ ?property-uuid
|
||||
:where
|
||||
[?b :block/properties ?p]
|
||||
[(get ?p ?property-uuid) ?v]
|
||||
[(some? ?v)]]
|
||||
(conn/get-db)
|
||||
property-uuid))
|
||||
|
||||
(defn get-template-by-name
|
||||
[name]
|
||||
|
||||
Reference in New Issue
Block a user