diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index d45b7a2477..62453e8e86 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -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) diff --git a/src/main/frontend/db/model.cljs b/src/main/frontend/db/model.cljs index c6fe28e26b..50619b9388 100644 --- a/src/main/frontend/db/model.cljs +++ b/src/main/frontend/db/model.cljs @@ -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]