enhance: move enum property choices to hidden page

related to LOG-2871
This commit is contained in:
Tienson Qin
2023-10-30 20:35:39 +08:00
parent fadfb84575
commit 8c7098b21f
10 changed files with 176 additions and 120 deletions

View File

@@ -75,11 +75,6 @@
(swap! *db-built-in-properties assoc repo built-in-properties)))
(set/subset? (set properties) (get @*db-built-in-properties repo))))
(defn enum-value
"Given an enum ent and the value's uuid, return the value's string"
[ent value-uuid]
(get-in ent [:block/schema :enum-config :values value-uuid :name]))
(defn readable-properties
"Given a DB graph's properties, returns a readable properties map with keys as
property names and property values dereferenced where possible. A property's
@@ -92,6 +87,6 @@
:block/name
keyword)
(if (= :enum (get-in prop-ent [:block/schema :type]))
(enum-value prop-ent v)
(:block/content (db/entity [:block/uuid v]))
v)])))
(into {})))
(into {})))