mirror of
https://github.com/logseq/logseq.git
synced 2026-04-26 23:25:05 +00:00
Replace enum type with available choices (#10438)
* Add type schema for enum values * Refactor: closed values instead of enum to limit values There's no need to add the enum type, we just want to limit the values. * feat: :page type supports closed values * fix: can't set property values for text/number types * fix: don't trigger on-chosen when unmounting any select component * fix: can't apply both page classes limitation and closed values * fix: merge conflicts * fix: ui not refresh when changing closed value * fix: can't set icon for closed value
This commit is contained in:
@@ -87,7 +87,9 @@
|
||||
[(-> prop-ent
|
||||
:block/name
|
||||
keyword)
|
||||
(if (= :enum (get-in prop-ent [:block/schema :type]))
|
||||
(:block/content (db/entity [:block/uuid v]))
|
||||
(if (seq (get-in prop-ent [:block/schema :values])) ; closed values
|
||||
(when-let [block (db/entity [:block/uuid v])]
|
||||
(or (:block/original-name block)
|
||||
(get-in block [:block/schema :value])))
|
||||
v)])))
|
||||
(into {})))
|
||||
|
||||
Reference in New Issue
Block a user