Work on fixing menus revealed inconsistency in finding farside.
This commit is contained in:
parent
dc4937dfa2
commit
43d46ca9e5
|
@ -94,11 +94,7 @@
|
||||||
(defn emit-entity-field-type
|
(defn emit-entity-field-type
|
||||||
"Emit an appropriate field type for this `property`, expected to reference an entity, in this `application`."
|
"Emit an appropriate field type for this `property`, expected to reference an entity, in this `application`."
|
||||||
[property application]
|
[property application]
|
||||||
(let [farside (child
|
(let [farside (entity-for-property property application)
|
||||||
application
|
|
||||||
#(and
|
|
||||||
(entity? %)
|
|
||||||
(= (:name (:attrs %)) (:entity (:attrs property)))))
|
|
||||||
key-properties (children-with-tag
|
key-properties (children-with-tag
|
||||||
(first (children-with-tag farside :key))
|
(first (children-with-tag farside :key))
|
||||||
:property)]
|
:property)]
|
||||||
|
@ -229,11 +225,7 @@
|
||||||
|
|
||||||
(defn compose-convenience-entity-field
|
(defn compose-convenience-entity-field
|
||||||
[field entity application]
|
[field entity application]
|
||||||
(let [farside (child
|
(let [farside (entity-for-property (property-for-field field entity) application)]
|
||||||
application
|
|
||||||
#(and
|
|
||||||
(entity? %)
|
|
||||||
(= (:name (:attrs %)) (:entity (:attrs field)))))]
|
|
||||||
(flatten
|
(flatten
|
||||||
(map
|
(map
|
||||||
(fn [f]
|
(fn [f]
|
||||||
|
@ -355,11 +347,7 @@
|
||||||
(map
|
(map
|
||||||
(fn [f]
|
(fn [f]
|
||||||
(let
|
(let
|
||||||
[farside (child
|
[farside (entity-for-property f application)]
|
||||||
application
|
|
||||||
#(and
|
|
||||||
(entity? %)
|
|
||||||
(= (:name (:attrs %)) (:entity (:attrs f)))))]
|
|
||||||
(str
|
(str
|
||||||
(safe-name (:table (:attrs entity)) :sql)
|
(safe-name (:table (:attrs entity)) :sql)
|
||||||
"."
|
"."
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
(query-name e :search-strings)
|
(query-name e :search-strings)
|
||||||
(query-name e :search-strings)
|
(query-name e :search-strings)
|
||||||
(keyword (-> property :attrs :farkey))
|
(keyword (-> property :attrs :farkey))
|
||||||
(list (keyword (-> property :attrs :name)) 'params)))
|
(list (keyword (-> property :attrs :name)) 'record)))
|
||||||
{})
|
{})
|
||||||
;; "link" (list
|
;; "link" (list
|
||||||
;; 'do
|
;; 'do
|
||||||
|
@ -141,9 +141,7 @@
|
||||||
:property
|
:property
|
||||||
#(= (-> % :attrs :name) p-name))
|
#(= (-> % :attrs :name) p-name))
|
||||||
f-name (-> property :attrs :entity)
|
f-name (-> property :attrs :entity)
|
||||||
farside (child-with-tag application
|
farside (entity-for-property property application)]
|
||||||
:entity
|
|
||||||
#(= (-> % :attrs :name) f-name))]
|
|
||||||
(if (and (entity? entity) (entity? farside))
|
(if (and (entity? entity) (entity? farside))
|
||||||
(list 'if (list 'all-keys-present? 'params (key-names entity true))
|
(list 'if (list 'all-keys-present? 'params (key-names entity true))
|
||||||
(hash-map
|
(hash-map
|
||||||
|
|
|
@ -264,12 +264,7 @@
|
||||||
(let
|
(let
|
||||||
[type (:type (:attrs property))
|
[type (:type (:attrs property))
|
||||||
farname (:entity (:attrs property))
|
farname (:entity (:attrs property))
|
||||||
farside (first
|
farside (entity-for-property property application)
|
||||||
(children
|
|
||||||
application
|
|
||||||
#(and
|
|
||||||
(= (:tag %) :entity)
|
|
||||||
(= (:name (:attrs %)) farname))))
|
|
||||||
fs-distinct (user-distinct-properties farside)
|
fs-distinct (user-distinct-properties farside)
|
||||||
farkey (or
|
farkey (or
|
||||||
(:farkey (:attrs property))
|
(:farkey (:attrs property))
|
||||||
|
@ -322,10 +317,7 @@
|
||||||
[issue 47](https://github.com/simon-brooke/youyesyet/issues/47)."
|
[issue 47](https://github.com/simon-brooke/youyesyet/issues/47)."
|
||||||
[property form entity application]
|
[property form entity application]
|
||||||
(let [farname (:entity (:attrs property))
|
(let [farname (:entity (:attrs property))
|
||||||
farside (first
|
farside (entity-for-property property application)
|
||||||
(children
|
|
||||||
application
|
|
||||||
#(= (:name (:attrs %)) farname)))
|
|
||||||
magnitude (try
|
magnitude (try
|
||||||
(read-string (:magnitude (:attrs farside)))
|
(read-string (:magnitude (:attrs farside)))
|
||||||
(catch Exception _ 7))
|
(catch Exception _ 7))
|
||||||
|
@ -597,12 +589,7 @@
|
||||||
#(=
|
#(=
|
||||||
(-> % :attrs :name)
|
(-> % :attrs :name)
|
||||||
(-> auxlist :attrs :property)))
|
(-> auxlist :attrs :property)))
|
||||||
farside (child-with-tag
|
farside (entity-for-property property application)]
|
||||||
application
|
|
||||||
:entity
|
|
||||||
#(=
|
|
||||||
(-> % :attrs :name)
|
|
||||||
(-> property :attrs :entity)))]
|
|
||||||
(if
|
(if
|
||||||
(and property farside)
|
(and property farside)
|
||||||
{:tag :div
|
{:tag :div
|
||||||
|
@ -771,10 +758,7 @@
|
||||||
(-> field :attrs :property)
|
(-> field :attrs :property)
|
||||||
(-> % :attrs :name)))
|
(-> % :attrs :name)))
|
||||||
farname (:entity (:attrs property))
|
farname (:entity (:attrs property))
|
||||||
farside (first
|
farside (entity-for-property property application)
|
||||||
(children
|
|
||||||
application
|
|
||||||
#(= (:name (:attrs %)) farname)))
|
|
||||||
magnitude (try
|
magnitude (try
|
||||||
(read-string
|
(read-string
|
||||||
(:magnitude
|
(:magnitude
|
||||||
|
|
Loading…
Reference in a new issue